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
[snapd 2.57.4] Snap Suddenly Stop Working on SystemD Enabled WSL2 #299
Comments
Hi, thanks for your report. This is a known issue (https://bugs.launchpad.net/snapd/+bug/1991826). A fix has already been comited here snapcore/snapd#12179 but it hasn't reached users yet. We're also working on a work-around. May I ask what release you're running? ( |
is there a release schedule of this fix? |
Judging from past releases it should be in the next couple of weeks. Update: there is a less destructive fix, see next comment Here is a temporary fix that works for Ubuntu 22.04. Note that this will uninstall all your snaps, so be sure to make any necessary backups. First, make sure your install is indeed broken:
If so, apply the fix: $ sudo apt -y remove snapd --purge # This is the destructive action
$ sudo apt install -y snapd=2.55.3+22.04
$ sudo snap install snapd --beta # Should install snapd (beta) 2.57.5
$ sudo snap refresh # Validation: should not print the same as before
$ sudo apt upgrade snapd # No need to stay in old version |
This explanation is deprecated for all but Ubuntu Preview (Ubuntu 22.10). Check out #299 (comment) for a simple two-line permanent fix. First, make sure your install is indeed broken:
If so, apply the fix. Go into powershell: # Check the name of the distro you want to fix.
wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
Ubuntu-Preview Stopped 2
Ubuntu-18.04 Stopped 2
Ubuntu Stopped 2
Ubuntu-22.04 Running 2
# Use the name of the distro that you want to fix:
wsl -d NAME -u root
# For instance: wsl -d Ubuntu -u root This will start a shell as root:
You'll be back in powershell. Restart wsl:
Go into WSL the usual way and test that it worked: sudo snap refresh
# Should print something other that the previous message |
Can confirm the latest workaround works, thank you. Any way I can return to snap release once the fix is there?
Also, here's my
|
Thanks, I've checked and this afects every distro from 18.04 to 22.10.
Yes, once the fix is available you'll be able to return to release. I'll mention it in this thread and close the issue once that is the case. |
Workaround: Ensure you have echo ":windowsexe:M::\x4d\x5a::/init:PF" | sudo tee -a /etc/binfmt.d/windowsexe.conf This will replace the Edit: fix the path to the configuration file. |
This is the official, permanent fix. This is the fix: sudo apt-get -y update
sudo apt-get -y upgrade snapd If you had switched to the beta channel as a temporary fix, you can undo it via:
|
It triggers some errors when I run jupyter lab: |
@EduardGomezEscandell I did the above and then removed/reinstalled the snaps (b/c
|
Thanks for the report, @micahl This seems to be a separate issue. Snapd detects it is running on WSL but fails to detect it is WSL2, so it falls back to assuming it is WSL1. See here: I opened a bug report here https://bugs.launchpad.net/snapd/+bug/1995083. |
Hi, I'm still facing issues with it even after the upgrade. I did try some of the workaround fixes for it before I saw the new release, not sure if that's the reason this is happening. I did try purge method mentioned at the top of this thread too. Also want to note: I'm connected to my company's VPN. I've tried this with it being on and off, and both give the same error. |
This error is different and probably not related to snap. Are you sure your systemd is enabled properly? Use |
What should I do if the message returns "degraded"? |
Then you're good, that's normal and snap should work. If you want to see exactly which services fail you can use It happens because of some incompatibilities between these services and WSL that we have not yet addressed. Do you have the same issue as the one reported in the previous screenshot, or is it something else? |
@EduardGomezEscandell, I also have the same issue as the @isonlaxman in regards to |
What version of Ubuntu are you running? |
@EduardGomezEscandell Ubuntu 22.04.1 LTS |
@kgkoutis If the error message is the same as @isonlaxman, then please file a new issue (under this same repo) because it seems to have a diferent origin as the original report. You can tag me there if you want. In that issue please provide your |
Closing because this issue only affects Kinetic, which is no longer supported on WSL (This or next week Ubuntu-Preview will start shipping with Lunar Lobster 🦞 ) |
Console Outputs
It's also available to install and run Snap Packages with Install & Run & Remove logs
|
Kinetic is no longer affected, so this issue is now 100% solved. This is the fix: sudo apt-get -y update
sudo apt-get -y upgrade snapd Any problem you may have with snapd on WSL should be reported in a new issue. |
what if it showing offline? |
what if it is showing offline? |
Same here, what if it shows offline is there a fix for that |
cmd /c ver
Microsoft Windows [Version 10.0.22621.674]
wsl --status
Default Distribution: AlmaLinux-8
Default Version: 2
Did the problem occur during installation?
What happened?
Even when previously able to install microk8s using
sudo snap install microk8s --classic
it's now suddenly stopped working. This rendermicrok8s stop
command unable to execute and emitmessages.
What was expected?
Able to install, start, stop. and uninstall using Snap when systemd is enabled on WSL2.
Steps to reproduce
/etc/wsl.conf
wsl --shutdown
microk8s start
microk8s stop
(usually works fine, this time it stops working)Additional information
wsl --version
cat /etc/wsl.conf
Additional screenshot
The text was updated successfully, but these errors were encountered: