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

SSH + Containers fails: TypeError: Cannot read properties of undefined

Open lodo1995 opened this issue 2 years ago • 10 comments

Summary

When I am developing in a remote folder with Remote-SSH, I create a Dockerfile in that folder, install Remote-Containers and try to re-open that folder in a container based on that Dockerfile, VSCode fails, producing a log (attached below) with the error in the title.

System Information

  • VSCode Version: 1.68.1
  • Local OS Version: Windows 10
  • Remote OS Version: Ubuntu 20.04
  • Remote Extension/Connection Type: SSH + Containers

Steps to Reproduce:

  1. Open a remote folder with Remote-SSH
  2. Create Dockerfile, containing only FROM ubuntu:20.04
  3. Enable Remote-Containers
  4. Use Remote-Containers command to re-open folder in a container from local Dockerfile

Log

Remote machine IP address replaced with string <IP> Username replaced with string <USER> Remote folder replaced with string <WORKDIR>

[2022-06-22T09:15:04.022Z] Remote-Containers 0.238.2 in VS Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630).
[2022-06-22T09:15:04.022Z] Start: Resolving Remote
[2022-06-22T09:15:04.046Z] Start: Run: ssh <IP> /bin/sh
[2022-06-22T09:15:04.067Z] Start: Run in host: id -un
[2022-06-22T09:15:04.697Z] <USER>
[2022-06-22T09:15:04.698Z] 
[2022-06-22T09:15:04.698Z] Stop (631 ms): Run in host: id -un
[2022-06-22T09:15:04.699Z] Start: Run in host: cat /etc/passwd
[2022-06-22T09:15:04.706Z] Stop (7 ms): Run in host: cat /etc/passwd
[2022-06-22T09:15:04.707Z] Start: Run in host: echo ~
[2022-06-22T09:15:04.713Z] /home/<USER>
[2022-06-22T09:15:04.714Z] 
[2022-06-22T09:15:04.714Z] Stop (7 ms): Run in host: echo ~
[2022-06-22T09:15:04.715Z] Start: Run in host: test -x '/home/<USER>/.vscode-remote-containers/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node'
[2022-06-22T09:15:04.722Z] 
[2022-06-22T09:15:04.723Z] 
[2022-06-22T09:15:04.723Z] Exit code 1
[2022-06-22T09:15:04.723Z] Stop (8 ms): Run in host: test -x '/home/<USER>/.vscode-remote-containers/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node'
[2022-06-22T09:15:04.724Z] Start: Run in host: test -x '/home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node'
[2022-06-22T09:15:04.729Z] 
[2022-06-22T09:15:04.730Z] 
[2022-06-22T09:15:04.730Z] Stop (6 ms): Run in host: test -x '/home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node'
[2022-06-22T09:15:04.730Z] Start: Run in host: test -f '/home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node_modules/node-pty/package.json'
[2022-06-22T09:15:04.735Z] 
[2022-06-22T09:15:04.736Z] 
[2022-06-22T09:15:04.736Z] Stop (6 ms): Run in host: test -f '/home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node_modules/node-pty/package.json'
[2022-06-22T09:15:04.736Z] Start: Run in host: test -f '/home/<USER>/.vscode-remote-containers/dist/vscode-remote-containers-server-0.238.2.js'
[2022-06-22T09:15:04.742Z] 
[2022-06-22T09:15:04.742Z] 
[2022-06-22T09:15:04.742Z] Stop (6 ms): Run in host: test -f '/home/<USER>/.vscode-remote-containers/dist/vscode-remote-containers-server-0.238.2.js'
[2022-06-22T09:15:04.748Z] userEnvProbe: loginInteractiveShell (default)
[2022-06-22T09:15:04.748Z] userEnvProbe shell: /bin/bash
[2022-06-22T09:15:04.935Z] userEnvProbe PATHs:
Probe:     '/home/<USER>/.local/bin:/opt/miniconda/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
Container: None
[2022-06-22T09:15:04.942Z] Setting up container for folder or workspace: /data/<WORKDIR>
[2022-06-22T09:15:04.943Z] Host: ssh://<IP>
[2022-06-22T09:15:04.945Z] Start: Check Docker is running
[2022-06-22T09:15:04.946Z] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[2022-06-22T09:15:05.002Z] Stop (56 ms): Run in Host: docker version --format {{.Server.APIVersion}}
[2022-06-22T09:15:05.002Z] Server API version: 1.41
[2022-06-22T09:15:05.002Z] Stop (57 ms): Check Docker is running
[2022-06-22T09:15:05.003Z] Start: Run in Host: docker volume ls -q
[2022-06-22T09:15:05.045Z] Stop (42 ms): Run in Host: docker volume ls -q
[2022-06-22T09:15:05.072Z] Start: Run in Host: docker ps -q -a --filter label=vsch.local.folder=/data/<WORKDIR> --filter label=vsch.quality=stable
[2022-06-22T09:15:05.115Z] Stop (43 ms): Run in Host: docker ps -q -a --filter label=vsch.local.folder=/data/<WORKDIR> --filter label=vsch.quality=stable
[2022-06-22T09:15:05.116Z] Start: Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/data/<WORKDIR>
[2022-06-22T09:15:05.158Z] Stop (42 ms): Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/data/<WORKDIR>
[2022-06-22T09:15:05.172Z] Start: Run in Host: /home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node /home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /data/<WORKDIR> --workspace-mount-consistency cached --id-label devcontainer.local_folder=/data/<WORKDIR> --log-level debug --log-format json --config /data/<WORKDIR>/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-06-22T09:15:04.897Z] remote-containers 0.238.2.
[2022-06-22T09:15:04.897Z] Start: Run: docker buildx version
[2022-06-22T09:15:04.977Z] Stop (80 ms): Run: docker buildx version
[2022-06-22T09:15:04.977Z] Start: Resolving Remote
[2022-06-22T09:15:04.980Z] Start: Run: git rev-parse --show-cdup
[2022-06-22T09:15:04.982Z] Stop (2 ms): Run: git rev-parse --show-cdup
[2022-06-22T09:15:04.983Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/data/<WORKDIR>
[2022-06-22T09:15:05.019Z] Stop (36 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/data/<WORKDIR>
[2022-06-22T09:15:05.421Z] TypeError: Cannot read properties of undefined (reading 'groups')
[2022-06-22T09:15:05.421Z]     at ja (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:543)
[2022-06-22T09:15:05.421Z]     at jR (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:2570)
[2022-06-22T09:15:05.421Z]     at async Uu (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:2142)
[2022-06-22T09:15:05.421Z]     at async Jy (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:1168)
[2022-06-22T09:15:05.421Z]     at async zR (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:2006)
[2022-06-22T09:15:05.421Z]     at async nb (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:3110)
[2022-06-22T09:15:05.421Z]     at async JR (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:13046)
[2022-06-22T09:15:05.421Z]     at async KR (/home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:12802)
[2022-06-22T09:15:05.423Z] Stop (251 ms): Run in Host: /home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node /home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /data/<WORKDIR> --workspace-mount-consistency cached --id-label devcontainer.local_folder=/data/<WORKDIR> --log-level debug --log-format json --config /data/<WORKDIR>/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-06-22T09:15:05.424Z] Exit code 1
[2022-06-22T09:15:05.427Z] Command failed: /home/<USER>/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node /home/<USER>/.vscode-remote-containers/dist/dev-containers-cli-0.238.2/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /data/<WORKDIR> --workspace-mount-consistency cached --id-label devcontainer.local_folder=/data/<WORKDIR> --log-level debug --log-format json --config /data/<WORKDIR>/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-06-22T09:15:05.427Z] Exit code 1

lodo1995 avatar Jun 22 '22 09:06 lodo1995

Did you solve this?

ciricc avatar Jun 30 '22 15:06 ciricc

Did you solve this?

No, I just gave up on this particular setup. I ended up not needing containers after all.

lodo1995 avatar Jun 30 '22 18:06 lodo1995

I experienced the same error with VSCode Version 1.68.1 and Remote-Containers extension versions 0.238.2 and 0.238.3. Downgrading the extension to version 0.234.0 solved the issue for me.

mikkelkh avatar Jul 04 '22 09:07 mikkelkh

I experienced the same error with VSCode Version 1.68.1 and Remote-Containers extension versions 0.238.2 and 0.238.3. Downgrading the extension to version 0.234.0 solved the issue for me.

Same with insiders 1.69, downgrade of extension worked.

natrad100 avatar Jul 05 '22 00:07 natrad100

Could you append your Dockerfile?

chrmarti avatar Jul 05 '22 07:07 chrmarti

@chrmarti as I wrote in the original post, it is sufficient to use a Dockerfile with only FROM ubuntu:20.04 to trigger the issue.

lodo1995 avatar Jul 05 '22 08:07 lodo1995

I have encountered this problem when using just the Remote Containers extension (no SSH). In every case, I've found that the corresponding Dockerfile had a lowercase from directive and changing that to FROM fixed it.

