NuGet "Unable to load the service index" - Feed Down in CI
NuGet could not reach the feed's index.json at all - the request never got a usable response. This is an infrastructure failure (DNS, network blip, or the feed itself being down), not a problem with your project. Self-healing managed runners like Latchkey auto-retry transient infrastructure failures so a momentary feed outage does not fail the whole job.
What this error means
Restore fails with "Unable to load the service index for source" and an underlying network/timeout/DNS error. It is often intermittent - re-running the job later succeeds with no code change.
error NU1301: Unable to load the service index for source
https://pkgs.dev.azure.com/contoso/_packaging/internal/nuget/v3/index.json.Common causes
The feed is temporarily down or overloaded
Azure Artifacts, GitHub Packages, or nuget.org had a transient outage, so the index.json request failed or timed out.
Network or DNS problem on the runner
A DNS hiccup, proxy issue, or brief network drop on the runner prevented the connection from completing.
How to fix it
Retry restore on transient failure
- Wrap restore in a short retry loop so a transient blip does not fail the job.
- Keep restore as its own step so the retry is scoped narrowly.
- Re-run the workflow if the feed was briefly down.
for i in 1 2 3; do
dotnet restore && break
echo "restore failed (attempt $i), retrying..."
sleep $((i*10))
doneConfirm the feed is up and reachable
- Open the feed status page or hit the index.json URL to confirm availability.
- Check the runner can resolve DNS and reach the host (proxy, firewall).
- On a managed self-healing runner the transient retry is automatic.
How to prevent it
- Cache the NuGet global packages folder keyed on the lock file to reduce feed dependence.
- Use an internal upstream/pull-through feed to smooth over public-feed blips.
- Run CI on self-healing managed runners that auto-retry transient feed failures.