The I/O operation has been aborted because of either a thread exit or an application request
Environment
Windows build number: Microsoft Windows NT 10.0.20175.0
Your Distribution version: Ubuntu (can't run because failed to run the bash)
Whether the issue is on WSL 2 and/or WSL 1: WSL1
Steps to reproduce
Just opening the WSL (Ubuntu) after a windows update (insider build).

lxcore details logs -
Expected behavior
Should work
Actual behavior
Error: The I/O operation has been aborted because of either a thread exit or an application request
I'm hitting the same issue, and am on the same Windows build with WSL1.
Even just trying to list distributions hangs and fails like this: wsl --list --all
@bityob - Interesting, I'm able to repro this but this didn't hit in our automated testing. I'll figure out what's going on. In the meantime I'd suggest rolling back to the previous version or using WSL2. Looks like conversion is working ok.
Ok... this issue seems to be related to when the init daemon receives a larger than expected message from our service and has to resize our buffer. You may be able to work around this by temporarily reducing the length of your windows %PATH% variable.
Alright, I've fixed this and written a test so this kind of thing won't happen again.
Sorry about the disruption this caused... I'll try to get the fix into an Insider Fast build ASAP.
@nathpete-msft - the list issue you mention looks different. Can you file a new issue with more details, please?
@benhillis
You may be able to work around this by temporarily reducing the length of your windows %PATH% variable.
Thanks, this did solve the issue -
set PATH=
C:\Windows\System32\wsl.exe
or
set PATH=C:\Windows\System32
wsl
Yep. I'm definitely affected by this bug. I started shortening my %PATH%, one program path string at a time until I got down to 989 characters, including spaces (so, assuming a limit of 1024 characters or just below). Once I got it pared down to 989 characters, WSL started working again as normally. But my machine where I test preview builds also has Windows Kits, developer environments, multimedia software, diagnostics, and so forth, all of which need to be in the path to work properly. Why was WSL limited to a certain path length? Any way to work around this without shortening the path in a cmd prompt before running WSL? I have use it to run Linux software side-by-side with Windows on the fly. Haven't been able to do this since updating to Windows 10 build 20175.
Temporary workaround I started using today is to launch terminal from PowerShell:
c:\windows\system32\cmd.exe /c "path %SystemRoot%\System32; && %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\wt"
Alternatively, a shortcut can be created with the following:
C:\WINDOWS\system32\cmd.exe /c "path %SystemRoot%\System32; && %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\wt"
Or, you can use:
C:\Windows\System32\cmd.exe /c "path C:\Windows\system32; && %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\wt.exe"
Set the "Run:" property on the Shortcut tab to Minimized and click apply. So, until the above bug is fixed, this is what I have started doing for the time being. Similar can be done with individual Linux apps, but with the wt.exe line replaced with the path to your Linux program.
Note: If you also use PowerShell through Windows Terminal, you'll also have to add the path to your PowerShell installation in addition, like this:
C:\Windows\System32\cmd.exe /c "path C:\Windows\system32;C:\WINDOWS\System32\WindowsPowerShell\v1.0\; && %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\wt.exe"
@dcharlespyle
I started shortening my %PATH%, one program path string at a time until I got down to 989 characters, including spaces (so, assuming a limit of 1024 characters or just below). Once I got it pared down to 989 characters, WSL started working again as normally
I wrote a simple python script to check the limit in my machine.
In my case the limit was not always the same (805/817/878 characters).
The script needs Python 3.6+ to run.
import os
from subprocess import STDOUT, check_output
import platform
# Get the path to the wsl executable, it's different if python is 32bit or 64bit
# See here - https://stackoverflow.com/a/41631476
system32 = 'SysNative' if platform.architecture()[0] == '32bit' else 'System32'
wsl_command = os.path.join(os.environ['SystemRoot'], system32, 'wsl.exe')
min_num = 800
max_num = 2000
path = ""
try:
for i in range(min_num, max_num):
path = "A" * i
curr_command = f"set PATH={path} && {wsl_command} uptime"
print(f"Length of path: {len(path)}")
# Raise exception in case of error
output = check_output(curr_command, stderr=STDOUT, timeout=60, shell=True)
print(output.decode('utf8').strip())
except Exception as ex:
print(f"FAILED. Output: {ex.output.decode('utf8')}")
I've shorten my PATH to 770 characters, but still can not start WSL with extractly same error.
If you're running into the issue with too long of a PATH and you're using Windows Terminal, you can set up a profile with the following commandline property to automatically clear your PATH before running WSL. This will leave PATH in tact for other shells.
"commandline": "cmd.exe /C \"set PATH= && \"C:\\WINDOWS\\System32\\wsl.exe\"\"",
If you're using VSCode, you can resolve this by using the following settings:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
"terminal.integrated.env.windows": {
"PATH": ""
},
If you're running into the issue with too long of a PATH and you're using Windows Terminal, you can set up a profile with the following
commandlineproperty to automatically clear your PATH before running WSL. This will leave PATH in tact for other shells."commandline": "cmd.exe /C \"set PATH= && \"C:\\WINDOWS\\System32\\wsl.exe\"\"",If you're using VSCode, you can resolve this by using the following settings:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe", "terminal.integrated.env.windows": { "PATH": "" },
Not working for me 😢
If you're running into the issue with too long of a PATH and you're using Windows Terminal, you can set up a profile with the following
commandlineproperty to automatically clear your PATH before running WSL. This will leave PATH in tact for other shells."commandline": "cmd.exe /C \"set PATH= && \"C:\\WINDOWS\\System32\\wsl.exe\"\"",If you're using VSCode, you can resolve this by using the following settings:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe", "terminal.integrated.env.windows": { "PATH": "" },
The first one actually worked for me, although I applied a minor tweak to the code of the first example. This is what I put into my profile settings in Windows Terminal for use with WSL Ubuntu:
// Disabled as workaround for current path length bug; replaced with "commandline" property; when bug is fixed, enable the below line and disable the other.
// "source": "Windows.Terminal.Wsl",
"commandline": "cmd.exe /C \"set PATH=C:\\WINDOWS\\System32;C:\\WINDOWS;C:\\;C:\\Program Files;C:\\Program Files (x86) && \"C:\\WINDOWS\\System32\\wsl.exe\"\"",
That worked and it also allows me to run Windows executables from the Linux command line.
I've reduced the path characters to 456, I might break things in a really bad way if I keep trying to make it short and still no success. When is the next build coming out?
@ertwro
Did you try the python script above to check the limit in your machine?
I guess that empty path is working for you, right?
@bityob Yes, empty path is working. The limit using the python script and lowering the minimum variable is 760-767. Unfortunately that is not true. The real limit is somewhere around 250 in my case.
Even with PATH cleared (set PATH =), I can NOT run wsl: "The I/O operation has been aborted because of either a thread exit or an application request" BUG
@andreluizgit
Even with PATH cleared (set PATH =), I can NOT run wsl: "The I/O operation has been aborted because of either a thread exit or an application request" BUG
set PATH=
C:\Windows\System32\wsl.exe
This doesn't work for you? (from cmd)
I've reduced the path characters to 456, I might break things in a really bad way if I keep trying to make it short and still no success. When is the next build coming out?
I hope you weren't shortening your actual path environment. That could be bad for some programs. If you are doing it in the command line, however, it's only temporary for that session. So there is nothing to risk if doing it that way.
Even with PATH cleared (set PATH =), I can NOT run wsl: "The I/O operation has been aborted because of either a thread exit or an application request" BUG
If you actually put a space between PATH and the = sign (like you did above), that probably is why it didn't work for you. There should be no space between the words PATH and =. It should be set PATH=.