WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Error code: Wsl/Service/E_UNEXPECTED

Open nehe009 opened this issue 3 years ago • 81 comments

Version

Microsoft Windows [Versión 10.0.19045.2486]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.15.79.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

steps taken until I got the error, in a fresh OS installation

  • Activate systemd sudo nano /etc/wsl.conf [boot] systemd=true

wsl.exe –shutdown

  • Install webmin sudo nano /etc/apt/sources.list → deb https://download.webmin.com/download/repository sarge contrib wget https://download.webmin.com/jcameron-key.asc cat jcameron-key.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/jcameron-key.gpg sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install webmin

  • install webinoly (lemp) wget -qO weby qrok.es/wy && sudo bash weby -clean sudo stack -php-ver=8.1 sudo stack -mysql-ver=10.6 sudo stack -lemp

So far so good, all services work properly.

Expected Behavior

When closing the console window where the linux operating system is open, the WSL is expected to stop all services in the background and turn off the virtual machine.

Actual Behavior

When I start the application again I get the following error:

Fatal Error Error code: Wsl/Service/E_UNEXPECTED press any key to continue

and then the window closes.

Diagnostic Logs

No response

nehe009 avatar Jan 17 '23 00:01 nehe009

/logs

benhillis avatar Jan 17 '23 18:01 benhillis

Hello! Could you please provide more logs to help us better diagnose your issue?

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 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

Thank you!

ghost avatar Jan 17 '23 18:01 ghost

this just happened to me after shutting down my ubuntu distro and then rebooting (after installing a few packages from the ubuntu-desktop bundle)

please help, that distro has a lot of important stuff on it

ghost avatar Jan 24 '23 11:01 ghost

it somehow automagically revived itself? installed the rest of the bundle (when i say bundle i mean the packages listed among "the following NEW packages will be installed" thing). working amazing so far

ghost avatar Jan 25 '23 00:01 ghost

WslLogs-2023-04-14_07-19-36.zip

For me WSL runs great initially. I notice this issue if I come back to work after a big gap. Once I hit the error, wsl --shutdown is useful.

Linux home-pc 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description:    Ubuntu 22.10
Release:        22.10
Codename:       kinetic

I am running the following: snapd, microk8s and I use VSCode plugin for WSL.

vm75 avatar Apr 14 '23 14:04 vm75

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

same error

Morrigan-Ship avatar Feb 27 '24 16:02 Morrigan-Ship

same error: Error code: Wsl/Service/E_UNEXPECTED please.

Taco0220 avatar Apr 02 '24 02:04 Taco0220

@Taco0220, If you need to restore the WSL "machine" (to recover files, etc.), see if this approach can help you: https://stackoverflow.com/a/76354545/1493870

It's not the solution to this issue. Only a way to get back the files inside the WSL.

marcoaureliocardoso avatar Apr 02 '24 03:04 marcoaureliocardoso

@Taco0220, If you need to restore the WSL "machine" (to recover files, etc.), see if this approach can help you: https://stackoverflow.com/a/76354545/1493870

It's not the solution to this issue. Only a way to get back the files inside the WSL.

I've tried a lot of things, but nothing worked。

Taco0220 avatar Apr 02 '24 03:04 Taco0220

This just happened to me

901238746 avatar Aug 23 '24 19:08 901238746

Get it frequently lately. Much confusion. I feel like it started once I:

  • updated to latest
  • enabled options="metadata"
  • enabled dbus
# Check if DBus is running, if not, launch it
if ! pgrep -x "dbus-launch" > /dev/null; then
    eval `dbus-launch --sh-syntax`
#    echo "DBus session started."
fi

fliespl avatar Sep 06 '24 20:09 fliespl

I had the same error today. wsl.exe --shutdown fixed it on my maschine.

noeldamps avatar Feb 10 '25 12:02 noeldamps

wsl.exe --shutdown

worked for me

skhan87 avatar Feb 18 '25 12:02 skhan87

the same error, and wsl.exe --shutdown work

LinZexiao avatar Feb 20 '25 01:02 LinZexiao

if the shutdown doesnt work backup the important files of "home" and reinstall the wsl distro if you have dot files like for zsh,neovim,etc i made a bash script that helps you to backup and restore them easily

wallydevgg avatar Feb 24 '25 14:02 wallydevgg

wsl --shutdown works at first, but every time when i reopen it, it crash again...

floation-cutie avatar Feb 27 '25 04:02 floation-cutie

wsl --shutdown works at first, but every time when i reopen it, it crash again...

How do you start your wsl?

noeldamps avatar Feb 27 '25 12:02 noeldamps

crazy this error is 2 years old: https://github.com/microsoft/WSL/issues/9490#issuecomment-1508653832

i bet it's something to do with sleep mode or battery saving

earonesty avatar Mar 01 '25 00:03 earonesty