Closed ghost closed 1 year ago
I tried to open a dev container with the jekyll template and it was successful.
I wonder if the docker cache is interfering with the inspect?
On my local-machine, I cleared my cache (both page and RAM) and ran into the same error. Because local-machines can be fickle, I used a codespace as well; however, I still ran into the error.
Here is the creation-log:
=================================================================================
2023-02-24 07:05:57.840Z: Configuration starting...
2023-02-24 07:05:57.849Z: Cloning...
=======================
==========================================================
2023-02-24 07:05:57.873Z: Creating container...
2023-02-24 07:05:57.875Z: Cleaning up docker images...
2023-02-24 07:05:58.331Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/meg-io.github.io --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --user-data-folder /var/lib/docker/codespacemount/.persistedshare --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --log-level trace --log-format json --update-remote-user-uid-default never --mount-workspace-git-root false --skip-non-blocking-commands --skip-post-create --remove-existing-container --config "/var/lib/docker/codespacemount/workspace/meg-io.github.io/.devcontainer/devcontainer.json" --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe loginInteractiveShell --container-session-data-folder /workspaces/.codespaces/.persistedshare/devcontainers-cli/cache
2023-02-24 07:05:58.543Z: @devcontainers/cli 0.28.0. Node.js v14.21.2. linux 5.4.0-1103-azure x64.
2023-02-24 07:05:58.705Z: Error: Command failed: docker inspect --type image mcr.microsoft.com/devcontainers/jekyll:0-${templateOption:imageVariant}
2023-02-24 07:05:58.707Z: at fie (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:1915:1355)
2023-02-24 07:05:58.708Z: at P7 (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:1915:1291)
2023-02-24 07:05:58.710Z: at processTicksAndRejections (internal/process/task_queues.js:95:5)
2023-02-24 07:05:58.712Z: at async Fie (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:1921:2093)
2023-02-24 07:05:58.715Z: at async $f (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:1921:3239)
2023-02-24 07:05:58.717Z: at async eoe (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:2045:17247)
2023-02-24 07:05:58.719Z: at async Qse (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:2045:16993)
2023-02-24 07:05:58.722Z: {"outcome":"error","message":"Command failed: docker inspect --type image mcr.microsoft.com/devcontainers/jekyll:0-${templateOption:imageVariant}","description":"An error occurred setting up the container."}
2023-02-24 07:05:58.751Z: devcontainer process exited with exit code 1
====================================== ERROR ====================================
2023-02-24 07:05:58.765Z: Failed to create container.
=================================================================================
2023-02-24 07:05:58.770Z: Error: Command failed: docker inspect --type image mcr.microsoft.com/devcontainers/jekyll:0-${templateOption:imageVariant}
2023-02-24 07:05:58.773Z: Error Code: 1302
====================================== ERROR ====================================
2023-02-24 07:05:58.776Z: Container creation failed.
=================================================================================
It fails at the same point as it did on my local-machine (docker inspect). The error-point (async Qse) is consistent between rebuilds.
I’m assuming the error-code (1302) is a codespace-output since the process exited-1 and the error-json did not contain the error-code.
However, I could be wrong.
I won’t pretend to know why this may be happening. The build was successful on your end, and this error has not happened before.
Just for good measure I ported the most-recent Jekyll-devcontainer into a new repository, with a new codespace, and still got the same error.
@samruddhikhandale I will say though; the more I think about it, the more I think it’s an issue with the "2.7 bullseye" cross-compiler.
All of the boxes seem to be checked:
This is just speculation, since I have no idea what the source is doing, but it’s interesting to think about
2023-02-24 07:05:58.770Z: Error: Command failed: docker inspect --type image mcr.microsoft.com/devcontainers/jekyll:0-${templateOption:imageVariant}
Looks like you copied over the jekyll template instead of adding it from Add dev container configuration files...
command? that's the reason why it fails in a codespace as it has unresolved ${templateOption:imageVariant}
variable.
@meg-io can you create template using the command pallet and retry?
Yes, this solved the issue, I will mark it as closed. Thank you for the assistance.
The devcontainer worked recently, even with the unresolved variable, so I assumed it wasn’t causing the error. This is not the case; if you are in a similar situation, resolve the variable.
After checking the other four containers that were working, they all had the variable resolved - so the solution checks out. By code or by music, KISS reigns supreme.
Working solution (as per @samruddhikhandale):
Add dev container configuration files...
Full Rebuild
If you happen to be using the devcontainer outside of visual-studio, the configuration-file (devcontainer.json) can also be manually adjusted. Adjust
${templateOption:imageVariant}
to the desired option.
There is currently an error with the Jekyll-Container, where it fails to be fetched on "docker inspect —-type image…".
This seems to be due to a server-side error per, suggested by the point-of-error along with, the fact that four other containers are working on my machine.
P.S. I suspect it’s a URL-error. I just ran a lookup of both the Dotnet-URL and Jekyll-URL, the Dotnet responded and the Jekyll did not.