Skip to content

fix(cli): Ignore ENOTCONN from disconnected mounts during file scans - #1544

Merged
betegon merged 1 commit into
mainfrom
fix/cli-dsn-scan-ignore-enotconn
Oct 19, 2026
Merged

betegon merged 1 commit into
mainfrom
fix/cli-dsn-scan-ignore-enotconn

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Trigger: project auto-detection walks the working tree. If the walk reaches a stale or disconnected FUSE or network mount (for example a dropped sshfs/s3fs mount), readdir fails with ENOTCONN: socket is not connected, scandir.

Root cause: listDirEntries in src/lib/scan/walker.ts sends readdir failures to handleFileError, which skips the directory and continues the walk. But isIgnorableFileError in src/lib/dsn/fs-utils.ts didn't list ENOTCONN, so each occurrence was also captured as an unexpected error even though the command itself carried on normally. The same situation as ETIMEDOUT on a cloud-mounted directory, which is already ignored.

Change: ENOTCONN is now treated as an expected file system error, alongside ETIMEDOUT. The walk behaves the same (the directory is skipped); only the false error report goes away. Other codes such as EIO are still reported.

Validation:

  • New handleFileError regression test in test/lib/dsn/fs-utils.test.ts for an ENOTCONN scandir error. It failed before the fix and passes after it. The existing scan tests in test/lib/scan pass.
  • pnpm run tsc, pnpm run lint, and pnpm --filter sentry run lint pass. pnpm --filter sentry run test passes except for 6 permission-based tests (completions, telemetry, upgrade, code-scanner, file-changes), which fail the same way on unmodified main in the sandbox I used.

via Junior system actor scheduler.

--

View Junior Session [Sentry]

Scanning into a stale or disconnected FUSE/network mount makes readdir fail with ENOTCONN. handleFileError treated that as unexpected and captured it as an error, even though the walk skips the directory and continues. Treat ENOTCONN like ETIMEDOUT.
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 19, 2026 12:34pm UTC

Request Review

@sentry-junior sentry-junior Bot added the CLI Sentry CLI and CLI documentation label Oct 19, 2026
@BYK
BYK marked this pull request as ready for review October 19, 2026 12:48
@github-actions github-actions Bot added the risk: low PR risk score: low label Oct 19, 2026
@betegon
betegon merged commit f256676 into main Oct 19, 2026
27 checks passed
@betegon
betegon deleted the fix/cli-dsn-scan-ignore-enotconn branch October 19, 2026 12:59

This branch was previously deployed

1 inactive deployment
Preview — 7ea060fa Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Sentry CLI and CLI documentation risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants