vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

An error occured setting up the container - Remote Docker

Open bakaleks opened this issue 2 years ago • 5 comments

Type: Bug

Hi. In the latest extension update I can't open remote Docker container. Getting this popup "An error occured setting up the container" immediately when I click on "Reopen in Container button". Here is output from the extension log:

[3315 ms] Remote-Containers 0.251.0 in VS Code 1.71.0 (784b0177c56c607789f9638da7b6bf3230d47a8c).
[3315 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[4390 ms] 1.41
[4415 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/user/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/user/remote_workspaces/repo/user1 --log-level debug --log-format json --config /Users/user/remote_workspaces/repo/user1/.devcontainer/devcontainer.json --mount-workspace-git-root true
[4635 ms] remote-containers 0.251.0.
[4635 ms] Start: Run: git rev-parse --show-cdup
[4656 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/user/remote_workspaces/repo/user1
[4735 ms] Command failed: docker ps -q -a --filter label=devcontainer.local_folder=/Users/user/remote_workspaces/repo/user1
[4741 ms] Exit code 1

Extension version: 0.251.0 VS Code version: Code 1.71.0 (Universal) (784b0177c56c607789f9638da7b6bf3230d47a8c, 2022-09-01T07:25:38.437Z) OS version: Darwin x64 21.6.0 Modes: Sandboxed: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz (4 x 3100)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 3, 3
Memory (System) 16.00GB (0.49GB free)
Process Argv --crash-reporter-id 68ec96f8-6abf-4e40-99f4-f584612269ab
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411cf:30557515
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
pylanb8912:30545647
vsclangdf:30486550
c4g48928:30535728
hb751961:30553087
dsvsc012cf:30540253
azure-dev_surveyone:30548225
i497e931:30553904

bakaleks avatar Sep 06 '22 11:09 bakaleks

In case it's helpful, I've run into the same problem this morning too. Similar output in my logs:

[2239 ms] Remote-Containers 0.251.0 in VS Code 1.71.0 (784b0177c56c607789f9638da7b6bf3230d47a8c).
[2238 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[4256 ms] 1.41
[4276 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/adamt/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/adamt/Development/torch-ssic --log-level debug --log-format json --config /Users/adamt/Development/torch-ssic/.devcontainer/devcontainer.json --mount-workspace-git-root true
[4393 ms] remote-containers 0.251.0.
[4393 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/adamt/Development/torch-ssic
[4475 ms] Command failed: docker ps -q -a --filter label=devcontainer.local_folder=/Users/adamt/Development/torch-ssic
[4476 ms] Exit code 1

adamtupper avatar Sep 06 '22 15:09 adamtupper

Downgrading to Remote-Containers 0.245.2 (still using VS Code 1.71.0) has temporarily fixed the problem for me.

adamtupper avatar Sep 06 '22 15:09 adamtupper

Does running docker ps -q -a --filter label=devcontainer.local_folder=/Users/user/remote_workspaces/repo/user1 in the terminal return a non-zero exit code? (You can check with echo $? right after running the above command.)

Is this the full log?

chrmarti avatar Sep 07 '22 06:09 chrmarti

Strange, I'm getting return code 0 regardless whether container with that label exists or not on the remote server. Yes it's a full log

bakaleks avatar Sep 07 '22 07:09 bakaleks

I have the same behavior with a docker rootless installation (0.245.2 works, 0.251.0 doesn't with the exact same log). The 0.251.0 works on another computer with docker as a non-root user.

The PATH for the rootless docker binary is located in $HOME/bin instead of /usr/local/bin, can it be the culprit ?

dkgs avatar Sep 21 '22 14:09 dkgs

@bakaleks Are you using Docker in rootless mode too?

@dkgs The path of the binary shouldn't make a difference. Just make sure the correct binary is on the PATH or set the Docker Path user setting for the Remote-Containers (currently being renamed to Dev Containers) extension to the full path of the Docker binary.

chrmarti avatar Oct 03 '22 13:10 chrmarti

@chrmarti Using via Remote Docker CLI https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host#_connect-using-the-docker-cli

bakaleks avatar Oct 03 '22 13:10 bakaleks

@bakaleks What's your Docker host setting?

chrmarti avatar Oct 06 '22 13:10 chrmarti

@chrmarti "docker.host":"ssh://myuserid@somehostname"

bakaleks avatar Oct 10 '22 07:10 bakaleks

@bakaleks What do you get for docker --host ssh://myuserid@somehostname version?

chrmarti avatar Oct 11 '22 08:10 chrmarti

@chrmarti it started working again in 0.255.2. Thanks.

bakaleks avatar Oct 11 '22 08:10 bakaleks

@adamtupper @dkgs Are you still seeing this with the latest version?

chrmarti avatar Oct 11 '22 08:10 chrmarti

Sorry for the delay! Unfortunately it's still not working for me. I receive this pop-up message:

Command 'Dev Containers: Reopen in Container' resulted in an error (Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/adamt/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.3/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/adamt/Development/torch-ssic --log-level debug --log-format json --config /Users/adamt/Development/torch-ssic/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root true)

The last working version for me is still 0.245.2

adamtupper avatar Oct 13 '22 13:10 adamtupper

I also am having this issue on the latest version and downgrading to 0.245.2 fixed it for me for now. I'm receiving a very similar error to @adamtupper but on Windows 10.

EvanMcEwen avatar Oct 27 '22 14:10 EvanMcEwen

This could be caused by the Docker daemon not responding (e.g., when it is not accepting connections yet after a restart) when using DOCKER_HOST.

chrmarti avatar Oct 28 '22 10:10 chrmarti

A downgrade to 0.245.2 fixed this is my case too.

tpataky avatar Nov 11 '22 16:11 tpataky

Updating Docker for Mac fixed the problem for me. Everything is now working with the latest versions of VS Code and the Dev Containers extension.

adamtupper avatar Nov 14 '22 18:11 adamtupper

Forked and pulled down the latest from container-apps-store-api-microservice and get this error message as soon as I fire up the devcontainer. VScode - image No changes have been made to the source prior to opening.

BC89 avatar Dec 19 '22 19:12 BC89

I also am having this issue on the latest version and downgrading to 0.245.2 fixed it for me for now. I'm receiving a very similar error to @adamtupper but on Windows 10.

How do you downgrade?

ch3njust1n avatar Jan 04 '23 15:01 ch3njust1n

@ch3njust1n to change the version of an extension, click the down arrow on the Uninstall button. This gives the option for installing a different version.

I have similar issue when trying to run a compose dev container. On an empty project, adding a dev container using vs code works, but when use the docker outside docker compose option, then I get the same error

Error: An error occurred setting up the container.
[2023-01-07T05:09:48.435Z]     at loe (/home/jesper/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1832:2820)
[2023-01-07T05:09:48.435Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

This works on

  • Mac M1 + docker desktop
  • Windows 11 + docker desktop
  • WSL + docker desktop

Does not work on

  • ubuntu on parallels on Mac M1
  • ubuntu on hyperV Windows 11

jkristia avatar Jan 07 '23 05:01 jkristia