npm / npm/rfcs

Add Logging for Http Redirects to Package Content

Open
#762 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
778
Forks
266
PR merge metrics
No merged PRs in 30d

Description

Npm does not log a line for http redirects on package download, so it is not possible to determine whether failures occur before or after being redirected to make a second request.

Azure Artifacts for example responds with a 303 redirect to Azure blob storage when npm requests a tgz file. If npm were to log a line with a 303 redirect and then another line for the subsequent request to storage, this would significantly improve debugging and allow users to determine if they are having connectivity/availability issues with the package repository or the underlying storage that is getting redirected to.

Example failure that cannot differentiate whether package repo or storage failed:

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://pkgs.dev.azure.com/myOrg/project/_packaging/myPackageFeed/npm/registry/ansi-regex/-/ansi-regex-4.2.0.tgz failed, reason:
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no implementation file or test. Start by tracing npm's package-download request flow and current network logging, then reproduce an Azure Artifacts 303 redirect to blob storage; done means logs identify both the redirect and subsequent request, including failures at either stage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.