VSCode Torizon-Extension: C++ Remote Container fails with permission error

Good day,

today I tried to run some tests with an older C++ project of mine.
The problem is that the VSCode extension fails on opening the Remote Container.

This problem occures with old- (that already worked) and completely new projects.
The console output of a new project below.

82 ms] Dev Containers 0.262.3 in VS Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075).
[82 ms] Start: Resolving Remote
[156 ms] Setting up container for folder or workspace: /home/aig/workspace/TEMP/testapp
[169 ms] Start: Check Docker is running
[169 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[231 ms] Server API version: 1.41
[232 ms] Start: Run: docker volume ls -q
[299 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/home/aig/workspace/TEMP/testapp --filter label=vsch.quality=stable
[354 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/aig/workspace/TEMP/testapp
[426 ms] Start: Run: /usr/share/code/code --ms-enable-electron-run-as-node /home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/aig/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/aig/workspace/TEMP/testapp --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/aig/workspace/TEMP/testapp --log-level debug --log-format json --config /home/aig/workspace/TEMP/testapp/.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
[766 ms] (node:14328) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[772 ms] (Use `code --trace-deprecation ...` to show where the warning was created)
[780 ms] @devcontainers/cli 0.23.2. Node.js v16.14.2. linux 5.15.0-52-generic x64.
[779 ms] Start: Run: docker buildx version
[905 ms] github.com/docker/buildx v0.8.2-docker 6224def4dd2c3d347eee19db595348c50d7cb491
[905 ms] 
[905 ms] Start: Resolving Remote
[908 ms] Start: Run: git rev-parse --show-cdup
[917 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/aig/workspace/TEMP/testapp
[965 ms] Start: Run: docker inspect --type image testapp_arm64v8-debian-no-ssh_bullseye_debug_242ffd16-3159-4dd3-8534-53a636c62a0f_sdk_image
[1010 ms] local container features stored at: /home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/node_modules/vscode-dev-containers/container-features
[1012 ms] Start: Run: tar --no-same-owner -x -f -
[1042 ms] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-aig/container-features/0.23.2-1667895810044/Dockerfile-with-features -t vsc-testapp-9d8eaf8dda6852985bb9e6af1cff7daa --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /home/aig/workspace/TEMP/testapp/.devcontainer
[+] Building 1.1s (3/3) FINISHED                                                
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 1.97kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => ERROR [internal] load metadata for docker.io/library/testapp_arm64v8-  1.1s
------
 > [internal] load metadata for docker.io/library/testapp_arm64v8-debian-no-ssh_bullseye_debug_242ffd16-3159-4dd3-8534-53a636c62a0f_sdk_image:latest:
------
Dockerfile-with-features:10
--------------------
   8 |     # "Torizon: Rebuild SDK and reload in container"
   9 |     # after this operation you should be able to re-open your project inside a container
  10 | >>> FROM testapp_arm64v8-debian-no-ssh_bullseye_debug_242ffd16-3159-4dd3-8534-53a636c62a0f_sdk_image AS dev_container_auto_added_stage_label
  11 |     
  12 |     # add automake/autoconf to our base SDK container
--------------------
error: failed to solve: testapp_arm64v8-debian-no-ssh_bullseye_debug_242ffd16-3159-4dd3-8534-53a636c62a0f_sdk_image: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
[2455 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-aig/container-features/0.23.2-1667895810044/Dockerfile-with-features -t vsc-testapp-9d8eaf8dda6852985bb9e6af1cff7daa --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /home/aig/workspace/TEMP/testapp/.devcontainer
[2456 ms]     at doe (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1888:1635)
[2456 ms]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2456 ms]     at async pF (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:1973)
[2456 ms]     at async eT (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:901)
[2456 ms]     at async voe (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:2049)
[2456 ms]     at async Xf (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:3212)
[2456 ms]     at async Jae (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:15058)
[2456 ms]     at async Wae (/home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:14812)
[2466 ms] Exit code 1
[2472 ms] Command failed: /usr/share/code/code --ms-enable-electron-run-as-node /home/aig/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/aig/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/aig/workspace/TEMP/testapp --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/aig/workspace/TEMP/testapp --log-level debug --log-format json --config /home/aig/workspace/TEMP/testapp/.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
[2473 ms] Exit code 1

Versions: 6.1.40 r154048
VirtualBox VM:
VsCode: V1.72.2
Linux: Ubuntu 20.04.4 LTS
Toradex Extension: V1.5.1

Project:
C++/ CMake project

Best regards

Hi @aigF !

From the error, seems like the issue is authorization-related.

Could you please confirm that your VM has a healthy internet connection?

Also, did you perform docker login?

Best regards,

Hi @henrique.tx,

yes a proper internet connection exists.
I actually think I never had to perform a docker login command, since working with your extension.
I wouldn’t even have login credentials to be honest.

The curious part is i set up a completely new VM (Ubuntu 22.04) and it worked instantly.
The question is, what would detoriate my existing VM to have this problem.

best regards

1 Like

Hi @aigF ,

Glad that it works now.

As I see the previous VM was 20.04LTS. I assume that VM was not completely new right? You were working on the “old” projects on this VM 20.04LTS.
And at some point it stopped working. Right?

By the way, are you aware that Toradex is currently a completely new version of the Torizon extension called ApolloX.

You can give that a try, it has some neat new features and if you leave your feedback there we’ll try to implement that into the new extension.

Best Regards
Kevin