From a1fb373988711d734b88caf187932d5ee67483c1 Mon Sep 17 00:00:00 2001 From: "jared-outpost[bot]" Date: Fri, 31 Jul 2026 19:23:45 +0000 Subject: [PATCH] fix(fs): ignore ETIMEDOUT in scandir on network mounts ETIMEDOUT errors during readdir on network/cloud-mounted filesystems (CloudStorage, remote server mounts) were reported to Sentry as noise. The scan already recovers gracefully by returning an empty list, so add ETIMEDOUT to isIgnorableFileError's allow-list. Fixes CLI-1ZB --- packages/cli/src/lib/dsn/fs-utils.ts | 4 +++- packages/cli/test/lib/dsn/fs-utils.test.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/lib/dsn/fs-utils.ts b/packages/cli/src/lib/dsn/fs-utils.ts index 50ae0231cb..e48b26e5cc 100644 --- a/packages/cli/src/lib/dsn/fs-utils.ts +++ b/packages/cli/src/lib/dsn/fs-utils.ts @@ -19,6 +19,7 @@ import * as Sentry from "@sentry/node-core/light"; * - ENOTDIR: A path component is not a directory (e.g., `/file.txt/child`) * - EINVAL: Invalid argument (e.g., scandir on a special/virtual filesystem entry like /proc paths) * - ELOOP: Too many symbolic links (e.g., cyclic symlink encountered during scan) + * - ETIMEDOUT: Connection timed out (e.g., transient read on a network or cloud-mounted filesystem) * * All other errors are unexpected and should be reported to Sentry. * @@ -35,7 +36,8 @@ function isIgnorableFileError(error: unknown): boolean { code === "EISDIR" || code === "ENOTDIR" || code === "EINVAL" || - code === "ELOOP" + code === "ELOOP" || + code === "ETIMEDOUT" ); } return false; diff --git a/packages/cli/test/lib/dsn/fs-utils.test.ts b/packages/cli/test/lib/dsn/fs-utils.test.ts index 2371b215f2..d8edd1a7ac 100644 --- a/packages/cli/test/lib/dsn/fs-utils.test.ts +++ b/packages/cli/test/lib/dsn/fs-utils.test.ts @@ -77,6 +77,14 @@ describe("handleFileError", () => { }); expect(captureException).not.toHaveBeenCalled(); }); + + test("ETIMEDOUT — connection timed out on a network mount", () => { + handleFileError(errnoError("ETIMEDOUT"), { + operation: "scandir", + path: "/mnt/cloud-storage", + }); + expect(captureException).not.toHaveBeenCalled(); + }); }); describe("unexpected errors (SHOULD report to Sentry)", () => {