question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet restore with .net 6 SDK Build 101 Hangs for 5 minutes then exits with code 1.

See original GitHub issue

Describe the bug

Running a dotnet restore on a project which contains the following ProjectReference structure.

Project A -> Project B & Project C Project B -> Project C

the dotnet restore hangs at Determining projects to restore... The three files receive the following error message when verbosity is turned up to diag.

1:3>Done Building Project “<csproj path>” (_GenerateRestoreProjectPathWalk target(s)) – FAILED.

strace shows the following:

[pid 2232135] bind(8, {sa_family=AF_UNIX, sun_path="/tmp/dotnet-diagnostic-2232135-889863297-socket"}, 110) = 0
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2231826"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2718148"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)
[pid 2232147] connect(123, {sa_family=AF_UNIX, sun_path="/tmp/MSBuild2232173"}, 22) = -1 ENOENT (No such file or directory)

This error just continues for about 5 minutes in the log before the process gives up.

What’s interesting is all three projects perform a dotnet restore if I remove their project dependencies. So it seems its something internal within the internal restore process when a project has ProjectReferences.

To Reproduce

I’m trying to reproduce this its happening on both of our Ubuntu 20.04 fully patched build servers.

Exceptions (if any)

No exceptions logged.

Further technical details

.NET SDK (reflecting any global.json): Version: 6.0.101 Commit: ef49f6213a

Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/6.0.101/

Host (useful for support): Version: 6.0.1 Commit: 3a25a7f1cc

.NET SDKs installed: 5.0.301 [/usr/share/dotnet/sdk] 5.0.404 [/usr/share/dotnet/sdk] 6.0.101 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.22 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.30 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.22 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
CarlSargunarcommented, May 25, 2022

Did anyone raise this on the Nuget repository? I’m still seeing this

0reactions
msftbot[bot]commented, Apr 21, 2022

Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the NuGet repository instead. Don’t forget to check out NuGet’s contributing guide before submitting an issue!

If you believe this issue was closed out of error, please comment to let us know.

Happy Coding!

Read more comments on GitHub >

github_iconTop Results From Across the Web

`dotnet build` and `dotnet restore` hangs forever without ...
My Internet connection has no issues. Since I can no longer use .net in my Windows, I installed .net SDK inside WSL and...
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko's answer). Take note of the greatest version number.
Read more >
Solving flaky dotnet restore issue only on Docker
When I build a Dockerfile, at the part of the dotnet restore I encountered this issue. However, On my colleague's PC, it works...
Read more >
dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found