docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.85k stars 287 forks source link

Docker build hangs indefinitely. #13488

Open akutruff opened 1 year ago

akutruff commented 1 year ago

Actual behavior

After updating to 4.19 docker build hangs with no feedback forever. docker buildx ls also hangs forever. docker ps and docker run hello-world run perfectly fine.

Expected behavior

It builds

Information

This is a new problem after upgrading to 4.19 this morning. I have uninstalled and reinstalled Docker Desktop. It did not help.

Inside a WSL terminal: docker build works as normal.

It could be related to https://github.com/docker/for-win/issues/13479

Output of & "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check

C:\Users\andyk>"C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check
[2023-05-12T17:47:52.341182000Z][com.docker.diagnose.exe][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0002: does the bootloader have virtualization enabled?
[SKIP] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0005: is the user in the docker-users group?
[PASS] DD0038: is the connection to Docker working?
[FAIL] DD0014: are the backend processes running? 1 error occurred:
        * com.docker.vpnkit.exe is not running

[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[FAIL] DD0009: is the vpnkit API responding? open \\.\pipe\dockerVpnKitDiagnostics: The system cannot find the file specified.
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0006: is the Docker Desktop Service responding?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[WARN] DD0032: do Docker networks overlap with host IPs? network bridge has subnet 172.17.0.0/16 which overlaps with host IP 172.17.96.1
segment 2023/05/12 13:47:56 ERROR: sending request - Post "https://api.segment.io/v1/batch": dial tcp: lookup api.segment.io: getaddrinfow: The requested name is valid, but no data of the requested type was found.
segment 2023/05/12 13:47:56 ERROR: 1 messages dropped because they failed to be sent and the client was closed

Please note the following 1 warning:

1 : The check: do Docker networks overlap with host IPs?
    Produced the following warning: network bridge has subnet 172.17.0.0/16 which overlaps with host IP 172.17.96.1

If the subnet used by a Docker network overlaps with an IP used by the host, then containers
won't be able to contact the overlapping IP addresses.

Try configuring the IP address range used by networks: in your docker-compose.yml.
See https://docs.docker.com/compose/compose-file/compose-file-v2/#ipv4_address-ipv6_address

Please investigate the following 1 issue:

1 : The test: are the backend processes running?
    Failed with: 1 error occurred:
        * com.docker.vpnkit.exe is not running

Steps to reproduce the behavior

  1. ...
akutruff commented 1 year ago

Resolved but the issue was the upgrade to buildx. buildx enumerated all contexts on the system and if a host did not have an ssh fingerprint in windows even though it was in WSL, it hung indefinitely and did not time out. You may want to do something about that or kick it over the the buildx team.

nc-jeni commented 1 year ago

Any updates on this?

I have the same problem:

I currently solved the issue by downgrading to v4.18.

A side-note to this, as it is not related to this issue, I see significant performance differences between Hyper-V and WSL. Hyper-V seems to have much faster IO access than WSL (both WSL vers. 1 and WSL vers. 2) which speeds up builds among others.

d3is commented 8 months ago

Same issue here. Builds will hang indefinitely on random steps.

I managed to get a build to work once by deleting the ~/.docker folder, but it started failing again after that.

surfaceowl commented 5 months ago

Same issue here -- docker builds in WSL2 hang randomly; has been working properly for years. Importantly, I am able to continue builds by manually restarting docker desktop from GUI in Win 11... then my build in WSL2 continues.... but this is a definitely slowing me down. This also affects running containers that hang as well, due to Docker Desktop integration.

This is new behavior in last month since release of Docker Desktop version 4.29.0

My setup details: Win 11 - running latest 2024-04 Cumulative Update for Windows 11 Version 23H2 for x64-based Systems (KB5036893) Docker Desktop 4.29.0 (145265) WSL2 running Ubuntu 22.04; RAM is 64GB WSL version: 2.1.5.0 Kernel version: 5.15.146.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.3447