CI 503/502 from a Package Registry
A 5xx from a registry is a server-side, transient error, the registry or its gateway was briefly unavailable. It is retryable and not a problem with your request.
What this error means
An install fails with 503 Service Unavailable or 502 Bad Gateway from the registry. Re-running the unchanged job typically succeeds once the upstream recovers.
shell
npm error code E503
npm error 503 Service Unavailable - GET https://registry.npmjs.org/reactCommon causes
The registry or its gateway was briefly down
A momentary outage or deploy on the registry side returns 502/503 until it recovers.
Upstream overload
A spike in traffic can make a registry shed load with 5xx for a short window.
How to fix it
Retry on 5xx
Client retries cover a transient upstream error.
shell
npm config set fetch-retries 5
npm config set fetch-retry-factor 2
npm ciReduce dependence on one upstream
- Use a pull-through cache or private mirror.
- Cache dependencies so a registry blip does not block the build.
- Pin versions to reduce metadata round-trips.
How to prevent it
- Configure retries for registry fetches.
- Run a caching proxy/mirror for dependencies.
- On managed runners, transient registry 5xx responses are detected and the job is automatically retried, so a one-off blip does not fail the build.
Related guides
CI 429 Too Many Requests (Rate Limit)Fix HTTP 429 Too Many Requests in CI when a registry or API rate-limits the runner. How to back off and why a…
apt-get update "Failed to fetch" from Mirror in CIFix "apt-get update ... Failed to fetch" in CI when a package mirror is briefly unreachable. How to retry and…
CI "Connection reset by peer" (ECONNRESET)Fix "Connection reset by peer" (ECONNRESET) in CI when a remote drops an in-flight connection. How to retry a…
CI "TLS handshake timeout" Reaching a RegistryFix "net/http: TLS handshake timeout" in CI when a secure connection stalls mid-handshake. How to retry and w…