-
Notifications
You must be signed in to change notification settings - Fork 258
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
NuGet failed to restore packages inside docker #10275
Comments
Facing the same issue with .NET 5 |
Adding --disable-parallel fixed my issue but it takes a long time to restore. |
Any updates on this ? |
I'm also facing the same issue. My project is built on top of .NET Core 3.1 LTS. |
Any updates? |
+1 |
this happens intermittently within docker for me |
Same here, with latest aspnet:3.1.10-bionic |
+1 |
Looks like throttling the number of requests with nuget.config helps and works much faster than 'disable-parallel'
|
This issue impacts my daily work because I have to wait about ~4 min for each package restore on the container, could anyone in the NuGet team have (just) a look at this issue help us to fix it, it becomes frustrating. I also tried to mount the NuGet cache folder from host to container but it still takes a lot of time to be restored. volumes:
- ~/.nuget/packages:/root/.nuget/packages:rw |
cc @zivkan |
@xsoheilalizadeh Can you give us some details about your setup? Is the host and containers Windows or Linux or Mac? |
I used both Linux and Windows on the same machine as a Host.
The host is able to restore perfectly without any issues, either it's from cache or NuGet server.
No resource limitation has been set, everything is the default. |
I tried your repro (single project, small number of packages), as well as the NuGet.Client repo (large number of projects and packages). I tried on my computer with both Windows and Linux contains, and I tried on 2-core Azure VMs using Ubuntu 20.10 as the host, and once I noticed that you were using Debian 9, I also tried Debian 9 as a host. In all of these attempts, I was not able to reproduce the issue. Restore worked inside the container in all my tests. I never used Docker before this week, so if anyone has any suggestions on how I might repro the issue, please let me know. |
Having the same issue on Mac with .NET 5 Docker 20.10. Any update on this? --disable-parallel works but takes 10x longer |
Just to complete the working answer by Vfialkin <?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key='maxHttpRequestsPerSource' value='10' />
</config>
</configuration> So maybe the issue needs to be fixed by microsoft by changing the default
|
Any updates on this one, it is persisting on .net 5 as well |
@yusufgungor can you post precise steps I can follow to reproduce the issue? I have tried to get it to happen so I can figure out what's going on but can't seem to. |
Hello, Anyone have luck with this so far ? Here is how I am able to reproduce this: #5 ran docker images in -it mode & executed ping command and fails to resolve dns |
@janivimal Are you able to reproduce this over and over on the same machine? I just did it with this sample on my local Docker Desktop and its working. What does
|
@jeffkl , Next, I will try building these samples and share result with you |
@janivimal I'm thinking you're facing a different issue where your docker VM is unable to resolve DNS entries. Without that working, you won't be able to restore packages. Do you know why DNS isn't working? |
@jeffkl correct , something is blocking my containers to restore packages. Again this issue only occurs when I am building windows containers. It runs perfectly fine when I switch docker to Linux Container mode and build appropriate image. Trying to play around with installing certs in container before restore command gets executed. |
Windows containers on Docker Desktop use Hyper-V as far as I know. Linux containers on Docker Desktop can use WSL or Hyper-V. I can see how on a Windows machine, you could get different network results for the different containers. Can you see if your Hyper-V configuration is preventing DNS from working? Perhaps the VM is only connected to the private VLAN and not the public internet? |
+1 |
@jeffkl could you please provide more details on how to achieve - "Can you see if your Hyper-V configuration is preventing DNS from working?" ,
Can someone please try to reproduce this ? Below are the steps, that I am following
Thank you ! |
@jeffkl - Thank you very much for helping me resolve my issue. Finally this was resolved. Issue was my ANTIVIRUS , which was messing up internal connectivity between my container and host (not sure exactly why). As soon I un-installed my antivirus and tried rebuilding my image it worked !!!! Last few days of frustration finally ended. Thanks a million ! |
I think you should delete the .zip file before docker-compose up -d --build |
I am also affected and would like to fix this. |
Almost 2 years later and still not resolved. .NET6 |
Do you have repro steps? Is it consistent? Everything we need to memory dump or repro steps, so far it didn't happen when we try to diagnose it. |
Any update? please! |
imed out because no data was received for 60000ms. |
…g docker build. Solution found here: NuGet/Home#10275
Our organisation also faced this issue on a windows host with windows container. After experimenting with many dotnet restore options we discovered that a curl on the actual package url showed a data rate of about 2-5 kb/s 🐌. Some curls later we knew the network issue applied to URLs regardless the target network (intranet/www). TLDR:
Give 👍 or 👎 on this post if this workaround resolved your issue. |
Anyone who know How to fix this on Linux Machine. I am facing the same problem |
Don't understand what this does, but I can confirm that it now makes my docker-hosted |
where do you put this, before or after the build command? @skotl |
@H3ndry It's not in the build pipeline, but addressed an issue on my PC where docker was pulling files incredibly slowly.
That's it! The results were instant for me when I reran the docker build on my PC but you may have to reboot your PC ¯_(ツ)_/¯ |
Its a one-time-thing. Do it after/before docker installation |
Forwarded form dotnet/dotnet-docker#1670
I had a problem when building a sample dotnet app
When I run
dotnet restore
in docker imageI get following errors:
Dockerfile
File *.csproj
Output of docker version
Output of docker info
\cc @JonDouglas
The text was updated successfully, but these errors were encountered: