dotnet restore "Unable to load the service index for source" in CI
dotnet restore tried to read the NuGet v3 service index at the top of the feed and could not. The feed is unreachable, temporarily down, or returning a non-success status, so no package can resolve from that source.
What this error means
restore stops with "error: Unable to load the service index for source https://.../index.json" before listing any package. Public nuget.org sources may still work while a private one fails.
error NU1301: Unable to load the service index for source https://pkgs.internal.example.com/nuget/v3/index.json.
Response status code does not indicate success: 500 (Internal Server Error).Common causes
The feed is down or returning a server error
A 5xx from the service index endpoint means the feed itself is failing, not your request. Restore cannot enumerate packages until it recovers.
The feed URL is wrong or unreachable from the runner
A typo in the index.json URL, or a network path the runner cannot reach (proxy, firewall), makes the service index unloadable.
How to fix it
Confirm the feed URL and reachability
- Verify the
index.jsonURL innuget.configmatches the feed exactly. - Curl the service index from a runner step to confirm it returns 200.
- If it is a 5xx, retry once the feed recovers; the request is correct.
curl -sSf https://pkgs.internal.example.com/nuget/v3/index.jsonFall back to nuget.org for public packages
If a private mirror is flaky, add nuget.org as a source so public packages still restore while the mirror recovers.
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />How to prevent it
- Pin the exact
index.jsonURL and commitnuget.config. - Keep a public fallback source for packages that do not require the private feed.
- Cache restored packages so a transient feed outage does not fail every job.