0

I am struggling in restoring a .NET solution on an ubuntu VM.

When I run the command dotnet restore I always get the error:

error NU1301: Unable to load the service index for source https://mycorporatenexus.org/repository/nuget.org-proxy/index.json

I can access the index via browser, I can download it with WGET. The corporate feed is public.

I run the command dotnet restore --verbose d and the nuget.config files are the right ones, the sources are the desired ones.

so far I tried to:

  • setting the http and https proxy via nuget.config & via environment variables
  • setting no_proxy via nuget.config & via environment variables
  • verifying that root ca certificates are installed in ubuntu
  • run the command with the highest level of detail

at the moment I have no idea on where the problem could lie. Can anyone suggest me a way to debug it further?

.NET SDK:
 Version:           8.0.302
 Commit:            ef14e02af8
 Workload version:  8.0.300-manifests.f6879a9a
 MSBuild version:   17.10.4+10fbfbf2e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.302/
3
  • 1
    if you do dotnet add package anything it should show the inner exception, explaining why the service index couldn't be loaded.
    – zivkan
    Commented Jul 8 at 17:26
  • I got error: The SSL connection could not be established, see inner exception. error: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot but the certificate of the root certificate authority is installed on the machine. do i need to do additional steps to make .net pick it up in ubuntu @zivkan ?
    – Otrebor
    Commented Jul 9 at 9:29
  • .NET uses openssl on Linux, so all I can suggest is that perhaps the root CA wasn't trusted correctly. Check your distro's docs on how to do it. If you can get curl or wget to download NuGet's service index without disabling TLS validation, but .NET/NuGet still fails, all I can suggest is report a bug at github.com/dotnet/runtime
    – zivkan
    Commented Jul 9 at 21:22

0

Browse other questions tagged or ask your own question.