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