Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet restore returns invalid error code #4485

Open
delanym opened this issue Mar 31, 2020 · 8 comments
Open

dotnet restore returns invalid error code #4485

delanym opened this issue Mar 31, 2020 · 8 comments

Comments

@delanym
Copy link

delanym commented Mar 31, 2020

I'm doing a container build with mcr.microsoft.com/dotnet/core/sdk:3.1.201 and package restore regularly times out.

dotnet restore should fail if any packages fail to download and exit with an error code so I know to stop trying to build. If --ignore-failed-sources is set only then exit with 0.

@carlossanlop
Copy link
Member

@MichaelSimons any chance you could take a look?

@MichaelSimons
Copy link
Member

@delanym - Can you share your repo steps? Is this utilizing a Dockerfile?

@carlossanlop - this may be a better question for the NuGet folks.

@delanym
Copy link
Author

delanym commented Apr 8, 2020

@MichaelSimons

/tmp # sudo docker run -it mcr.microsoft.com/dotnet/core/sdk:3.1.201
root@fda3f4b9b68a:/# dotnet restore
Failed to download package 'Microsoft.AspNetCore.Antiforgery.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.antiforgery/2.2.0/microsoft.aspnetcore.antiforgery.2.2.0.nupkg'.
The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.antiforgery/2.2.0/microsoft.aspnetcore.antiforgery.2.2.0.nupkg' timed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Restore completed in 2.78 min for /MvcWebFront.csproj.
Restore completed in 2.97 min for /MvcWebFront.csproj.
root@fda3f4b9b68a:/# echo $?
0
root@fda3f4b9b68a:/#

Before running dotnet restore, copy the attached csproj file:
dkr cp ./webapps_webinterfacewebapp/src/main/cs/MvcWebFront/MvcWebFront.csproj fda3f4b9b68a:/

MvcWebFront.csproj.txt

@delanym
Copy link
Author

delanym commented Apr 30, 2020

Any luck here? I can't create a reliable build system because dotnet restore pretends to succeed.

@carlossanlop
Copy link
Member

Per @MichaelSimons suggestion, pinging @rrelyea from the nuget team to help.

@rrelyea
Copy link

rrelyea commented May 1, 2020

Perhaps related to: dotnet/msbuild#1603

If that doesn’t help, please engage with team in issues at nuget/home

@delanym
Copy link
Author

delanym commented May 2, 2020

I will do that. However, lets not confuse the issue here. This dotnet application returns 0 even though packages failed to download. If it was getting packages from nuget directly, or a faulty mirror, or some custom proxy, it shouldn't matter. This is a basic requirement and its not working!

The option to --ignore-failed-sources is not actually an option, its the default behaviour. It should be changed to an option, please.

@delanym
Copy link
Author

delanym commented Jul 13, 2020

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@carlossanlop @delanym @MichaelSimons @rrelyea and others