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

NuGet failed to restore packages inside docker #10275

Open
xsoheilalizadeh opened this issue Nov 15, 2020 · 57 comments
Open

NuGet failed to restore packages inside docker #10275

xsoheilalizadeh opened this issue Nov 15, 2020 · 57 comments
Labels
Area:HttpCommunication Functionality:Restore Platform:Docker All NuGet on docker scenarios Priority:2 Issues for the current backlog. Resolution:NotRepro We are not able to reproduce this problem. Better steps would be helpful. Triage:NeedsMoreInfo Type:Bug

Comments

@xsoheilalizadeh
Copy link

xsoheilalizadeh commented Nov 15, 2020

Forwarded form dotnet/dotnet-docker#1670

I had a problem when building a sample dotnet app
When I run dotnet restore in docker image
I get following errors:

Failed to download package 'Microsoft.AspNetCore.Authentication.Core.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.authentication.core/2.2.0/microsoft.aspnetcore.authentication.core.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.authentication.core/2.2.0/microsoft.aspnetcore.authentication.core.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.Extensions.Caching.Abstractions.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.caching.abstractions/2.2.0/microsoft.extensions.caching.abstractions.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.caching.abstractions/2.2.0/microsoft.extensions.caching.abstractions.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.AspNetCore.Diagnostics.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.diagnostics/2.2.0/microsoft.aspnetcore.diagnostics.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.diagnostics/2.2.0/microsoft.aspnetcore.diagnostics.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.Extensions.Logging.Abstractions.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/2.2.0/microsoft.extensions.logging.abstractions.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/2.2.0/microsoft.extensions.logging.abstractions.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'System.Net.WebSockets.WebSocketProtocol.4.5.3' from 'https://api.nuget.org/v3-flatcontainer/system.net.websockets.websocketprotocol/4.5.3/system.net.websockets.websocketprotocol.4.5.3.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/system.net.websockets.websocketprotocol/4.5.3/system.net.websockets.websocketprotocol.4.5.3.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.AspNetCore.Localization.Routing.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.localization.routing/2.2.0/microsoft.aspnetcore.localization.routing.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.localization.routing/2.2.0/microsoft.aspnetcore.localization.routing.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.EntityFrameworkCore.Tools.2.2.4' from 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.tools/2.2.4/microsoft.entityframeworkcore.tools.2.2.4.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.tools/2.2.4/microsoft.entityframeworkcore.tools.2.2.4.nupkg' timed out because no data was received for 60000ms.
...

Dockerfile

# https://hub.docker.com/_/microsoft-dotnet-core
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /source

# copy csproj and restore as distinct layers
COPY *.csproj .
RUN dotnet restore

# copy and publish app and libraries
COPY . .
RUN dotnet publish -c release -o /app --no-restore

# final stage/image
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "dotnetapp.dll"]

File *.csproj

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Ben.BlockingDetector" Version="0.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.7" />
    <PackageReference Include="MongoDB.Driver" Version="2.9.2" />
    <PackageReference Include="prometheus-net" Version="3.1.4" />
    <PackageReference Include="prometheus-net.AspNetCore" Version="3.1.4" />
    <PackageReference Include="Quartz" Version="3.0.7" />
    <PackageReference Include="ServiceStack.Core" Version="5.7.1" />
    <PackageReference Include="ServiceStack.OrmLite.MySqlConnector.Core" Version="5.7.1" />
    <PackageReference Include="ServiceStack.OrmLite.PostgreSQL.Core" Version="5.7.1" />
    <PackageReference Include="ServiceStack.Redis.Core" Version="5.7.1" />
    <PackageReference Include="System.IO.Pipelines" Version="4.6.0" />
  </ItemGroup>
</Project>

Output of docker version

Client: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfca03
 Built:             Thu Aug 29 05:29:49 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.8
  Git commit:       6a30dfca03
  Built:            Thu Aug 29 05:28:23 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info

Client:
 Debug Mode: false

Server:
 Containers: 46
  Running: 6
  Paused: 0
  Stopped: 40
 Images: 1338
 Server Version: 19.03.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.0-4-amd64
 Operating System: Debian GNU/Linux 9 (stretch)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.829GiB
 Name: debian-167
 ID: K5NH:LCRJ:AFV7:D3TN:N3IN:KE6B:RICT:7SPD:A3HP:IPGW:OOIN:6XFQ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

\cc @JonDouglas

@abuzaforfagun
Copy link

Facing the same issue with .NET 5

@abuzaforfagun
Copy link

Adding --disable-parallel fixed my issue but it takes a long time to restore.

@marcasmar94
Copy link

Any updates on this ?

@jackabouaad
Copy link

I'm also facing the same issue. My project is built on top of .NET Core 3.1 LTS.

@kelvin-p
Copy link

Any updates?

@kmute90
Copy link

kmute90 commented Nov 23, 2020

+1

@murugaratham
Copy link

this happens intermittently within docker for me

@Vfialkin
Copy link

Same here, with latest aspnet:3.1.10-bionic
--disable-parallel helps but can take minutes to restore
Using internal repo instead of api.nuget.org gives the same results

@efrost123
Copy link

+1

@xsoheilalizadeh xsoheilalizadeh changed the title Failed restoring packages inside docker NuGet failed to restore packages inside docker Nov 25, 2020
@Vfialkin
Copy link

Looks like throttling the number of requests with nuget.config helps and works much faster than 'disable-parallel'
(dont forget to copy it into container)

<configuration>
  <config>
    <add key='maxHttpRequestsPerSource' value='20' />
  </config>
   ...

@xsoheilalizadeh
Copy link
Author

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

@JonDouglas, @nkolev92, @karann-msft

@nkolev92
Copy link
Member

nkolev92 commented Dec 1, 2020

cc @zivkan

@zivkan
Copy link
Member

zivkan commented Dec 5, 2020

@xsoheilalizadeh Can you give us some details about your setup?

Is the host and containers Windows or Linux or Mac?
When you restore on the host does it have the same problem, or only in contains?
Are you limiting the container resources (ram and/or cpu), or does it have the same resources as the host?

@xsoheilalizadeh
Copy link
Author

xsoheilalizadeh commented Dec 5, 2020

Is the host and containers Windows or Linux or Mac?

I used both Linux and Windows on the same machine as a Host.

When you restore on the host does it have the same problem, or only in contains?

The host is able to restore perfectly without any issues, either it's from cache or NuGet server.

Are you limiting the container resources (ram and/or cpu), or does it have the same resources as the host?

No resource limitation has been set, everything is the default.

@zivkan
Copy link
Member

zivkan commented Dec 10, 2020

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.

@hero3616
Copy link

Having the same issue on Mac with .NET 5 Docker 20.10. Any update on this? --disable-parallel works but takes 10x longer

@belucha
Copy link

belucha commented Jan 15, 2021

Just to complete the working answer by Vfialkin
putting a file name nuget.config (watch the casing) besids the solution works.

<?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 nuget.config inside of mcr.microsoft.com/dotnet/sdk:5.0. So the issue is this one
dotnet/dotnet-docker#1670

Looks like throttling the number of requests with nuget.config helps and works much faster than 'disable-parallel'
(dont forget to copy it into container)

<configuration>
  <config>
    <add key='maxHttpRequestsPerSource' value='20' />
  </config>
   ...

@aortiz-msft aortiz-msft added this to the Sprint 2021-03 milestone Feb 26, 2021
@erdembayar erdembayar modified the milestone: Sprint 2021-03 Mar 1, 2021
@yusufgungor
Copy link

Any updates on this one, it is persisting on .net 5 as well

@jeffkl
Copy link
Contributor

jeffkl commented Aug 29, 2022

@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.

@janivimal
Copy link

janivimal commented Oct 3, 2022

Hello,

Anyone have luck with this so far ?

Here is how I am able to reproduce this:
#1 install docker for windows (I tried few times un-installing and re-installing)
#2 created simple api in .net 6.0
#3 trimmed my dockerfile as below to reproduce these steps
image
#4 ran docker build command docker build -f Dockerfile -t greenapi-435pm .
failed at restore
image

#5 ran docker images in -it mode & executed ping command

image

and fails to resolve dns

running ping command against ip address works OK
image

@jeffkl
Copy link
Contributor

jeffkl commented Oct 3, 2022

@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 tracert return? Its strange that you can't resolve the api.nuget.org host, do you have any custom DNS configuration?

tracert api.nuget.org


Tracing route to cs2.wpc.gammacdn.net [152.199.4.184]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2    16 ms    13 ms    14 ms  96.120.101.197
  3    12 ms    11 ms    12 ms  96.110.249.37
  4    13 ms    12 ms    12 ms  po-2-rur102.bellevue.wa.seattle.comcast.net [69.139.160.26]
  5    17 ms    11 ms    11 ms  po-100-xar02.bellevue.wa.seattle.comcast.net [69.139.164.77]
  6    14 ms    14 ms    14 ms  24.124.128.89
  7    13 ms    13 ms    14 ms  be-36131-cs03.seattle.wa.ibone.comcast.net [68.86.93.9]
  8    14 ms    15 ms    14 ms  be-2301-pe01.seattle.wa.ibone.comcast.net [96.110.39.226]
  9    16 ms    14 ms    15 ms  96-87-9-30-static.hfc.comcastbusiness.net [96.87.9.30]
 10    20 ms    16 ms    16 ms  ae-65.core1.sec.edgecastcdn.net [152.195.92.129]
 11    14 ms    12 ms    15 ms  152.199.4.184

Trace complete.

@janivimal
Copy link

janivimal commented Oct 4, 2022

@jeffkl ,
Are you able to reproduce this over and over on the same machine? - Yes, I am able to reproduce this over and over on the same machine
Also, tried running tracert and says "unable to resolve target system name api.nuget.org."
image

Next, I will try building these samples and share result with you

@janivimal
Copy link

Tried building image from these samples (dotnetapp) and same error:
image

@jeffkl
Copy link
Contributor

jeffkl commented Oct 4, 2022

@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?

@janivimal
Copy link

@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.

@jeffkl
Copy link
Contributor

jeffkl commented Oct 4, 2022

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?

@zmunro
Copy link

zmunro commented Oct 5, 2022

+1

@janivimal
Copy link

janivimal commented Oct 5, 2022

@jeffkl could you please provide more details on how to achieve - "Can you see if your Hyper-V configuration is preventing DNS from working?" ,

  • facing same issue in my office network as well as from my personal laptop.
    It fails after certificate message like below
    image

Can someone please try to reproduce this ? Below are the steps, that I am following

  1. Create .net 6.0 api using VS2022 - selecting windows container when setting up project (windows machine if possible)

  2. trim down docker file to below
    FROM mcr.microsoft.com/dotnet/sdk:6.0
    WORKDIR /src
    COPY ["{your project}.csproj", ""]
    RUN dotnet restore "./{your project}.csproj" --verbosity detailed

  3. validate and switch docker desktop to Windows Container mode

  4. from PS command prompt , navigate to csproj level, run below command

  5. docker build .

Thank you !

  • In my Hyper V manager - I do not see any VM, not sure if I should expect this?
    image

@janivimal
Copy link

@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 !

@phuocnv-dgh
Copy link

Forwarded form dotnet/dotnet-docker#1670

I had a problem when building a sample dotnet app When I run dotnet restore in docker image I get following errors:

Failed to download package 'Microsoft.AspNetCore.Authentication.Core.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.authentication.core/2.2.0/microsoft.aspnetcore.authentication.core.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.authentication.core/2.2.0/microsoft.aspnetcore.authentication.core.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.Extensions.Caching.Abstractions.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.caching.abstractions/2.2.0/microsoft.extensions.caching.abstractions.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.caching.abstractions/2.2.0/microsoft.extensions.caching.abstractions.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.AspNetCore.Diagnostics.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.diagnostics/2.2.0/microsoft.aspnetcore.diagnostics.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.diagnostics/2.2.0/microsoft.aspnetcore.diagnostics.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.Extensions.Logging.Abstractions.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/2.2.0/microsoft.extensions.logging.abstractions.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/2.2.0/microsoft.extensions.logging.abstractions.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'System.Net.WebSockets.WebSocketProtocol.4.5.3' from 'https://api.nuget.org/v3-flatcontainer/system.net.websockets.websocketprotocol/4.5.3/system.net.websockets.websocketprotocol.4.5.3.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/system.net.websockets.websocketprotocol/4.5.3/system.net.websockets.websocketprotocol.4.5.3.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.AspNetCore.Localization.Routing.2.2.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.localization.routing/2.2.0/microsoft.aspnetcore.localization.routing.2.2.0.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.localization.routing/2.2.0/microsoft.aspnetcore.localization.routing.2.2.0.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'Microsoft.EntityFrameworkCore.Tools.2.2.4' from 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.tools/2.2.4/microsoft.entityframeworkcore.tools.2.2.4.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.tools/2.2.4/microsoft.entityframeworkcore.tools.2.2.4.nupkg' timed out because no data was received for 60000ms.
...

Dockerfile

# https://hub.docker.com/_/microsoft-dotnet-core
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /source

# copy csproj and restore as distinct layers
COPY *.csproj .
RUN dotnet restore

# copy and publish app and libraries
COPY . .
RUN dotnet publish -c release -o /app --no-restore

# final stage/image
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "dotnetapp.dll"]

File *.csproj

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Ben.BlockingDetector" Version="0.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.7" />
    <PackageReference Include="MongoDB.Driver" Version="2.9.2" />
    <PackageReference Include="prometheus-net" Version="3.1.4" />
    <PackageReference Include="prometheus-net.AspNetCore" Version="3.1.4" />
    <PackageReference Include="Quartz" Version="3.0.7" />
    <PackageReference Include="ServiceStack.Core" Version="5.7.1" />
    <PackageReference Include="ServiceStack.OrmLite.MySqlConnector.Core" Version="5.7.1" />
    <PackageReference Include="ServiceStack.OrmLite.PostgreSQL.Core" Version="5.7.1" />
    <PackageReference Include="ServiceStack.Redis.Core" Version="5.7.1" />
    <PackageReference Include="System.IO.Pipelines" Version="4.6.0" />
  </ItemGroup>
</Project>

Output of docker version

Client: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfca03
 Built:             Thu Aug 29 05:29:49 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.8
  Git commit:       6a30dfca03
  Built:            Thu Aug 29 05:28:23 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info

Client:
 Debug Mode: false

Server:
 Containers: 46
  Running: 6
  Paused: 0
  Stopped: 40
 Images: 1338
 Server Version: 19.03.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.0-4-amd64
 Operating System: Debian GNU/Linux 9 (stretch)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.829GiB
 Name: debian-167
 ID: K5NH:LCRJ:AFV7:D3TN:N3IN:KE6B:RICT:7SPD:A3HP:IPGW:OOIN:6XFQ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

\cc @JonDouglas

I think you should delete the .zip file before docker-compose up -d --build

@ChristianSauer
Copy link

I am also affected and would like to fix this.
Pure linux docker containers running on linux

@virtualvoid
Copy link

Almost 2 years later and still not resolved.

.NET6

@erdembayar
Copy link
Contributor

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.

@abbasimo
Copy link

Any update? please!

@cosmic-blunder
Copy link

cosmic-blunder commented May 28, 2023

imed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Same issue in normal dot
net build command on linux.

kastwey added a commit to mastodon-cat/MastoAltText that referenced this issue Jun 4, 2023
@michha
Copy link

michha commented Jun 30, 2023

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).
Probably out of pure luck I discovered microsoft/Windows-Containers#145 .
Someone suggested to execute Get-NetAdapterRSC | Disable-NetAdapterRSC on the container host.
I gave it a try and didnt even restart the host - just the container.
curl was fast 🚀(5 mbit/s) and so was dotnet restore 🥳

TLDR:

  • slow dotnet restore inside a container could have its root cause outside of nuget/dotnet, try curl a big file inside your container to get a better insight
  • try Get-NetAdapterRSC | Disable-NetAdapterRSC on your host if you are brave enough

Give 👍 or 👎 on this post if this workaround resolved your issue.

@simanga-dev
Copy link

Anyone who know How to fix this on Linux Machine. I am facing the same problem

@skotl
Copy link

skotl commented Aug 25, 2023

Don't understand what this does, but I can confirm that it now makes my docker-hosted dotnet restore 100 times faster...!

@simanga-dev
Copy link

where do you put this, before or after the build command? @skotl

@skotl
Copy link

skotl commented Aug 30, 2023

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.
To try this on your PC (and I have genuinely no clue what it does, how safe or dangerous it is, so caveot empor!):

  1. Run PowerShell as an admin
  2. Inside PowerShell execute Get-NetAdapterRSC | Disable-NetAdapterRSC

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 ¯_(ツ)_/¯

@michha
Copy link

michha commented Aug 30, 2023

where do you put this, before or after the build command? @skotl

Its a one-time-thing. Do it after/before docker installation

@jeffkl jeffkl removed their assignment May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:HttpCommunication Functionality:Restore Platform:Docker All NuGet on docker scenarios Priority:2 Issues for the current backlog. Resolution:NotRepro We are not able to reproduce this problem. Better steps would be helpful. Triage:NeedsMoreInfo Type:Bug
Projects
None yet
Development

No branches or pull requests