Skip to content

Add verbose logging and diagnostics for npm ci 0xDEAD failures#66447

Merged
wtgodbe merged 1 commit intodotnet:mainfrom
wtgodbe:wtgodbe/npm-diagnostics
Apr 24, 2026
Merged

Add verbose logging and diagnostics for npm ci 0xDEAD failures#66447
wtgodbe merged 1 commit intodotnet:mainfrom
wtgodbe:wtgodbe/npm-diagnostics

Conversation

@wtgodbe
Copy link
Copy Markdown
Member

@wtgodbe wtgodbe commented Apr 23, 2026

Problem

npm ci intermittently fails with exit code 57005 (0xDEAD) in CI, producing zero diagnostic output between "Restoring NPM packages..." and the MSB3073 error. The retry settings and ConsoleToMsBuild added in #66430 didn't help because npm crashes before writing anything.

From build 1393671, the full output is:

Restoring NPM packages...
[error] npm ci exited with code 57005.

No error details, no stack trace, no network diagnostics.

Fix

  1. Pre-flight diagnostics: Logs node --version, npm --version, npm config list, and disk space before npm ci runs — captured even on silent crashes
  2. --loglevel verbose: npm logs each network request and registry operation before the crash point
  3. Capture npm debug log: Uses IgnoreExitCode to let the build dump .npm/_logs/*-debug-0.log after failure instead of immediately aborting

This won't fix the crashes, but will give us the information needed to diagnose whether it's a network timeout, auth issue, disk space, or something else entirely.

Relates to #62807

Copilot AI review requested due to automatic review settings April 23, 2026 21:07
@wtgodbe wtgodbe requested a review from a team as a code owner April 23, 2026 21:07
@github-actions github-actions Bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Apr 23, 2026
@wtgodbe wtgodbe force-pushed the wtgodbe/npm-diagnostics branch from 2b7a028 to 11e5247 Compare April 23, 2026 21:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances MSBuild-driven npm restore diagnostics to help investigate intermittent npm ci crashes in CI (notably exit code 0xDEAD/57005) by emitting more environment info and attempting to surface npm’s own debug logs.

Changes:

  • Adds pre-flight diagnostics (node --version, npm --version, npm config list, disk space) before running npm ci.
  • Runs npm ci with --loglevel verbose and delays failing the build to allow post-failure log dumping.
  • Attempts to dump *-debug-0.log from npm logs before emitting a final MSBuild error.

Comment thread eng/Npm.Workspace.nodeproj Outdated
Comment thread eng/Npm.Workspace.nodeproj Outdated
Comment thread eng/Npm.Workspace.nodeproj
@wtgodbe wtgodbe force-pushed the wtgodbe/npm-diagnostics branch 3 times, most recently from 2568ca4 to 3935052 Compare April 23, 2026 22:26
The npm ci command intermittently fails with exit code 57005 (0xDEAD)
in CI, producing zero diagnostic output. The .npmrc retry settings and
ConsoleToMsBuild added in dotnet#66430 did not help because npm crashes
before writing any error output.

Add pre-flight diagnostics (node/npm version, npm config, disk space)
so the environment is captured even on silent crashes. Switch to
--loglevel verbose so npm logs each network request before the crash
point. Capture the npm debug log file after failure instead of
immediately aborting, since npm writes detailed logs to .npm/_logs/
even on crash.

Relates to dotnet#62807

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wtgodbe wtgodbe force-pushed the wtgodbe/npm-diagnostics branch from 3935052 to e4786e5 Compare April 23, 2026 23:41
@wtgodbe wtgodbe merged commit f951446 into dotnet:main Apr 24, 2026
25 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview5 milestone Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants