Skip to content
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

Enhance WSLENV to ignore translation failures when running Win32 commands from WSL #3725

Open
andrewluotechnologies opened this issue Dec 22, 2018 · 5 comments

Comments

@andrewluotechnologies
Copy link

andrewluotechnologies commented Dec 22, 2018

If I run the command WSLENV='PATH/l' cmd.exe /c echo hello from WSL, I get a bunch of errors printed out on stderr:

<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /usr/local/sbin
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /usr/local/bin
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /usr/sbin
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /usr/bin
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /sbin
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /bin
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /usr/games
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /usr/local/games
<3>init: (13347) ERROR: UtilTranslatePathList:2021: Failed to translate /snap/bin

It would be nice to be able to disable these. For example, if we could add a /i option to WSLENV, such that if you use WSLENV='PATH/li' it would suppress those error messages. Either that or another environment variable.

Redirecting stderr is not an option because the Win32 program we call may be printing meaningful information on stderr.

For a single program this is a minor annoyance, but if you are calling a lot of programs in a script (for example a Makefile) you will get this for every Win32 program you call, resulting in a huge amount of output. It also interferes with programmatically parsing stderr in bash scripts (of course we can workaround this but it's not ideal)
Details of my environment:

uname -a

Linux DESKTOP 4.4.0-17763-Microsoft #194-Microsoft Mon Dec 03 17:58:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

ver

Microsoft Windows [Version 10.0.17763.195]

@szm1
Copy link

szm1 commented May 16, 2019

Yes, please implement this as it makes using any windows executables from WSL unbearable!

@benhillis
Copy link
Member

benhillis commented May 16, 2019

Good suggestion, I'll take a look at this. Can probably just suppress these errors in the interop case.

@PavelSosin-320
Copy link

This issue prevents my Ubuntu WSL2 from starting. I would like to use some stuff available cross-distro to avoid the building of self-containing packages for every type of distro. I'm looking at the calendar at my screen's right bottom corner and see 20/02/2021. May I hope for a solution?

@surabibio
Copy link

It is Sept 2021 and still problem persists

@xxmathias
Copy link

xxmathias commented Jun 16, 2022

i'm getting this error when i launch Ubuntu:

<3>init: (203) ERROR: UtilTranslatePathList:2732: Failed to translate somepath

ver

Microsoft Windows [Version 10.0.22621.160]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants