Add verbose logging and diagnostics for npm ci 0xDEAD failures#66447
Merged
wtgodbe merged 1 commit intodotnet:mainfrom Apr 24, 2026
Merged
Add verbose logging and diagnostics for npm ci 0xDEAD failures#66447wtgodbe merged 1 commit intodotnet:mainfrom
wtgodbe merged 1 commit intodotnet:mainfrom
Conversation
2b7a028 to
11e5247
Compare
javiercn
approved these changes
Apr 23, 2026
Contributor
There was a problem hiding this comment.
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 runningnpm ci. - Runs
npm ciwith--loglevel verboseand delays failing the build to allow post-failure log dumping. - Attempts to dump
*-debug-0.logfrom npm logs before emitting a final MSBuild error.
2568ca4 to
3935052
Compare
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>
3935052 to
e4786e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm ciintermittently fails with exit code 57005 (0xDEAD) in CI, producing zero diagnostic output between "Restoring NPM packages..." and the MSB3073 error. The retry settings andConsoleToMsBuildadded in #66430 didn't help because npm crashes before writing anything.From build 1393671, the full output is:
No error details, no stack trace, no network diagnostics.
Fix
node --version,npm --version,npm config list, and disk space beforenpm ciruns — captured even on silent crashes--loglevel verbose: npm logs each network request and registry operation before the crash pointIgnoreExitCodeto let the build dump.npm/_logs/*-debug-0.logafter failure instead of immediately abortingThis 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