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

"open folder in container" results in error "bad option: --ms-enable-electron-run-as-node" #202096

Closed
jstromergalley opened this issue Jan 9, 2024 · 13 comments
Assignees

Comments

@jstromergalley
Copy link

jstromergalley commented Jan 9, 2024

Type: Bug

  • Create a dockerfile as "FROM python:3" in a test folder.
  • open the folder is VSCode Insiders (windows)
  • now using the MS WSL extension choose "reopen in container"
  • select "from existing dockerfile"

log results:

C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe: bad option: --ms-enable-electron-run-as-node
Exit code 9

Note that all existing WSL based projects show similar results. This is just an example of how to reproduce. This also worked correctly prior to today's update.

VS Code version: Code - Insiders 1.86.0-insider (fb76955, 2024-01-09T09:57:14.563Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2592)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.77GB (7.20GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (41)
Extension Author (truncated) Version
armview ben 0.4.6
gotemplate cas 0.4.0
gitlens eam 14.6.1
go gol 0.40.1
vscode-graphql-syntax Gra 1.2.2
azure-pipelines ms- 1.228.0
azure-dev ms- 0.8.0
vscode-azureappservice ms- 0.25.1
vscode-azurecontainerapps ms- 0.6.1
vscode-azurefunctions ms- 1.13.1
vscode-azureresourcegroups ms- 0.8.3
vscode-azurestaticwebapps ms- 0.12.2
vscode-azurestorage ms- 0.15.3
vscode-azurevirtualmachines ms- 0.6.5
vscode-bicep ms- 0.24.24
vscode-cosmosdb ms- 0.20.0
vscode-docker ms- 1.28.0
csharp ms- 2.14.8
vscode-dotnet-runtime ms- 2.0.0
isort ms- 2023.11.13191009
python ms- 2023.23.13541005
vscode-pylance ms- 2023.12.1
jupyter ms- 2024.1.2024010901
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
remote-containers ms- 0.330.0
remote-ssh ms- 0.107.1
remote-ssh-edit ms- 0.86.0
remote-wsl ms- 0.81.8
vscode-remote-extensionpack ms- 0.25.0
azure-account ms- 0.11.6
azurecli ms- 0.5.0
live-server ms- 0.4.13
remote-explorer ms- 0.4.1
remote-server ms- 1.5.0
vscode-node-azure-pack ms- 1.2.0
azurerm-vscode-tools msa 0.15.11
LiveServer rit 5.7.9
jinja who 0.0.8
@jstromergalley jstromergalley changed the title WSL extension "open folder in container" results in error "ms-enable-electron-run-as-node" WSL extension "open folder in container" results in error "bad option: --ms-enable-electron-run-as-node" Jan 9, 2024
@jstromergalley
Copy link
Author

Full output:

[8572 ms] Dev Containers 0.330.0 in VS Code 1.86.0-insider (fb769554405bee9be16e21ceb0a496bd29126941).
[8571 ms] Start: Run: docker version --format {{json .}}
[8750 ms] {"Client":{"Platform":{"Name":""},"CloudIntegration":"v1.0.31","Version":"20.10.23","ApiVersion":"1.41","DefaultAPIVersion":"1.41","GitCommit":"7155243","GoVersion":"go1.18.10","Os":"windows","Arch":"amd64","BuildTime":"Thu Jan 19 17:43:10 2023","Context":"default","Experimental":true},"Server":{"Platform":{"Name":"Docker Desktop 4.17.1 (101757)"},"Components":[{"Name":"Engine","Version":"20.10.23","Details":{"ApiVersion":"1.41","Arch":"amd64","BuildTime":"Thu Jan 19 17:32:04 2023","Experimental":"false","GitCommit":"6051f14","GoVersion":"go1.18.10","KernelVersion":"5.15.133.1-microsoft-standard-WSL2","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"1.6.18","Details":{"GitCommit":"2456e983eb9e37e47538f59ea18f2043c9a73640"}},{"Name":"runc","Version":"1.1.4","Details":{"GitCommit":"v1.1.4-0-g5fd4c4d"}},{"Name":"docker-init","Version":"0.19.0","Details":{"GitCommit":"de40ad0"}}],"Version":"20.10.23","ApiVersion":"1.41","MinAPIVersion":"1.12","GitCommit":"6051f14","GoVersion":"go1.18.10","Os":"linux","Arch":"amd64","KernelVersion":"5.15.133.1-microsoft-standard-WSL2","BuildTime":"2023-01-19T17:32:04.000000000+00:00"}}
[16876 ms] Start: Run: C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe --ms-enable-electron-run-as-node c:\Users\jrstrome\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.330.0\dist\spec-node\devContainersSpecCLI.js templates apply --workspace-folder C:\Users\jrstrome\AppData\Local\Temp\tmp-output-dir-1704821043622 --template-id ghcr.io/devcontainers/templates/docker-existing-dockerfile:latest --template-args {} --features [] --tmp-dir C:\Users\jrstrome\AppData\Local\Temp\tmp-dir-1704821043622
[16918 ms] C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe: bad option: --ms-enable-electron-run-as-node
[16927 ms] Exit code 9

@dnshio
Copy link

dnshio commented Jan 9, 2024

The same is happening for me on OSX bad option: --ms-enable-electron-run-as-node

[127030 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[127076 ms] 1.43
[127108 ms] Start: Run: /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin) --ms-enable-electron-run-as-node /Users/dnshio/.vscode-insiders/extensions/ms-vscode-remote.remote-containers-0.329.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/dnshio/coolproject --log-level debug --log-format json --config /Users/dnshio/coolproject/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root
[127191 ms] /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin): bad option: --ms-enable-electron-run-as-node
[127193 ms] Exit code 9

I am not able to run any dev containers today as a result.

@jstromergalley
Copy link
Author

seems related to: fb76955

@aeschli
Copy link
Contributor

aeschli commented Jan 10, 2024

@deepak1556 I will remove '--ms-enable-electron-run-as-node' as option from the scripts in WSL, but it might be better to only show a warning, and not result in an error.

@aeschli aeschli assigned chrmarti and unassigned aeschli Jan 10, 2024
@aeschli
Copy link
Contributor

aeschli commented Jan 10, 2024

The WSL extension does not use ms-enable-electron-run-as-node. It's with dev containers...

@aeschli aeschli changed the title WSL extension "open folder in container" results in error "bad option: --ms-enable-electron-run-as-node" "open folder in container" results in error "bad option: --ms-enable-electron-run-as-node" Jan 10, 2024
@deepak1556
Copy link
Collaborator

/fixedWith https://github.com/microsoft/vscode-remote-containers/pull/714

Please try with the latest pre-release of the containers extension.

@chrmarti
Copy link
Contributor

Fixed in Dev Containers 0.331.0-pre-release.

@dnshio
Copy link

dnshio commented Jan 10, 2024

Thanks for the speedy fix! Upgrading Dev containers to the pre-release version (today) fixed the issue for me.

@jstromergalley
Copy link
Author

Dev Container v0.331.0 and Nightly VSCode update has resolved this for me as well.

@jochenvanwylick
Copy link

Had same issue - switching to pre-release version of extension also fixed it for me. Thx.

@bandinopla
Copy link

wow I almost lost a day of work due to this... started to fail from one moment to the other...
time to...

"update.enableWindowsBackgroundUpdates": false

never again.

@chrmarti
Copy link
Contributor

chrmarti commented Feb 2, 2024

@bandinopla Sorry to hear that, note that the setting you mention doesn't turn off automatic updates, it only changes how updates are applied on Windows. The setting to turn automatic updates for VS Code itself off is "update.mode": "none".

If you want to give the new version another try, make sure you also update the Dev Containers extension to its latest version. (This should have happened automatically, but automatic updates for extensions can also be turned off in the settings.)

@leewc
Copy link

leewc commented Feb 13, 2024

For anyone stumbling on this after applying an update, sometimes all you need to do is go to the extensions tab, check if 'reload required' for the extension exists, if so, click on it to reload VS Code. I ran into this issue after a recent sudo apt-get upgrade, and just need to reload VS code after this error came up, giving time for the extension to get up to date.

Get:2 https://packages.microsoft.com/repos/code stable/main amd64 code amd64 1.86.1-1707298119 [99.8 MB]
Preparing to unpack .../0-code_1.86.1-1707298119_amd64.deb ...

@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants