Skip to content
Latchkey

NuGet "error NU1301: Unable to load the service index for source" in CI

NuGet tries to load each feed's index.json (the v3 service index) before restoring. NU1301 means that request failed: the feed is unreachable, behind a proxy, returned an error status, or rejected the request for credentials.

What this error means

dotnet restore fails with "error NU1301: Unable to load the service index for source https://.../index.json". Public packages may also fail if nuget.org itself is the unreachable source.

dotnet
error NU1301: Unable to load the service index for source https://pkgs.contoso.com/v3/index.json.

Common causes

The feed is down or unreachable from the runner

A transient feed outage, DNS failure, or proxy/firewall block stops the index request from completing.

The feed requires auth that was not sent

A private feed returns an auth challenge on the index request; without credentials the index cannot load.

How to fix it

Retry, then verify reachability and proxy

  1. Re-run restore once; a transient feed blip often clears.
  2. Confirm the runner can reach the feed host (DNS, proxy, firewall).
  3. If it is private, ensure credentials are configured (see NU1301 vs 401).
Terminal
dotnet restore --verbosity normal

Add resilience and a fallback timeout

Increase HTTP retries so a slow index load does not fail the job on the first attempt.

.github/workflows/ci.yml
env:
  NUGET_HTTP_TIMEOUT: '300'
  NUGET_ENABLE_LEGACY_CSPROJ_PACK: 'false'

How to prevent it

  • Pin feed URLs in a committed nuget.config so sources are explicit.
  • Configure proxy settings on the runner when feeds are internal.
  • Add retries for transient feed and network failures.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →