Skip to content

test: keep npm's debug logs and Verdaccio's timestamps when a journey install fails - #3581

Merged
fforootd merged 1 commit into
mainfrom
ci/journey-npm-install-diagnostics
Dec 2, 2026
Merged

fforootd merged 1 commit into
mainfrom
ci/journey-npm-install-diagnostics

Conversation

@fforootd

@fforootd fforootd commented Dec 2, 2026

Copy link
Copy Markdown
Member

Context

All three lanes printed only setup exited 3: Dependency install failed: npm install, after 75–137 s in setup.

Summary

What the uploaded diagnostics already showed

  • setup.stderr.log, the same in all three lanes: npm error code ECONNRESET / npm error network aborted. npm's full debug log stayed in the lane's npm cache (<lane>/.npm-cache/_logs), which is not uploaded.
  • verdaccio.log: an uplink ESOCKETTIMEDOUT (the 60 s timeout in local-registry.mjs), then aborted and ERR_HTTP_HEADERS_SENT.
  • The streams that died were @vue/runtime-dom-3.5.46.tgz (vue), rollup-plugin-visualizer-7.3.0.tgz (nuxt) and one in the preexisting-nuxt lane.

The mechanism

  1. Verdaccio answers a proxied tarball 200 before it asks npmjs: runtime-dom's 200 is logged 36 lines before its making request to the uplink.
  2. When registry.npmjs.org then sends nothing for 60 s, Verdaccio can only abort a response npm has already accepted.
  3. npm (pacote's tarballStream) retries a tarball only on EINTEGRITY, Z_DATA_ERROR, ENOENT and EISDIR, never on a body that aborts. One stalled stream fails the install.

What it is not

  • Not a port or cache shared between lanes. Each lane runs its own Verdaccio on its own port with its own empty storage and its own npm cache. The ConflictError: this package is already present lines are two concurrent npm requests for one tarball inside a single lane, and they are harmless.
  • Not one network event. The two lanes in run 46909830486 stalled about 50 s apart.
  • Not a time limit in the repository. The stall is a single upstream stream to registry.npmjs.org going silent for at least 60 s while the runner was fully loaded. That is outside the repository: npm's CDN or the runner's egress.

This PR: make the next one diagnosable

  • run-local.mjs copies the lane's npm debug logs into diagnostics/<variant>/<framework>/npm-logs/. They hold every request with its status and timing.
  • local-registry.mjs timestamps Verdaccio's log lines with pretty-timestamped, so a stalled tarball lines up between the two logs.
    • pretty-timestamped only works under the current log key; under the deprecated logs list it printed no timestamps. Switching keys also drops Verdaccio's deprecation warning.

Not in this PR: options to remove the failure

These need a decision; each is out of scope for a diagnostics change.

  • zitadel setup could retry npm install once on a network-class npm error. Customers on flaky networks would benefit too, but it is product behavior and needs a changeset and SKILL.md.
  • A run-wide Verdaccio cache in front of the lanes' registries would fetch each tarball from npmjs once per run instead of once per lane: roughly 540 uplink requests for the vue lane and 1,343 for nuxt today. That cuts the exposure, not the zero-retry chain.
  • The lane cannot retry on its own without changing what it tests. Setup runs more steps after the install (the after-install script, then its commit), so rerunning only npm install skips them, and rerunning setup on the scaffolded directory takes the patch path instead.

Validation

  • vitest run --config journey/vitest.config.ts journey/scripts/local-registry.test.mjs (from e2e/): 9 pass.
  • Started Verdaccio 6.11.1 with the new log: line: each line is prefixed [2026-12-02 19:09:41]. The old logs: list with the same format printed none.
  • Confirmed npm writes its debug log to <npm_config_cache>/_logs/. That is the path the CI error message names (<frameworkWorkDir>/.npm-cache/_logs), and the one now copied.
  • biome check on both files: clean.
  • Not run: a full journey lane, or a lane that fails, in CI.

Release notes / changeset

  • No changeset required — no shipped behavior changed.

Notes

  • The diagnostics artifact uploads only when the job fails, and a lane's folder was 0.3–0.7 MB, so the npm logs add little.

Generated by Claude Code

… install fails

Three journey lanes failed on 2026-12-02 with only `setup exited 3:
Dependency install failed: npm install`. setup.stderr.log held npm's last
line (ECONNRESET, network aborted) and verdaccio.log an uplink
ESOCKETTIMEDOUT, but nothing tied the two in time and npm's debug log, the
one with every request and its timing, stayed in the lane's npm cache, which
is not uploaded.

Copy the lane's npm debug logs into its diagnostics, and timestamp
Verdaccio's log lines. `pretty-timestamped` only takes effect under the
current `log` key, not the deprecated `logs` list, which also drops
Verdaccio's deprecation warning.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVbPErbwzmWcPYv1gS
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cloud Ready Ready Preview Dec 2, 2026 7:18pm UTC

Request Review

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: e0db62d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fforootd
fforootd marked this pull request as ready for review December 2, 2026 20:09
Copilot AI balanced review requested due to automatic review settings December 2, 2026 20:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-12-02T20:14:56.876000Z e0db62d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain in the npm diagnostic-log collection and Verdaccio logging changes.

No open issues 🎉

What changed in this PR

Improves consumer journey failure diagnostics so npm request failures can be correlated with Verdaccio logs, without changing shipped behavior.

Changes:

  • Copies lane-local npm debug logs into collected diagnostics.
  • Enables timestamped Verdaccio output using the current log configuration key.
File Description
e2e/​journey/​scripts/​run-local.mjs Collects npm cache debug logs under npm-logs.
e2e/​journey/​scripts/​local-registry.mjs Enables timestamped logging and replaces the deprecated logs key.

Review effort: Balanced

@fforootd
fforootd added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 5591f22 Dec 2, 2026
19 checks passed
@fforootd
fforootd deleted the ci/journey-npm-install-diagnostics branch December 2, 2026 20:22
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Dec 2, 2026

This branch was successfully deployed

1 active deployment
Preview — e0db62df Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants