sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Unable to restore packages on Ubuntu 18.04 (3.0 preview7)

Open enricoreich opened this issue 7 years ago • 18 comments

Hello,

I'm trying to get the latest 3.0 preview7 working on my Ubuntu 18.04 remote server using the latest tar.gz from core-sdk for Linux x64. The dotnet command is working but if I try to install new templates eg. for blazor, the restore process fires up but then -> nothing. The process stays in my process list:

Screenshot_1

After running the command, that's all that happens: boring

I also tried dotnet restore with a newly created AspNetCoreApp project but the result is the same.

Any ideas? Do I miss something here? Thanks in advance!

Steps to reproduce

  1. Download latest preview7 tar.gz from core-sdk for Linux x64
  2. unpack with tar zxvf dotnet-sdk-latest-linux-x64.tar.gz -C ./dotnet3 (create destination folder befor extracting)
  3. setup environment variables export DOTNET_ROOT=$HOME/dotnet3 & export PATH=$PATH:$HOME/dotnet3, I'm using zsh so they goes into my .zshrc (or .zprofile)
  4. reopen shell
  5. run dotnet new -i "Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview7.*"
  6. restore process hangs with no output or any message

Also with preview6 bits as root or user, does not make any difference. It works on Windows 10 and WSL (Ubuntu 18.04) perfectly!

Expected behavior

The command should restore necessary files from Nuget and install new templates so they can be used with dotnet new

Actual behavior

Restore process hangs with no output or any message.

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview7-012398
 Commit:    028dd7635a

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.04
 OS Platform: Linux
 RID:         ubuntu.18.04-x64
 Base Path:   /home/---/dotnet3/sdk/3.0.100-preview7-012398/

Host (useful for support):
  Version: 3.0.0-preview7-27813-06
  Commit:  5cfc2cab25

.NET Core SDKs installed:
  3.0.100-preview7-012398 [/home/---/dotnet3/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0-preview7.19311.5 [/home/---/dotnet3/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0-preview7-27813-06 [/home/---/dotnet3/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

enricoreich avatar Jun 14 '19 15:06 enricoreich

Does restore of regular packages work? Is this an issue only when installing templates?

livarcocc avatar Jun 14 '19 16:06 livarcocc

This happens even if I want to create a new project with dotnet new webapp -n AspWebApp or run dotnet restore on an existing project (created on Windows and copied over).

The process doesn't even establish a network connection to nuget.org. (observed with iftop and nethogs)

A NuGet.Config file is present at my home root and at project root

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
        <add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
        <add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
        <add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
        <add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
        <add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
        <add key="gRPC repository" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />

        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    </packageSources>
</configuration>

running dotnet build: Screenshot_1 and then nothing happens.

enricoreich avatar Jun 14 '19 16:06 enricoreich

Do you get any additional output with dotnet build -v:diag?

peterhuene avatar Jun 14 '19 17:06 peterhuene

@peterhuene Yes, but the process does not exit normally..it hangs and some threads are using 1-3% cpu.

diag.txt

enricoreich avatar Jun 14 '19 17:06 enricoreich

@nkolev92 @rrelyea

livarcocc avatar Jun 14 '19 17:06 livarcocc

I have installed dotnet core sdk 2.2.300 as described in the installation guide and everything works like intended.

enricoreich avatar Jun 14 '19 19:06 enricoreich

I installed the sdk with the help of the dotnet-install.sh and and following command: ./dotnet-install.sh -Channel 3.0 --verbose. It downloads and installs 3.0.100-preview4-010988 and everything seems to work correctly. I can install templates, build projects and restore packages.

Using Channel master ./dotnet-install.sh -Channel master --verbose gets me 3.0.100-preview7-012424 and all the issues that I have described appear again.

Also tried with official 3.0.100-preview5-011568 ./dotnet-install.sh -c 3.0 -v 3.0.100-preview5-011568 --verbose but same result as with preview7.

So, 3.0.100-preview4-010988 is the last working version for Ubuntu 18.04 or did someone get a more recent version to work?

enricoreich avatar Jun 17 '19 11:06 enricoreich

From the logs it seems stuck in the msbuild part of restore, not the restore task itself. I have no context on similar issues. Not obvious which change in our targets could cause this.

nkolev92 avatar Jun 17 '19 18:06 nkolev92

Thanks @nkolev92 for looking into it.

I duno if this helps but I have created diag logs for preview4 (which is working) and preview7 (latest master, not working!) by creating a simple dotnet new console ConsoleApp with the corresponding sdk and run dotnet build -v:diag on each. All SDKs were downloaded and installed via your dotnet-install.sh script.

3.0.100-preview4-010988: diagPrev4.0.txt

3.0.100-preview7-012430: diagPrev7.0.txt

If you want to try it by yourself, then don't use Windows 10 WSL Ubuntu 18.04 because it works with it. I'm using an actual Ubuntu 18.04 LTS Server and remoting via SSH.

enricoreich avatar Jun 17 '19 20:06 enricoreich

Same issue on Debian 9.9 (stretch).

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview7-012743
 Commit:    143bd43fcf

Runtime Environment:
 OS Name:     debian
 OS Version:  9
 OS Platform: Linux
 RID:         debian.9-x64
 Base Path:   /root/.dotnet/sdk/3.0.100-preview7-012743/

Host (useful for support):
  Version: 3.0.0-preview7-27826-20
  Commit:  ee0c7ead1a

.NET Core SDKs installed:
  3.0.100-preview7-012743 [/root/.dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0-preview7.19351.3 [/root/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0-preview7-27826-20 [/root/.dotnet/shared/Microsoft.NETCore.App]

Kernel: Linux version 4.9.0 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) dotnet/sdk#4283 SMP Wed May 15 09:45:34 MSK 2019

enricoreich avatar Jul 02 '19 04:07 enricoreich

Funny thing is we are now hitting the same issue on one of our build machines:

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=2855648

2.2.302-preview-010246

It hangs in a very similar way.

//cc @donnie-msft has more info.

nkolev92 avatar Jul 17 '19 00:07 nkolev92

it only happens on 1 of our 4 linux machines. We could log into the machine and running any target on the offending projects hangs.

In our case running /t:clean hung the execution as well.

Any ideas how to debug this? @peterhuene @livarcocc We have a machine that gets a 100% repro rate somehow.

nkolev92 avatar Jul 17 '19 00:07 nkolev92

One thing to quickly check if it's node reuse that is causing the hang by setting MSBUILDDISABLENODEREUSE=1 in the environment prior to spawning dotnet.

Pinging @rainersigwald to see if he can help with any tips for aiding debugging of this issue.

If possible, I would use lldb + sos to dump the CLR thread stacks from each MSBuild.dll dotnet process.

peterhuene avatar Jul 17 '19 01:07 peterhuene

I'd also be curious whether it works or produces a better error with -m:1.

rainersigwald avatar Jul 22 '19 17:07 rainersigwald

Hello,

I used a simple newly created C# console application created on my Windows machine and copied over (SSH) to my Debian 9 server because it is not possible to create a project on my server. It hangs at the restore task.

One thing to quickly check if it's node reuse that is causing the hang by setting MSBUILDDISABLENODEREUSE=1 in the environment prior to spawning dotnet.

Unfortunately the same problem: dotnet build -v:diag > diag-3.0.100-preview8-013380.txt: diag-3.0.100-preview8-013380.txt

I'd also be curious whether it works or produces a better error with -m:1.

dotnet build -m:1 -v:diag > diag-3.0.100-preview8-013380_m1.txt: diag-3.0.100-preview8-013380_m1.txt

cmd: dotnet build -m:1

Microsoft (R) Build Engine version 16.3.0-preview-19369-03+db6ae5a0d for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

That's the only output.

Maybe it helps somehow.

dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview8-013380
 Commit:    6de3be0150

Runtime Environment:
 OS Name:     debian
 OS Version:  9
 OS Platform: Linux
 RID:         debian.9-x64
 Base Path:   /root/.dotnet/sdk/3.0.100-preview8-013380/

Host (useful for support):
  Version: 3.0.0-preview8-27919-09
  Commit:  3fcf1dac55

.NET Core SDKs installed:
  3.0.100-preview8-013380 [/root/.dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0-preview8.19372.1 [/root/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0-preview8-27919-09 [/root/.dotnet/shared/Microsoft.NETCore.App]

Thank you for taking care of this!

enricoreich avatar Jul 22 '19 18:07 enricoreich

Our Build issues were resolved by setting MSBUILDDISABLENODEREUSE=1 in this PR.

The effect of -m:1 seemed to allow the MSBuild execution to continue, but then the next MSBuild without -m:1 would hang. I did not use this in my PR.

@rainersigwald suggested I run this to provide diagnostics to MSBuild team: MSBUILDDEBUGCOMM=1 MSBUILDDEBUGPATH=/path/to/some/directory​​​​​​​

I ran this directly on the Linux machine, and it still hanged on the same MSBuild invocation.

It repeats a couple dozen times:Failed to connect to pipe MSBuild57710. The operation has timed out. It appears to stop writing to the file, as hours later, the log had still not been modified. linuxOutput.txt

Thanks for the suggestion, and I've referenced an issue to revert this fix once this Issue is closed.

donnie-msft avatar Jul 26 '19 00:07 donnie-msft

FYI I have this issue if I'm running WSL2 and connected to VPN on my host. It's the same issue as VS Code being unable to update. Just drop your VPN connection and magic happens.

tomhundley avatar Sep 02 '21 04:09 tomhundley

Due to lack of recent activity, this issue has been labeled as 'Stale'. It will be closed if no further activity occurs within 14 more days. Any new comment will remove the label.

github-actions[bot] avatar Apr 23 '26 05:04 github-actions[bot]