Vscode-remote-release: uv_pipe_open error when starting code-insiders from WSL

Created on 16 Sep 2019  路  15Comments  路  Source: microsoft/vscode-remote-release

Issue Type: Bug

Running code-insiders . from WSL does start VSCode but also displays the following error:

net.js:282
    err = this._handle.open(fd);
                       ^

Error: EINVAL: invalid argument, uv_pipe_open
    at new Socket (net.js:282:24)
    at createWritableStdioStream (internal/process/stdio.js:179:18)
    at process.getStderr [as stderr] (internal/process/stdio.js:40:14)
    at Object.get (internal/console/constructor.js:158:40)
    at Object.Console.<computed> (internal/console/constructor.js:276:46)
    at Object.warn (internal/console/constructor.js:287:61)
    at writeOut (internal/process/warning.js:27:3)
    at process.onWarning (internal/process/warning.js:79:3)
    at process.emit (events.js:205:15)
    at internal/process/warning.js:52:24
    at processTicksAndRejections (internal/process/task_queues.js:82:9) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'uv_pipe_open'
}

VS Code version: Code - Insiders 1.39.0-insider (d157c2e941cae17acb79bf26a70bbfad732bdc83, 2019-09-16T06:06:10.647Z)
OS version: Windows_NT x64 10.0.18362


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|15.93GB (7.64GB free)|
|Process Argv|.|
|Screen Reader|no|
|VM|0%|

Extensions (7)

Extension|Author (truncated)|Version
---|---|---
vscode-docker|ms-|0.8.1
remote-containers|ms-|0.76.0
remote-ssh|ms-|0.46.0
remote-ssh-edit|ms-|0.46.0
remote-ssh-explorer|ms-|0.46.0
remote-wsl|ms-|0.39.5
vscode-remote-extensionpack|ms-|0.17.0


bug verified wsl

All 15 comments

On what distro do you run?

Can you do a which code-insiders?

Also run code-insiders --verbose, maybe that gives more information.

On what distro do you run?

Ubuntu 18.04

Can you do a which code-insiders?

$ which code-insiders
/c/Users/phili/AppData/Local/Programs/Microsoft VS Code Insiders/bin/code-insiders

Also run code-insiders --verbose, maybe that gives more information.

$ code-insiders --verbose
net.js:282
    err = this._handle.open(fd);
                       ^

Error: EINVAL: invalid argument, uv_pipe_open
    at new Socket (net.js:282:24)
    at createWritableStdioStream (internal/process/stdio.js:179:18)
    at process.getStderr [as stderr] (internal/process/stdio.js:40:14)
    at Object.get (internal/console/constructor.js:158:40)
    at Object.Console.<computed> (internal/console/constructor.js:276:46)
    at Object.warn (internal/console/constructor.js:287:61)
    at writeOut (internal/process/warning.js:27:3)
    at process.onWarning (internal/process/warning.js:79:3)
    at process.emit (events.js:205:15)
    at internal/process/warning.js:52:24
    at processTicksAndRejections (internal/process/task_queues.js:82:9) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'uv_pipe_open'
}

[main 2019-09-16T12:02:14.677Z] Sending some foreground love to the running instance: 17020
                                                                                           [main 2019-09-16T12:02:14.694Z] Sending env to running instance...
                                              [main 2019-09-16T12:02:14.902Z] Sent env to running instance. Terminating...
           [main 2019-09-16T12:02:14.902Z] Lifecycle#kill()

I've also noticed that opening VSCode from WSL this way has stopping it establishing the remote WSL connection.

I can reproduce as well. It happens when the code.sh calls the windows vscode app to get the location of the wsl extension:
WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV ELECTRON_RUN_AS_NODE=1 "/mnt/c/Users/ae/AppData/Local/Programs/Microsoft VS Code Insiders/Code - Insiders.exe" "C:/Users/ae/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/cli.js" --locate-extension ms-vscode-remote.remote-wsl
It's likely an underlying WSL issue, but it worked until just recently. @bpasero You also mentioned this be related to the Electron update?

Thanks, @aeschli. Sorry that I created the issue in the wrong place :)

I verified that with VSCode 1.39.0-insider b7a5b7cf39 things still work.
VSCode 1.39.0-insider c3a4092c32 (unpublished) failes.

To clarify: the Electron update brought a node.js update from 10.11.0 to 12.4.0. Both client and server use this node.js version now.

I created https://github.com/microsoft/WSL/issues/4511 against WSL.
Looks like a long standing WSL1 issue on how pipes are set up that can also be seen when using the nodejs executable in a command substitution ($(..node.exe ..)). It looks we were lucky before that Electron covered the problem, but after the update it behaves like node.

I found a workaround that is not too ugly. Hope it works on all the various setups.

@aeschli , I am experiencing the same problem. Would you mind sharing your workaround?

@kwuite It is this commit: https://github.com/microsoft/vscode/commit/945d678d361270dd3ebfc68ad5efffa245ed52ea

It made it into today's Insider release of VS Code but the error output is still appearing (unless you hack the script to send that to /dev/null).

If you look at the file referenced by which code-insiders, you can see if your copy has been updated to match the contents of that commit. If you find it difficult to compare the commit diff with your file, you can look at the version of the file in the commit at this URL: https://github.com/microsoft/vscode/blob/945d678d361270dd3ebfc68ad5efffa245ed52ea/resources/win32/bin/code.sh

Yes, I can confirm that code-insiders . works as of the newest release (i.e. it again connects to WSL), but the error is still printed.

Seems like the pipe error still printed disappeared with the latest release from today. Thanks!

Thanks for reporting. The window that opens should be a Remote-WSL window. If not then we still have a bug.

Yes, I can confirm that VS Code Insiders opens up and is connected to WSL after code-insiders . - no pipe error.

Was this page helpful?
0 / 5 - 0 ratings