microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.23k stars 808 forks source link

Docker stopped working in WSL 2.3.11.0 #11794

Open neoGeneva opened 1 month ago

neoGeneva commented 1 month ago

Windows Version

Microsoft Windows [Version 10.0.22635.3930]

WSL Version

2.3.11.0

Are you using WSL 1 or WSL 2?

Kernel Version

6.6.36.3-microsoft-standard-WSL2

Distro Version

Ubuntu 20.04

Other Software

Docker version 27.0.3, build 7d4bcd8

Repro Steps

  1. Update WSL via windows store
  2. Launch Docker

Expected Behavior

Docker to launch successfully

Actual Behavior

Docker fails to launch

Diagnostic Logs

No response

Some additional context

This morning WSL was updated via the Windows store, after that Docker failed to launch with a generic "exit code 1" error message. I uninstalled and reinstalled Docker and then it still failed to launch complaining it couldn't get the disk size.

I've seen some other issues related to Docker https://github.com/microsoft/WSL/issues/11742 and https://github.com/microsoft/WSL/issues/11771 and kernel version 6.6.36.3, but those don't seem to apply to me since I'm not building the kernel my self (installing from Microsoft Store), and I don't have "kernel=" in my .wslconfig.

Also, installing Docker using Hyper-V instead of WSL has no problems.

github-actions[bot] commented 1 month ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

wmmc88 commented 1 month ago

I ran into the same issue. Rolling back WSL to 2.2.4 via the installer at https://github.com/microsoft/WSL/releases/tag/2.2.4 mitigated this issue for me for now.

It seems like WU updated me to the 2.3.11 prerelease.

elsaco commented 1 month ago

@neoGeneva docker inside WSL is not working anymore? It might have to do with modules loading. On an non-systemd I can't load any WSL modules. On a systemd enabled WSL distro modules load fine, and docker engine works also:

ubuntu@eleven:~$ wslinfo --wsl-version
2.3.11
ubuntu@eleven:~$ docker info
Client: Docker Engine - Community
 Version:    26.1.4
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 26.1.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d2d58213f83a351ca8f528a95fbd145f5654e957
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 6.6.36.3-microsoft-standard-WSL2
 Operating System: Ubuntu 24.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.757GiB
 Name: eleven
 ID: 49698596-f698-4988-846b-b652beca4bd4
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
dbalabka commented 1 month ago

Thanks, @wmmc88. Rollback was the only option for me, and it works https://github.com/microsoft/WSL/releases/tag/2.2.4

elsaco commented 1 month ago

On Windows side docker engine wouldn't start after wsl upgrade to 2.3.11, but it works after a docker upgrade:

Before: docker_wsl_error

and after docker upgrade:

docker_wsl_update

AnthonyMastrean commented 1 month ago

I'm having trouble starting multiple recent versions of Docker Desktop. I can't get the notification panel to open at all, but it's showing multiple red notification counts. Most recently, I was able to capture this:

Unable to calculate image disk size

I'm seeing multiple events from WSL in the event log/viewer:

The description for Event ID 0 from source WSL cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Failed to create network endpoint with address: '172.28.92.131', assigned new address: '172.24.38.138'

The message resource is present but the message was not found in the message table

If downgrading to WSL 2.2.4 is a temporary solution, is there any way to prevent the Microsoft Store from upgrading it again?

zcobol commented 1 month ago
[com.docker.backend.exe.wslintegration] exited the watch loop of wsl distro agents
[com.docker.backend.exe.wslintegration] updating integration, default distro: true, additional distros: [], kubernetes enabled: false, kubernetes listener active: false, mustMergeKubeconfig: false
[com.docker.backend.exe.wslintegration] starting distro watcher
[com.docker.backend.exe.wslintegration] current active agents before sync: 0
[com.docker.backend.exe.wslintegration] active agents: 0
[com.docker.backend.exe.wslintegration] adding a wsl agent for new distro Ubuntu
[com.docker.backend.exe.ipc] 1ff0b792-wslintegrationagent-Ubuntu -> \\.\pipe\dockerWSLCrossDistroService CrossDistroService
[com.docker.backend.exe.wslintegration] done syncing agents
[com.docker.backend.exe.wsldistroproxy] start wsl integration for distro Ubuntu
[com.docker.backend.exe.wsldistroproxy] Configuring docker credstore to use desktop.exe
[com.docker.backend.exe.wsldistroproxy] credsStore already set to desktop.exe
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e whoami
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -u root -e sh -c ( addgroup docker || true ) && addgroup "root" docker
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -u root -e sh -c ( groupadd docker || true ) && usermod -aG docker "root"
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e /mnt/wsl/docker-desktop/docker-desktop-user-distro sync-context-store /mnt/c/Users/zcobol/.docker/contexts
[com.docker.backend.exe.wsldistroproxy][W] syncing context store in Ubuntu distro: cli contexts not resynced: exit status 1
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e /mnt/wsl/docker-desktop/docker-desktop-user-distro sync-home-subdir /mnt/c/Users/zcobol/.aws
[com.docker.backend.exe.wsldistroproxy][W] syncing ~/.aws in Ubuntu distro: path .aws not synced: exit status 1
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e /mnt/wsl/docker-desktop/docker-desktop-user-distro sync-home-subdir /mnt/c/Users/zcobol/.azure
[com.docker.backend.exe.wsldistroproxy][W] syncing ~/.azure in Ubuntu distro: path .azure not synced: exit status 1
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e /mnt/wsl/docker-desktop/docker-desktop-user-distro sync-file /mnt/c/Users/zcobol/.docker/features.json ~/.docker/features.json
[com.docker.backend.exe.wsldistroproxy][W] syncing ~/.docker/features.json in Ubuntu distro: syncing windows path /mnt/c/Users/zcobol/.docker/features.json to ~/.docker/features.json: exit status 1
[com.docker.backend.exe.wsldistroproxy] Killing CLI API server running at /root/.docker/run/docker-cli-api.sock
[com.docker.backend.exe.wsldistroproxy] Starting WSL Distro proxy
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -e cat /etc/wsl.conf
[com.docker.backend.exe.wsldistroproxy] wsl.exe -d Ubuntu -u root -e /mnt/wsl/docker-desktop/docker-desktop-user-distro proxy --distro-name Ubuntu --docker-desktop-root /mnt/wsl/docker-desktop C:\Program Files\Docker\Docker\resources
[com.docker.backend.exe.wslintegration] distro agent Ubuntu exited unexpectedly: running wsl distro proxy in Ubuntu distro: exit status 1
[com.docker.backend.exe.wslintegration] attempting recovery from agent Ubuntu error: running wsl distro proxy in Ubuntu distro: exit status 1
[com.docker.backend.exe.report] reporting error to user: running wsl distro proxy in Ubuntu distro: exit status 1
neoGeneva commented 1 month ago

