VSCode failed to build and open dev container over remote SSH

981 Views Asked by At

I use VSCode to build and open dev container in a remote Ubuntu server. VSCode failed to create the dev container.

The log shows that docker buildx failed to get build context dev_containers_feature_content_source as there is no such file or directory.

ERROR: failed to get build context dev_containers_feature_content_source: stat /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629: no such file or directory

However, the required directory is already exist in my remote server.

ls -lhd /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629
drwxrwxr-x 9 tuannv tuannv 4.0K Jul 25 02:17 /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629

ls -lhd /tmp/
drwxrwxrwt 130 root root 24K Jul 25 02:18 /tmp/

Here are more details:

VSCode Client:

Version: 1.80.1 (user setup)
Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771
Date: 2023-07-12T17:22:07.651Z
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.18362

Server side:

PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Remote container.log

[2023-07-25T02:17:39.720Z] Dev Containers 0.299.0 in VS Code 1.80.1 (74f6148eb9ea00507ec113ec51c489d6ffb4b771).
[2023-07-25T02:17:39.720Z] Start: Resolving Remote
[2023-07-25T02:17:39.772Z] Start: Run: ssh 172.16.32.73 /bin/sh
[2023-07-25T02:17:39.866Z] Start: Run in host: id -un
[2023-07-25T02:17:40.617Z] tuannv
[2023-07-25T02:17:40.618Z] 
[2023-07-25T02:17:40.618Z] Stop (752 ms): Run in host: id -un
[2023-07-25T02:17:40.618Z] Start: Run in host: cat /etc/passwd
[2023-07-25T02:17:40.629Z] Stop (11 ms): Run in host: cat /etc/passwd
[2023-07-25T02:17:40.629Z] Start: Run in host: echo ~
[2023-07-25T02:17:40.635Z] /home/tuannv
[2023-07-25T02:17:40.635Z] 
[2023-07-25T02:17:40.635Z] Stop (6 ms): Run in host: echo ~
[2023-07-25T02:17:40.636Z] Start: Run in host: test -x '/home/tuannv/.vscode-remote-containers/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node'
[2023-07-25T02:17:40.639Z] 
[2023-07-25T02:17:40.640Z] 
[2023-07-25T02:17:40.640Z] Exit code 1
[2023-07-25T02:17:40.640Z] Stop (4 ms): Run in host: test -x '/home/tuannv/.vscode-remote-containers/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node'
[2023-07-25T02:17:40.640Z] Start: Run in host: test -x '/home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node'
[2023-07-25T02:17:40.646Z] 
[2023-07-25T02:17:40.646Z] 
[2023-07-25T02:17:40.646Z] Stop (6 ms): Run in host: test -x '/home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node'
[2023-07-25T02:17:40.647Z] Start: Run in host: test -f '/home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node_modules/node-pty/package.json'
[2023-07-25T02:17:40.652Z] 
[2023-07-25T02:17:40.653Z] 
[2023-07-25T02:17:40.653Z] Stop (6 ms): Run in host: test -f '/home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node_modules/node-pty/package.json'
[2023-07-25T02:17:40.653Z] Start: Run in host: test -f '/home/tuannv/.vscode-remote-containers/dist/vscode-remote-containers-server-0.299.0.js'
[2023-07-25T02:17:40.657Z] 
[2023-07-25T02:17:40.657Z] 
[2023-07-25T02:17:40.657Z] Stop (4 ms): Run in host: test -f '/home/tuannv/.vscode-remote-containers/dist/vscode-remote-containers-server-0.299.0.js'
[2023-07-25T02:17:40.660Z] userEnvProbe: loginInteractiveShell (default)
[2023-07-25T02:17:40.660Z] userEnvProbe: not found in cache
[2023-07-25T02:17:40.661Z] userEnvProbe shell: /bin/bash
[2023-07-25T02:17:40.775Z] userEnvProbe PATHs:
Probe:     '/home/tuannv/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
Container: None
[2023-07-25T02:17:40.786Z] Setting up container for folder or workspace: /home/tuannv/blog
[2023-07-25T02:17:40.786Z] Host: ssh://172.16.32.73
[2023-07-25T02:17:40.788Z] Start: Run: wsl -l -v
[2023-07-25T02:17:40.862Z] Could not connect to WSL.
[2023-07-25T02:17:40.862Z] Exectuable 'wsl' not found on PATH 'C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\Program Files (x86)\NetSarang\Xshell 7\;C:\Program Files (x86)\NetSarang\Xftp 7\;C:\Users\VHT-tuannv\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\VHT-tuannv\AppData\Local\Programs\Python\Python311\;C:\Users\VHT-tuannv\AppData\Local\Microsoft\WindowsApps;;C:\Users\VHT-tuannv\AppData\Local\Programs\Microsoft VS Code\bin'.
[2023-07-25T02:17:40.866Z] Start: Check Docker is running
[2023-07-25T02:17:40.867Z] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[2023-07-25T02:17:40.962Z] Stop (95 ms): Run in Host: docker version --format {{.Server.APIVersion}}
[2023-07-25T02:17:40.963Z] Server API version: 1.41
[2023-07-25T02:17:40.963Z] Stop (97 ms): Check Docker is running
[2023-07-25T02:17:40.966Z] Start: Run in Host: docker volume ls -q
[2023-07-25T02:17:41.033Z] Stop (67 ms): Run in Host: docker volume ls -q
[2023-07-25T02:17:41.034Z] Start: Run in Host: docker ps -q -a --filter label=vsch.local.folder=/home/tuannv/blog --filter label=vsch.quality=stable
[2023-07-25T02:17:41.106Z] Stop (72 ms): Run in Host: docker ps -q -a --filter label=vsch.local.folder=/home/tuannv/blog --filter label=vsch.quality=stable
[2023-07-25T02:17:41.107Z] Start: Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog --filter label=devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json
[2023-07-25T02:17:41.170Z] Stop (63 ms): Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog --filter label=devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json
[2023-07-25T02:17:41.171Z] Start: Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog
[2023-07-25T02:17:41.236Z] Stop (65 ms): Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog
[2023-07-25T02:17:41.236Z] Start: Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog
[2023-07-25T02:17:41.302Z] Stop (66 ms): Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog
[2023-07-25T02:17:41.314Z] Start: Run in Host: /home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node /home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/tuannv/blog --id-label devcontainer.local_folder=/home/tuannv/blog --id-label devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/tuannv/blog/.devcontainer/devcontainer.json --mount-workspace-git-root true
[2023-07-25T02:17:41.756Z] @devcontainers/cli 0.46.0. Node.js v16.17.1. linux 5.15.0-76-generic x64.
[2023-07-25T02:17:41.756Z] Start: Run: git rev-parse --show-cdup
[2023-07-25T02:17:41.762Z] Stop (6 ms): Run: git rev-parse --show-cdup
[2023-07-25T02:17:41.763Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog --filter label=devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json
[2023-07-25T02:17:41.821Z] Stop (58 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog --filter label=devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json
[2023-07-25T02:17:41.906Z] Stop (592 ms): Run in Host: /home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node /home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/tuannv/blog --id-label devcontainer.local_folder=/home/tuannv/blog --id-label devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/tuannv/blog/.devcontainer/devcontainer.json --mount-workspace-git-root true
[2023-07-25T02:17:42.418Z] Start: Run in Host: /home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node /home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-e7998ce0-ddcd-4ba9-8b1d-b395a2f044af1690251457876 --workspace-folder /home/tuannv/blog --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/tuannv/blog --id-label devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/tuannv/blog/.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
[2023-07-25T02:17:42.881Z] @devcontainers/cli 0.46.0. Node.js v16.17.1. linux 5.15.0-76-generic x64.
[2023-07-25T02:17:42.881Z] Start: Run: docker buildx version
[2023-07-25T02:17:42.978Z] Stop (97 ms): Run: docker buildx version
[2023-07-25T02:17:42.978Z] github.com/docker/buildx v0.10.4 c513d34049e499c53468deac6c4267ee72948f02
[2023-07-25T02:17:42.978Z] 
[2023-07-25T02:17:42.978Z] Start: Resolving Remote
[2023-07-25T02:17:42.982Z] Start: Run: git rev-parse --show-cdup
[2023-07-25T02:17:42.985Z] Stop (3 ms): Run: git rev-parse --show-cdup
[2023-07-25T02:17:43.128Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog --filter label=devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json
[2023-07-25T02:17:43.223Z] Stop (95 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/tuannv/blog --filter label=devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json
[2023-07-25T02:17:43.226Z] Start: Run: docker inspect --type image mcr.microsoft.com/devcontainers/python:3.11-bullseye
[2023-07-25T02:17:43.281Z] Stop (55 ms): Run: docker inspect --type image mcr.microsoft.com/devcontainers/python:3.11-bullseye
[2023-07-25T02:17:44.632Z] local container features stored at: /home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/node_modules/vscode-dev-containers/container-features
[2023-07-25T02:17:44.636Z] Start: Run: tar --no-same-owner -x -f -
[2023-07-25T02:17:44.651Z] Stop (15 ms): Run: tar --no-same-owner -x -f -
[2023-07-25T02:17:44.661Z] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/common-utils:2'...
[2023-07-25T02:17:44.662Z] * Processing feature: ghcr.io/devcontainers/features/common-utils:2
[2023-07-25T02:17:45.156Z] Start: Run: docker-credential-secret get
[2023-07-25T02:17:45.159Z] Stop (3 ms): Run: docker-credential-secret get
[2023-07-25T02:17:45.162Z] Stop (6 ms): Run: docker-credential-secret get
[2023-07-25T02:17:46.428Z] Resolving Feature dependencies for 'ghcr.io/devcontainers-contrib/features/zsh-plugins:0'...
[2023-07-25T02:17:46.428Z] * Processing feature: ghcr.io/devcontainers-contrib/features/zsh-plugins:0
[2023-07-25T02:17:47.602Z] * Processing feature: ghcr.io/devcontainers/features/common-utils
[2023-07-25T02:17:48.499Z] * Processing feature: ghcr.io/devcontainers/features/git
[2023-07-25T02:17:49.378Z] Resolving Feature dependencies for 'ghcr.io/stuartleeks/dev-container-features/shell-history:0'...
[2023-07-25T02:17:49.379Z] * Processing feature: ghcr.io/stuartleeks/dev-container-features/shell-history:0
[2023-07-25T02:17:50.271Z] * Processing feature: ghcr.io/devcontainers/features/common-utils
[2023-07-25T02:17:51.170Z] * Processing feature: ghcr.io/meaningful-ooo/devcontainer-features/fish
[2023-07-25T02:17:52.056Z] Resolving Feature dependencies for 'ghcr.io/wxw-matt/devcontainer-features/command_runner:0'...
[2023-07-25T02:17:52.056Z] * Processing feature: ghcr.io/wxw-matt/devcontainer-features/command_runner:0
[2023-07-25T02:17:53.173Z] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/git:1'...
[2023-07-25T02:17:53.173Z] * Processing feature: ghcr.io/devcontainers/features/git:1
[2023-07-25T02:17:54.056Z] * Processing feature: ghcr.io/devcontainers/features/common-utils
[2023-07-25T02:17:54.924Z] Soft-dependency 'ghcr.io/meaningful-ooo/devcontainer-features/fish' is not required.  Removing from installation order...
[2023-07-25T02:17:54.927Z] * Fetching feature: common-utils_0_oci
[2023-07-25T02:17:55.447Z] * Fetching feature: command_runner_1_oci
[2023-07-25T02:17:55.960Z] * Fetching feature: git_2_oci
[2023-07-25T02:17:56.442Z] * Fetching feature: shell-history_3_oci
[2023-07-25T02:17:57.047Z] * Fetching feature: zsh-plugins_4_oci
[2023-07-25T02:17:57.544Z] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629/Dockerfile-with-features -t vsc-blog-8c910c57d0c75ec1e3b8b9866c07277bef90c9eac71fe858f9596eb2d7724cba --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/tuannv/blog
[2023-07-25T02:17:57.690Z] [+] Building 0.0s (0/0)                                                         
[2023-07-25T02:17:57.690Z] ERROR: failed to get build context dev_containers_feature_content_source: stat /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629: no such file or directory
[2023-07-25T02:17:57.694Z] Stop (150 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629/Dockerfile-with-features -t vsc-blog-8c910c57d0c75ec1e3b8b9866c07277bef90c9eac71fe858f9596eb2d7724cba --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/tuannv/blog
[2023-07-25T02:17:57.756Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629/Dockerfile-with-features -t vsc-blog-8c910c57d0c75ec1e3b8b9866c07277bef90c9eac71fe858f9596eb2d7724cba --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/tmp/devcontainercli-tuannv/container-features/0.46.0-1690251464629 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/tuannv/blog
[2023-07-25T02:17:57.756Z]     at Ute (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2008:1698)
[2023-07-25T02:17:57.756Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-07-25T02:17:57.756Z]     at async fC (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2007:1691)
[2023-07-25T02:17:57.756Z]     at async n3 (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2007:610)
[2023-07-25T02:17:57.756Z]     at async rre (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2024:3660)
[2023-07-25T02:17:57.756Z]     at async Yf (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2024:4775)
[2023-07-25T02:17:57.757Z]     at async Dne (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2156:12193)
[2023-07-25T02:17:57.757Z]     at async Sne (/home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js:2156:11934)
[2023-07-25T02:17:57.763Z] Stop (15345 ms): Run in Host: /home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node /home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-e7998ce0-ddcd-4ba9-8b1d-b395a2f044af1690251457876 --workspace-folder /home/tuannv/blog --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/tuannv/blog --id-label devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/tuannv/blog/.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
[2023-07-25T02:17:57.764Z] Exit code 1
[2023-07-25T02:17:57.768Z] Command failed: /home/tuannv/.vscode-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node /home/tuannv/.vscode-remote-containers/dist/dev-containers-cli-0.299.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-e7998ce0-ddcd-4ba9-8b1d-b395a2f044af1690251457876 --workspace-folder /home/tuannv/blog --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/tuannv/blog --id-label devcontainer.config_file=/home/tuannv/blog/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/tuannv/blog/.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
[2023-07-25T02:17:57.769Z] Exit code 1

I cannot figure out what happen with the docker buildx. It cannot open an existing directory.

0

There are 0 best solutions below