Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Rebuild container" fails if swapping from .devcontainer/devcontainer.json to .devcontainer.json or vice versa #10385

Open
chriscunningham-qodea opened this issue Oct 13, 2024 · 0 comments
Assignees
Labels
containers Issue in vscode-remote containers

Comments

@chriscunningham-qodea
Copy link

chriscunningham-qodea commented Oct 13, 2024

  • VSCode Version: Version: 1.94.2 (Universal) Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427

  • Local OS Version: MacOS 15.0.1 (24A348)

  • Remote OS Version: N/A

  • Remote Extension/Connection Type: Containers

  • Logs:

[2024-10-13T11:51:21.424Z] Running Dev Containers CLI:   up --user-data-folder /Users/chris/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-e6cb6722-385c-4e9b-9dad-9190d272358c1728820279349 --workspace-folder /Users/chris/Developer/work/cts/solution-vm-image-bakery --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/chris/Developer/work/cts/solution-vm-image-bakery --id-label devcontainer.config_file=/Users/chris/Developer/work/cts/solution-vm-image-bakery/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/chris/Developer/work/cts/solution-vm-image-bakery/.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 --include-configuration --include-merged-configuration
[2024-10-13T11:51:21.449Z] ProxyResolver#loadSystemCertificates count
[2024-10-13T11:51:21.450Z] ProxyResolver#loadSystemCertificates count filtered
[2024-10-13T11:51:21.450Z] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/chris/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-e6cb6722-385c-4e9b-9dad-9190d272358c1728820279349 --workspace-folder /Users/chris/Developer/work/cts/solution-vm-image-bakery --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/chris/Developer/work/cts/solution-vm-image-bakery --id-label devcontainer.config_file=/Users/chris/Developer/work/cts/solution-vm-image-bakery/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/chris/Developer/work/cts/solution-vm-image-bakery/.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 --include-configuration --include-merged-configuration
[2024-10-13T11:51:21.605Z] @devcontainers/cli 0.71.0. Node.js v20.16.0. darwin 24.0.0 arm64.
[2024-10-13T11:51:21.605Z] Start: Run: docker buildx version
[2024-10-13T11:51:22.472Z] Stop (867 ms): Run: docker buildx version
[2024-10-13T11:51:22.473Z] github.com/docker/buildx v0.6.3-docker 266c0eac611d64fcc0c72d80206aa364e826758d
[2024-10-13T11:51:22.473Z] 
[2024-10-13T11:51:22.473Z] Start: Run: docker -v
[2024-10-13T11:51:22.712Z] Stop (239 ms): Run: docker -v
[2024-10-13T11:51:22.712Z] Start: Resolving Remote
[2024-10-13T11:51:22.715Z] Error: Dev container config (/Users/chris/Developer/work/cts/solution-vm-image-bakery/.devcontainer/devcontainer.json) not found.
[2024-10-13T11:51:22.715Z]     at TtA (/Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:3225)
[2024-10-13T11:51:22.715Z]     at async iB (/Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:4963)
[2024-10-13T11:51:22.715Z]     at async wrA (/Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:663:203)
[2024-10-13T11:51:22.715Z]     at async DrA (/Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:662:14830)
[2024-10-13T11:51:22.715Z]     at async /Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:1190
[2024-10-13T11:51:22.718Z] Stop (1268 ms): Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/chris/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-e6cb6722-385c-4e9b-9dad-9190d272358c1728820279349 --workspace-folder /Users/chris/Developer/work/cts/solution-vm-image-bakery --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/chris/Developer/work/cts/solution-vm-image-bakery --id-label devcontainer.config_file=/Users/chris/Developer/work/cts/solution-vm-image-bakery/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/chris/Developer/work/cts/solution-vm-image-bakery/.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 --include-configuration --include-merged-configuration
[2024-10-13T11:51:22.718Z] Exit code 1
[2024-10-13T11:51:22.721Z] Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/chris/.vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/chris/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-e6cb6722-385c-4e9b-9dad-9190d272358c1728820279349 --workspace-folder /Users/chris/Developer/work/cts/solution-vm-image-bakery --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/chris/Developer/work/cts/solution-vm-image-bakery --id-label devcontainer.config_file=/Users/chris/Developer/work/cts/solution-vm-image-bakery/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/chris/Developer/work/cts/solution-vm-image-bakery/.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 --include-configuration --include-merged-configuration
[2024-10-13T11:51:22.721Z] Exit code 1

Steps to Reproduce:

  1. Open a project containing devcontainer configuration in (workspaceFolder)/.devcontainer/devcontainer.json.
  2. Decide that you don't need the subdirectory, and move the file to (workspaceFolder)/.devcontainer.json.
  3. Run the Dev Containers: Rebuild Container command.

Expected Result:

  • Container extension uses its usual heuristics to determine the location of the devcontainer configuration in the repo and rebuilds based on the discovered file.

Actual Result:

  • Container extension attempts to re-build using the existing config location, which no longer exists, and so errors out (see logs).

Current Workaround:

  • Reopen the repo locally.
  • Run Dev Containers: Rebuild and Reopen in Container.
  • Extension correctly scans for a config file path and builds as expected.
@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

2 participants