bencwallace avatar Aug 23 '22 19:08 bencwallace

For us, the Dockerfile is using BuildKit FrontEnd #syntax=.

jbrwilkinson avatar Aug 24 '22 18:08 jbrwilkinson

Same as @jbrwilkinson. This is fixed when buildkit is enabled globally: docs.

abid-mujtaba avatar Sep 18 '22 13:09 abid-mujtaba

De æpøæl må mææä hun

søn. 18. sep. 2022 15.06 skrev Abid H. Mujtaba @.***>:

Same as @jbrwilkinson https://github.com/jbrwilkinson. This is fixed when buildkit is enabled globally: docs https://docs.docker.com/develop/develop-images/build_enhancements/#to-enable-buildkit-builds .

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-remote-release/issues/6850#issuecomment-1250267346, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACN6ZRIA3IIU6MQ5HLEULSDV64HVLANCNFSM5ZPROW2A . You are receiving this because you commented.Message ID: @.***>

mikkelkh avatar Sep 18 '22 13:09 mikkelkh

I have encountered this problem when using just the Remote Containers extension (no SSH). In every case, I've found that the corresponding Dockerfile had a lowercase from directive and changing that to FROM fixed it.

This worked for me as well

jkbowle avatar Jan 09 '23 15:01 jkbowle

This is happening to me as well, the workaround here is to manually 'docker-compose up' before opening in the dev container.


[1682 ms] TypeError: Cannot read properties of undefined (reading 'groups')
[1683 ms]     at Ym (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:1874:16436)
[1683 ms]     at DD (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:1894:4619)
[1683 ms]     at async kse (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:1912:2381)
[1683 ms]     at async _se (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:1894:3170)
[1683 ms]     at async Yse (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:1961:2799)
[1683 ms]     at async vh (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:1961:3741)
[1684 ms]     at async Eae (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:2092:10371)
[1684 ms]     at async gae (/home/jason/.vscode-remote-containers/dist/dev-containers-cli-0.293.0/dist/spec-node/devContainersSpecCLI.js:2092:10112)
[1685 ms] Exit code 1

JasonDictos avatar May 04 '23 22:05 JasonDictos

I found another workaround, just use the pre-init command to 'up' ;)

e.g.

  "initializeCommand": "docker compose up -d",

JasonDictos avatar May 05 '23 01:05 JasonDictos

Fixed in Dev Containers extensions 0.300.0-pre-release.

chrmarti avatar Jul 06 '23 12:07 chrmarti

I receive an error when I remote-SSH Windows->Windows (localhost) and try adding a dev container configuration there: Error dialog saying there's a path problem

If I add the Dockerfile locally first, and then remote-SSH Windows->Windows (localhost), and then try to reopen the folder in a container, I also get a path not found error:

Error dialog saying the path's not found

I'm guessing I need to remote-SSH onto a Linux remote instead?

rzhao271 avatar Jul 26 '23 21:07 rzhao271