Skip to content

/errors/nuget/nu1301-unable-to-load-the-service-index

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

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
tool
NuGet
exit code
1
versions
.NET SDK 6 – 10
os
any

error NU1301: Unable to load the service index for source URL means NuGet could not download the index.json of a package source, so it cannot look up any package there. The URL in the message tells you which source failed. Check that the URL is right and reachable from this machine, add credentials or a proxy if the feed needs them, or disable the source if the project does not use it.

Reproduce it

A source on a local port where nothing is listening:

bash
cat > nuget.config <<'EOF'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="internal" value="https://127.0.0.1:4860/v3/index.json" />
  </packageSources>
</configuration>
EOF
cat > App.csproj <<'EOF'
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
  </ItemGroup>
</Project>
EOF
dotnet restore 2>&1 | grep -oE "error NU1301: Unable to load the service index for source [^ ]+" | sort -u
exit "${PIPESTATUS[0]}"

Output · exit 1

error NU1301: Unable to load the service index for source https://127.0.0.1:4860/v3/index.json.

NuGet adds the underlying network error after the URL (for example a refused connection); it depends on the operating system, so it is cut here.

Fix

bash
dotnet nuget list source                     # every configured source, enabled or not
dotnet nuget disable source internal         # stop using a source the project does not need

For a source the project needs, check the URL in a browser or with curl, then add credentials in nuget.config under packageSourceCredentials, or install the feed's credential provider.

The .NET 10 SDK rejects a source with an http:// URL before any connection with error NU1302: You are running the 'restore' operation with an 'HTTP' source. Switch the source to HTTPS, or set allowInsecureConnections="true" on that source in nuget.config if it is a trusted internal server.

Sources