microsoft / microsoft/vscode-remote-release
"Rebuild container" fails if swapping from `.devcontainer/devcontainer.json` to `.devcontainer.json` or vice versa
Open
@chrmarti is already working on this.
Since Oct 13, 2024.
bug
containers
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
-
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:
- Open a project containing devcontainer configuration in
(workspaceFolder)/.devcontainer/devcontainer.json. - Decide that you don't need the subdirectory, and move the file to
(workspaceFolder)/.devcontainer.json. - Run the
Dev Containers: Rebuild Containercommand.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.