microsoft / WSL

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

service docker start doesn't work if systemd is enabled #12307

Open prescriptionlifeline opened 2 days ago

prescriptionlifeline commented 2 days ago

Windows Version

Microsoft Windows [Version 10.0.26100.2314]

WSL Version

2.3.26.0

Are you using WSL 1 or WSL 2?

Kernel Version

Linux version 5.15.167.4-microsoft-standard-WSL2 (root@f9c826d3017f) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Tue Nov 5 00:21:55 UTC 2024

Distro Version

Ubuntu 22.04.3 LTS

Other Software

docker --version (in WSL / Ubuntu) returns this:

Docker version 25.0.3, build 4debf41

wsl --version (in Windows) returns this:

WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2314

Repro Steps

service docker start

Expected Behavior

I'd expect service docker start to run without error.

Actual Behavior

service docker start gives this error:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.

Diagnostic Logs

Here's the output of systemctl status docker.service:

× docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2024-11-21 04:35:46 CST; 4min 35s ago
TriggeredBy: × docker.socket
       Docs: https://docs.docker.com
    Process: 1922 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 1922 (code=exited, status=1/FAILURE)

Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: Stopped Docker Application Container Engine.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: docker.service: Start request repeated too quickly.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: Failed to start Docker Application Container Engine.

Here's the output of journalctl -xeu docker.service:

https://pastebin.com/5u5vWS87

If I have this in my /etc/wsl.conf file service docker start doesn't work:

[boot]
systemd=true

If I comment out the systemd=true bit service docker start works but not with that line in place.

github-actions[bot] commented 2 days 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 script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) 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.

zcobol commented 1 day ago

@prescriptionlifeline docker.service does work under systemd!

Here's sample output on WSL Ubuntu 24.04:

zcobol@miami:~$ systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-11-21 07:39:15 PST; 8s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 353 (dockerd)
      Tasks: 12
     Memory: 107.0M ()
     CGroup: /system.slice/docker.service
             └─353 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.708219050-08:00" level=info msg="Default bridge (docker0>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.796400334-08:00" level=info msg="Loading containers: don>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.814302060-08:00" level=warning msg="WARNING: No blkio th>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.814338568-08:00" level=warning msg="WARNING: No blkio th>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.814346714-08:00" level=warning msg="WARNING: No blkio th>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.814351933-08:00" level=warning msg="WARNING: No blkio th>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.814368675-08:00" level=info msg="Docker daemon" commit=4>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.814666644-08:00" level=info msg="Daemon has completed in>
Nov 21 07:39:15 RIPPER dockerd[353]: time="2024-11-21T07:39:15.872367668-08:00" level=info msg="API listen on /run/dock>
Nov 21 07:39:15 RIPPER systemd[1]: Started docker.service - Docker Application Container Engine.
zcobol@miami:~$ wslinfo --wsl-version
2.4.4