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.
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
- Re-run restore once; a transient feed blip often clears.
- Confirm the runner can reach the feed host (DNS, proxy, firewall).
- If it is private, ensure credentials are configured (see NU1301 vs 401).
dotnet restore --verbosity normalAdd resilience and a fallback timeout
Increase HTTP retries so a slow index load does not fail the job on the first attempt.
env:
NUGET_HTTP_TIMEOUT: '300'
NUGET_ENABLE_LEGACY_CSPROJ_PACK: 'false'How to prevent it
- Pin feed URLs in a committed
nuget.configso sources are explicit. - Configure proxy settings on the runner when feeds are internal.
- Add retries for transient feed and network failures.