NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

dotnet restore hangs on Linux VM #9722

Open ooooolivia opened 4 years ago

ooooolivia commented 4 years ago

I'm trying to do dotnet restore in my Ubuntu VM but it seems hanging forever ... Here's diagnostic log.

Build started 6/26/2020 3:10:27 PM.
Environment at start of build:
SHLVL = 1
TERM = xterm-256color
DOTNET_CLI_TELEMETRY_SESSIONID = e1afd44e-c91f-4b01-9971-7ec4804502ad
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
DOTNET_HOST_PATH = /home/bache/avocado/dotnet/dotnet
LOGNAME = root
USER = root
SUDO_USER = bache
HOME = /root
MSBuildExtensionsPath = /home/bache/avocado/dotnet/sdk/3.1.301/
_ = //home/bache/avocado/dotnet/dotnet
SUDO_UID = 1000
USERNAME = root
MSBuildLoadMicrosoftTargetsReadOnly = true
SUDO_GID = 1000
SUDO_COMMAND = /bin/bash
MSBuildSDKsPath = /home/bache/avocado/dotnet/sdk/3.1.301/Sdks
PWD = //home/bache/avocado
OLDPWD = //home/bache/avocado
LESSOPEN = | /usr/bin/lesspipe %s
XDG_DATA_DIRS = /usr/local/share:/usr/share:/var/lib/snapd/desktop
MAIL = /var/mail/root
LANG = en_US.UTF-8
SHELL = /bin/bash
LESSCLOSE = /usr/bin/lesspipe %s %s

Process = "/home/bache/avocado/dotnet/dotnet"
MSBuild executable path = "/home/bache/avocado/dotnet/sdk/3.1.301/MSBuild.dll"
Command line arguments = "/home/bache/avocado/dotnet/sdk/3.1.301/MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore -verbosity:diag -property:RestoreSources=//home/bache/avocado/performance-packages //home/bache/avocado/performance/src/tools/ScenarioMeasurement/Startup/Startup.csproj -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/home/bache/avocado/dotnet/sdk/3.1.301/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/home/bache/avocado/dotnet/sdk/3.1.301/dotnet.dll"
Current directory = "/home/bache/avocado"
MSBuild version = "16.6.0+5ff7b0c9e"
Resolving SDK 'Microsoft.NET.Sdk'...
Resolving SDK 'Microsoft.DotNet.Arcade.Sdk'...
Running non-parallel restore.
Reading project file /tmp/NuGetScratch/d86324f49d6c49dc8de01dc058047e90/d20397506cd549dd948dada87d87d733.proj.
Restoring packages for /tmp/NuGetScratch/d86324f49d6c49dc8de01dc058047e90/d20397506cd549dd948dada87d87d733.proj...
Restoring packages for .NETStandard,Version=v0.0...

NuGet.Config for the repo:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <solution>
    <add key="disableSourceControlIntegration" value="true" />
  </solution>
  <packageSources>
    <clear />
    <add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
    <add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" />
    <add key="dotnet3.1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" />
    <add key="dotnet3.1-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json" />
    <add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
   </packageSources>
</configuration>

It seems unable to download packages from the feeds. The network connection in my VM works properly.

donnie-msft commented 4 years ago

//cc @nkolev92 @zivkan

nkolev92 commented 4 years ago

@ooooolivia

The first thing that stands out is that the stack trace is coming from the SDK resolver. How long did this run for?

Have you attempted to run restore for different projects/solutions on your VM?

ooooolivia commented 4 years ago

@nkolev92 Yes the restore works for empty dotnet console template. For [my project](), it just hangs at the end of the log (waited for at least an hour)

Restoring packages for .NETStandard,Version=v0.0...
GET https://api.nuget.org/v3-flatcontainer/microsoft.dotnet.arcade.sdk/index.json
NotFound https://api.nuget.org/v3-flatcontainer/microsoft.dotnet.arcade.sdk/index.json 68ms

and it has to be manually terminated. Checked a couple of nuget caches and the packages were not found there, so it might be a NuGet issue instead of SDK issue?

nkolev92 commented 4 years ago

@ooooolivia can you generate a dump please? See: https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dump

ooooolivia commented 4 years ago

@nkolev92 Thanks for your reply! The dump has been sent to you by email.

nkolev92 commented 4 years ago

@heng-liu, there's an internal thread with the dump, ping me if you can't find it.

lucasoares commented 1 year ago

Same here.. Ubuntu 22.04 and my dotnet restore hangs forever..

The problem is not with the repository because I can restore it inside a container like this:

docker run -it -v ~/.nuget:/root/.nuget -v /repo:/repo mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim bash

# dotnet restore <path-to-sln>

The diganostic logs from -v diag it stuck here and nothinig else is printed

                     Task Parameter:RestoreRecursive=True (TaskId:742)
                     Task Parameter:HideWarningsAndErrors=False (TaskId:742)

It also makes one CPU usage to be in 100% indefinitely.

image

I also tried to let this run for 7 hours, no success and the CPU continue with high usage.

Tried reinstalling everything, nothing works.. Don't know what else I can do to fix this.

EDIT: Just saw this issue is from 2020 :( Probably a entire different issue and I may consider opening a new issue.