installer icon indicating copy to clipboard operation
installer copied to clipboard

`dotnet restore` never completes

Open CollinAlpert opened this issue 9 months ago • 6 comments

This one is a bit difficult to reproduce and to explain. Once in a while, when I execute dotnet restore on the command line, I get the "Determining projects to restore..." output, followed by "error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json" after a few minutes, but after that nothing happens and the command never completes. Restarting the computer always solves the issue and dotnet restore completes without any problems, however a restart is the only solution I have found so far.

As far as I can tell this happens at random times and I haven't been able to correlate to any certain event reliably. Here are a few of my observations, however please take my confirmation bias into account:

  • Oftentimes when the issue occurred, I had been working on dotnet/roslyn-analyzers the day before.
  • I first encountered the issue sometime after installing the preview version of .NET 7.
  • The issue always arises after being away from my computer for a few hours. It never worked and then stopped working while I was sitting at the computer, so I am thinking maybe something "Sleep"-related (in terms of the computer).
  • Maybe this is Apple Silicon related? I have a Windows machine and have never had this issue there, even when having Preview versions installed and working on dotnet/roslyn-analyzers.
  • There is no fixed time after the computer restart when the issue resurfaces. Sometimes everything will work for a few weeks, sometimes only for a couple of days.

I am just dumping this here in the hopes that someone a lot smarter than me will be able to make sense of it. Please let me know if you need more information or if you want me to try anything, I am desperate to get this resolved since it is very annoying.

Screenshot 2023-10-09 at 18 36 48

dotnet --info output:

.NET SDK:
 Version:   8.0.100-rc.1.23463.5
 Commit:    e7f4de8816

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  13.6
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /Users/collin/.dotnet/sdk/8.0.100-rc.1.23463.5/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.0-rc.1.23419.4
  Architecture: arm64
  Commit:       92959931a3
  RID:          osx-arm64

.NET SDKs installed:
  8.0.100-rc.1.23463.5 [/Users/collin/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.13 [/Users/collin/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.2 [/Users/collin/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-preview.6.23329.11 [/Users/collin/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-preview.7.23375.9 [/Users/collin/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/Users/collin/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.11 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.13 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.2 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-preview.6.23329.7 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-preview.7.23375.6 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/Users/collin/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/Users/collin/.dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

I am running macOS Ventura 13.6 with an M1 Pro chip.

CollinAlpert avatar Oct 09 '23 16:10 CollinAlpert

@nkolev92 @zivkan is the timeout on the nuget side or on the SDK side?

marcpopMSFT avatar Oct 10 '23 20:10 marcpopMSFT

The timeout is likely NuGet.

@CollinAlpert We haven't seen too many of these issues.

If you enable normal verbosity, you'd get more details about potential http calls being made. Best way to help investigate a potential hang is to grab a procdump.

nkolev92 avatar Oct 10 '23 21:10 nkolev92

It happened again and I managed to create a Sample and a Spindump (using the Mac's Activity Monitor) of the dotnet restore process.

dump.txt sample.txt

CollinAlpert avatar Oct 29 '23 16:10 CollinAlpert

Unfortunately the problem still persists even after installing .NET 8. So it seems it has nothing to do with the preview versions.

CollinAlpert avatar Nov 23 '23 09:11 CollinAlpert

same issue here

naeimsf avatar Mar 18 '24 07:03 naeimsf

For me the issue was I needed to put my project name before the feedname.. like: vstsFeed: <devops project name>/<artifact feed name>

another big indicator is if you look at the url that the app is trying to connect to, it might not be right. Try navigating to it and then comparing it to the one that you get if you click "connect to feed" in azure artifacts.

zachpainter77 avatar Mar 20 '24 06:03 zachpainter77