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

Docker CE no longer works with WSL 2.0.0 and autoMemoryReclaim=gradual #10497

Closed
1 of 2 tasks
felipecrs opened this issue Sep 19, 2023 · 14 comments
Closed
1 of 2 tasks

Docker CE no longer works with WSL 2.0.0 and autoMemoryReclaim=gradual #10497

felipecrs opened this issue Sep 19, 2023 · 14 comments
Assignees

Comments

@felipecrs
Copy link

felipecrs commented Sep 19, 2023

Windows Version

Microsoft Windows [Version 10.0.22631.2338]

WSL Version

2.0.0.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.123.1-1

Distro Version

Ubuntu 22.04

Other Software

Docker version 24.0.6, installed following https://docs.docker.com/engine/install/ubuntu/.

Repro Steps

  1. Be on WSL older than 2.0.0.0
  2. Enable systemd through wsl.conf
  3. Install docker following https://docs.docker.com/engine/install/ubuntu/
  4. Confirm it works by running docker version
  5. Update WSL to 2.0.0.0
  6. Add autoMemoryReclaim=gradual to .wslconfig's [experimental]
  7. docker version times out

Expected Behavior

Docker to work just like before.

Actual Behavior

Docker daemon does not start.

Diagnostic Logs

Docker daemon logs:

Sep 19 09:46:20 FELIPE-MSI systemd[1]: Starting Docker Application Container Engine...
Sep 19 09:46:20 FELIPE-MSI dockerd[887]: time="2023-09-19T09:46:20.482638672-03:00" level=info msg="Starting up"
Sep 19 09:46:20 FELIPE-MSI dockerd[887]: failed to start daemon: Devices cgroup isn't mounted
Sep 19 09:46:20 FELIPE-MSI dockerd[887]: time="2023-09-19T09:46:20.500829506-03:00" level=info msg="stopping event stream following graceful shu>
Sep 19 09:46:20 FELIPE-MSI systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Sep 19 09:46:20 FELIPE-MSI systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 19 09:46:20 FELIPE-MSI systemd[1]: Failed to start Docker Application Container Engine.
@craigloewen-msft
Copy link
Member

Yes this is a known issue! We are working with the Docker team to get a fix for this.

@felipecrs
Copy link
Author

felipecrs commented Sep 19, 2023

Yes this is a known issue! We are working with the Docker team to get a fix for this.

Thanks for the heads up!

BTW sorry, I made a mistake in the reproduction steps (I said keep the .wslconfig empty while in fact you need autoMemoryReclaim to trigger the issue). I fixed it now.

@benhillis
Copy link
Member

I believe I have a fix for this issue, we should be pushing a 2.0.1 here in the next couple of days.

@benhillis benhillis self-assigned this Sep 19, 2023
@zcobol
Copy link

zcobol commented Sep 19, 2023

@felipecrs when you enable the [experimental] features it disables cgroupv1 nuking docker service which depends on it. See /proc/cmdline and you'll find cgroup_no_v1=all there!

@felipecrs
Copy link
Author

Makes sense, but I did some things like:

$ cat > /etc/docker/daemon.json <<EOF
{
  "exec-opts": ["native.cgroupdriver=systemd"]
}
EOF

To make docker use cgroups v2, and it didn't work out well. Maybe I did something wrong though.

@felipecrs
Copy link
Author

Please note that I'm not using Docker Desktop.

@driver1998
Copy link

Saw on #10499, just tested, autoMemoryReclaim=dropcache works with docker as well.

@felipecrs felipecrs changed the title Docker CE no longer works with WSL 2.0.0 and autoMemoryReclaim Docker CE no longer works with WSL 2.0.0 and autoMemoryReclaim=gradual Sep 20, 2023
@benhillis
Copy link
Member

@felipecrs
Copy link
Author

I can confirm it was fixed indeed. Thank you!

@corebonts
Copy link

Note that although you may think that you've updated WSL with wsl --update --pre-release, for some the update silently fails: #10539
In this case you should install it manually by downloading the MSI.

@felipecrs
Copy link
Author

felipecrs commented Sep 26, 2023

I had noticed the failure when updating as well, and that's why I update through the Microsoft Store. I will double check the version though.

@felipecrs
Copy link
Author

Yes, confirmed:

wsl --version
WSL version: 2.0.1.0
Kernel version: 5.15.123.1-1
WSLg version: 1.0.58
MSRDC version: 1.2.4485
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25880.1000-230602-1350.main
Windows version: 10.0.22631.2338

@carlosrmendes
Copy link

wsl version 2.0.7.0 and .wslconfig with:

[experimental]
autoMemoryReclaim = "gradual"

Docker Desktop cannot start, it hangs forever

@dfenerski
Copy link

wsl version 2.0.7.0 and .wslconfig with:

[experimental]
autoMemoryReclaim = "gradual"

Docker Desktop cannot start, it hangs forever

I have the same issue with both autoMemoryReclaim=dropcache and autoMemoryReclaim=gradual with following versions:

WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants