-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log retries #294
Log retries #294
Conversation
This technically logs one extra "retrying" because it doesn't know if the retry module is going to actually retry or give up at this point. |
$ node . view 503 --loglevel verbose --registry=https://httpbin.org/status --fetch-retries=1
npm verbose cli /Users/wraithgar/.nvm/versions/node/v22.0.0/bin/node /Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries
npm info using [email protected]
npm info using [email protected]
npm verbose title npm view 503
npm verbose argv "view" "503" "--loglevel" "verbose" "--registry" "https://httpbin.org/status" "--fetch-retries" "1"
npm verbose logfile logs-max:10 dir:/Users/wraithgar/.npm/_logs/2024-04-30T14_19_47_652Z-
npm verbose logfile /Users/wraithgar/.npm/_logs/2024-04-30T14_19_47_652Z-debug-0.log
npm http fetch GET https://httpbin.org/status/503 attempt 1 failed with 503
npm http fetch GET https://httpbin.org/status/503 attempt 2 failed with 503
npm http fetch GET 503 https://httpbin.org/status/503 10505ms attempt #2 (cache skip)
npm verbose stack HttpErrorGeneral: 503 SERVICE UNAVAILABLE - GET https://httpbin.org/status/503
npm verbose stack at /Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries/node_modules/npm-registry-fetch/lib/check-response.js:95:15
npm verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm verbose stack at async RegistryFetcher.packument (/Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries/node_modules/pacote/lib/registry.js:91:19)
npm verbose stack at async View.getData (/Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries/lib/commands/view.js:193:20)
npm verbose stack at async View.exec (/Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries/lib/commands/view.js:104:28)
npm verbose stack at async module.exports (/Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries/lib/cli/entry.js:74:5)
npm verbose statusCode 503
npm verbose pkgid 503@*
npm verbose cwd /Users/wraithgar/Development/npm/cli/branches/gar_fetch-retries
npm verbose Darwin 23.4.0
npm verbose node v22.0.0
npm verbose npm v10.6.0
npm error code E503
npm error 503 SERVICE UNAVAILABLE - GET https://httpbin.org/status/503
npm verbose exit 1
npm verbose code 1
npm error A complete log of this run can be found in: /Users/wraithgar/.npm/_logs/2024-04-30T14_19_47_652Z-debug-0.log |
b7b5ba0
to
012b243
Compare
Reworded it to just list the retry number if it is a retriable request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for adding this logging! This will make investigating transient registry errors much easier.
Three commits:
Closes npm/cli#7371