WSL prerelease breaks docker startup init with ulimit -Hn 524288
Windows Version
10.0.22631.5335
WSL Version
2.5.7
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
No response
Distro Version
Ubuntu 24.04
Other Software
No response
Repro Steps
- Same file /etc/wsl.conf including
[boot]
command = "service docker start; service cron start; vcan"
...
- Update to prerelease from 2.4.10
- Shutdown wsl
- Start distro again shows Docker service down, failed to start because **/etc/init.d/docker:62 ulimit: error setting limit (Invalid argument)
- Faulty command: ulimit -Hn 524288
- Run that command manually also shows: -bash: ulimit: open files: cannot modify limit: invalid argument
Expected Behavior
Docker service is able to start at boot like in previous releases (2.4.10 latest one I tested)
Actual Behavior
Docker service cannot start at boot after updating to prelease 2.5.7, but it can be started manually afterwards:
sudo service docker restart
Diagnostic Logs
Docker info
Client: Docker Engine - Community
Version: 28.1.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.23.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.35.1
Path: /usr/libexec/docker/cli-plugins/docker-compose
OS Release:
PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
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 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, following the instructions here
Once completed please upload the output files to this Github issue.
Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] 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'.
Possible linked? https://github.com/microsoft/WSL/issues/12837
@OneBlue - I think you tweaked some ulimit values recently?
Yes this is indeed a consequence of that. We have increased the soft file descriptor limit to 1,048,576, and given that the hard file descriptor limit cannot be lower than the soft one (which is what ulimit -Hn 524288 is trying to do), that command fails.
Maybe 1,048,576 is a bit too high. I'll make a change to bring it down to let's say 10240. That should solve this while not regressing #12837
This is also affecting multiple people at my company. Because 2.5.7 is flagged as a regular, non-prerelease it means more people will be using this version soon too.
I can reproduce this on 1 of my 2x work PCs. For the PC that I can reproduce this on, I confirmed that rolling back to 2.5.6 works Both of my PCs (including the one that shows this problem, and the one that doesn't show this problem) are on Windows 11 23H2
@OneBlue I tested and confirmed that 2.5.8 fixes this issue, for my scenario. Thank you for the quick response!
Currently, 2.5.7 is flagged as Latest, and 2.5.8 is Pre-release. Could 2.5.8 be marked as Latest? It would be nice for users to update to the fixed version when running wsl --update.
Glad to hear @daulis. We need to do some additional testing before that release can be marked as Latest, but you can upgrade with wsl --update --pre-release in the meantime.
Closing since the issue is resolved in 2.5.8