Enabling systemd within WSL as described here resolved the issue for me. https://github.com/docker/for-win/issues/14198#issuecomment-2237494427

andy-sixtystores commented 1 month ago

For me the issue was related to WSL 2.3.11 Pre-release. Check your version with wsl --version.

I downloaded the installer for 2.4.4 (Latest) restarted the computer and docker loaded as normal. Download WSL from the official release page - https://github.com/microsoft/WSL/releases

JonathanPitre commented 1 month ago

To revert back on 2.2.4.0 run the following from a Terminal with admin rights

wsl --shutdown
wsl --uninstall
wsl --update
wsl --version (ensure you see 2.2.4.0)
mnorrsken commented 1 month ago

To revert back on 2.2.4.0 run the following from a Terminal with admin rights

wsl --shutdown
wsl --uninstall
wsl --update
wsl --version (ensure you see 2.2.4.0)

This did not work for me, it installed 2.3.11 again, most likely because Im on windows insider programme or something. What did work was to install version 2.2.4 from the github release page and then block all updates in Microsoft Store app (by clicking on my profile, Settings, turn off updates)

zcobol commented 1 month ago

docker-win-4.23.0 does work with wsl-2.3.11. I've noticed that if the default wsl distro is not running launching docker desktop will fail with Docker Engine stopped and wsl -l -v show the distro in non-running state. It should be as docker kick-starts it. Restarting docker works. It also works if the wsl distro is already running.

docker_wsl-2 3 11_info

JonathanPitre commented 1 month ago

To revert back on 2.2.4.0 run the following from a Terminal with admin rights

wsl --shutdown
wsl --uninstall
wsl --update
wsl --version (ensure you see 2.2.4.0)

This did not work for me, it installed 2.3.11 again, most likely because Im on windows insider programme or something. What did work was to install version 2.2.4 from the github release page and then block all updates in Microsoft Store app (by clicking on my profile, Settings, turn off updates)

Could be because you're running a Windows Insider version. I don't see why MS would push pre-release updates otherwise.

Did you install WSL initially via the MS store, MSI or command line?

In my case, I'm running Win11 23H2 and I installed WSL via command line.

rdbisme commented 1 month ago

Same here. Windows 11 Insider. New WSL version breaks docker.

rdbisme commented 1 month ago

In my case disabling cgroupv1, then wsl.exe --shutdown fixed the problem.

https://stackoverflow.com/questions/73021599/how-to-enable-cgroup-v2-in-wsl2

jrozner commented 1 month ago

docker-win-4.23.0 does work with wsl-2.3.11. I've noticed that if the default wsl distro is not running launching docker desktop will fail with Docker Engine stopped and wsl -l -v show the distro in non-running state. It should be as docker kick-starts it. Restarting docker works. It also works if the wsl distro is already running.

docker_wsl-2 3 11_info

I was running into this as well after upgrading to pre-release wsl. Quitting Docker Desktop, starting wsl, then starting Docker Desktop worked for me.

onkiit commented 1 month ago

Thanks, @wmmc88. Rollback was the only option for me, and it works https://github.com/microsoft/WSL/releases/tag/2.2.4

could you share the command to rollback to 2.2.4? I use commands in this thread (shared by @JonathanPitre) but it didn't work for me (installing latest version). Thanks

UPDATE: resolved now :)

elsaco commented 1 month ago

wsl-2.3.13 fixed the docker not staring issue. See details at https://github.com/microsoft/WSL/releases/tag/2.3.13

Run wsl --update --pre-release or stay on 2.2.4 release because 2.3.13 is a beta

FlattusBlastus commented 1 month ago

Reverting to 2.2.4 didnt fix it. I had to uninstall Docker Desktop for Windows entirely then reinstall it with the latest: 4.33.0. I now see this: C:\Windows\System32>wsl --version WSL version: 2.3.13.0 Kernel version: 6.6.36.3-1 WSLg version: 1.0.63 MSRDC version: 1.2.5326 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.26100.1297

Docker for Desktop loads correctly now.

kevinbosman commented 1 month ago

WSL 2.3.11 also broke/changed the way docker_gwbridge networking works within docker swarm. The gateway address 172.18.0.1 appears to permanently timeout within the swarm.

This is still broken in 2.3.13, but it does at least start now.

Reverting to 2.2.4 works correctly.