-
Notifications
You must be signed in to change notification settings - Fork 50
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
wsl-windows-toolbar doesn't want to run anymore... #20
Comments
This actually suggests that the command itself failed. I.e. python attempted to execute
... and it returned an exit code of 1, and even if the variable in use contains spaces it still seems to work OK (at least at that point). From a WSL bash environment, what happens when you run this?
If that looks good, you can try actually running what is executed:
And see if that throws a |
user@XOTICPC:~$ cmd.exe /C echo %USERPROFILE% user@XOTICPC:~$ echo $? |
Oops - yeah that looks like your smoking gun... Is windows misbehaving? That command should work. Try |
Windows seems to be working properly... user@XOTICPC:~$ which cmd.exe I did nothing to WSL or Windows lately... this doesn't make any sense... |
Erm see if this gives different results:
(Using absolute path) I see references to wine there I wonder is it fighting with wsl or trying to intercept cmd.exe somehow (e.g. with an alias) |
user@XOTICPC:~$ /mnt/c/windows/system32/cmd.exe /C echo %USERPROFILE% should I uninstall wine, reboot windows and try running wsl-windows-toolbar again? |
Yeah I think so sorry it has been a long time since I have used Wine so I'm not exactly sure how its hijacking cmd.exe and associated dlls but I suspect it may be something to do with your PATH and related dll precedence |
uininstalled wine and rebooted and i still have the problem... user@XOTICPC:~$ wsl-windows-toolbar |
Different error code at least, what does cmd.exe /C echo %USERPROFILE% Say now? |
user@XOTICPC:~$ cmd.exe /C echo %USERPROFILE% which is total nonsense, since my system can find cmd.exe just fine... is this a paths issue in WSL2 or Windows? |
It is most likely your wsl2 environment based on the error you can try using the /mnt/c path to cmd.exe instead and see what you get? I have seen similar issues in the past where the |
user@XOTICPC:~$ alias user@XOTICPC:/mnt$ ls -l this is a new error... never had an inability to access /mnt/* before... i really don't want to have to re-install ubuntu from scratch, though... Edit; running wsl --shutdown in powershell and restarting bash fixed that... not sure why... Edit 2: tried making a symbolic link to C:\Windows\System32\cmd.exe in /bin/ but that made no difference in error codes... even though linux said it could find cmd.exe there. |
i checked my windows system logs... i remember that i did update Python on the Windows machine from 3.8.4 to 3.8.6... i wonder if that could have caused this... |
Try running the cmd.exe command from windows? Your windows python version shouldn't change your Linux python environment |
yeah. cmd.exe brings up the command prompt. Microsoft Windows [Version 10.0.19041.508] Microsoft Windows [Version 10.0.19041.508] C:\WINDOWS\system32> |
I mean cmd.exe /C echo %USERPROFILE% It should print your home directory. That should work in the exact same way from your wsl environment when all is well |
C:\WINDOWS\system32>cmd.exe /C echo %USERPROFILE% |
The odds are its something wrong with your PATH environment variable in wsl. Check the output from
And look for the system32 path, and anything else that might fight with windows dlls |
beware, it's kinda long... it imports the Linux path and the Windows Path... as well as the $NEWPATH variable I use for tools and included into the regular windows path: user@XOTICPC:~$ echo $PATH |
i'm not sure what else to check on WSL.... i can try making a second ubuntu install and see if that works... but this is getting depressing |
I tried making a new WSL2 instance of ubuntu... and it returns the same errors: user@XOTICPC:~$ wsl-windows-toolbar |
yeah, it doesn't even work in a new ubuntu install, either.. i wonder if I have to completely nuke WSL and re-install it.... I'll try system restore to last week before that, however. |
okay. after about 8 hours of searching I FINALLY fixed it. the problem was as described by this user: sudo update-binfmts --disable cli is what fixed it. Just in case the link breaks, I've included a quotation describing the issue and the fix below: kodsnutten commented on Aug 25, 2020, 9:45 AM:
Edit: |
it's working properly now... i was able to diagnose things... just... make sure to NOT install nuget or mono-runtime, since they will foul everything up! it's safe to mark this problem as closed now... but I can re-open it if something else causes it... |
whenever i try running wsl-windows-toolbar as a user from within WSL2 bash prompt, it just sits there for a few seconds, then spits out this odd error:
user@XOTICPC:~$ wsl-windows-toolbar
Traceback (most recent call last):
File "/home/user/.local/bin/wsl-windows-toolbar", line 5, in
from wsl_windows_toolbar.wsl_windows_toolbar import cli
File "/home/user/.local/lib/python3.8/site-packages/wsl_windows_toolbar/wsl_windows_toolbar.py", line 26, in
WINDOWS_USERPROFILE = subprocess.check_output(
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmd.exe', '/C', 'echo', '%USERPROFILE%']' returned non-zero exit status 1.
I have no idea what would cause that. It used to happen on occasion, but rebooting my machine would usually fix it... what can I do to fix this odd behavior?
is it because my windows user profile has a space in it? (C:\Users\User Name\ instead of C:\Users\UserName, for example)...
The text was updated successfully, but these errors were encountered: