devcontainers / templates

Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own!
https://containers.dev/templates
MIT License
931 stars 242 forks source link

Python & Postgres template builds, but fails to start #85

Closed PAbernet closed 1 year ago

PAbernet commented 1 year ago

Best I can tell it tries to download the fre3shly built image from some registry, which unsurprisingly fails. I'm using version: '3.7' in the docker-compose.yml because '3.8' immediately fails. I assume my docker/docker-compose is too old.

[2022-12-13T15:28:37.882Z] Successfully built e0dfa4ed8671
[2022-12-13T15:28:38.836Z] Successfully tagged operations_devcontainer_app:latest
[2022-12-13T15:28:39.287Z] Stop (856181 ms): Run: docker-compose --project-name operations_devcontainer -f /home/pabernet/Code/operations/.devcontainer/docker-compose.yml -f /home/pabernet/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1670944463105.yml build --no-cache
[2022-12-13T15:28:39.290Z] Start: Run: docker inspect --type image operations_devcontainer_app
[2022-12-13T15:28:42.657Z] Stop (3367 ms): Run: docker inspect --type image operations_devcontainer_app
[2022-12-13T15:28:43.990Z] Error fetching image details: No manifest found for docker.io/library/operations_devcontainer_app.
[2022-12-13T15:28:43.990Z] Start: Run: docker pull operations_devcontainer_app
[2022-12-13T15:28:46.033Z] Using default tag: latest
[2022-12-13T15:28:46.708Z] Error response from daemon: pull access denied for operations_devcontainer_app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[2022-12-13T15:28:46.716Z] Stop (2726 ms): Run: docker pull operations_devcontainer_app
[2022-12-13T15:28:46.716Z] []
[2022-12-13T15:28:46.716Z] Error: No such image: operations_devcontainer_app

[2022-12-13T15:28:46.718Z] Error: Command failed: docker inspect --type image operations_devcontainer_app
[2022-12-13T15:28:46.718Z]     at loe (/home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1832:2820)
[2022-12-13T15:28:46.718Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-12-13T15:28:46.718Z]     at async Poe (/home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1899:2301)
[2022-12-13T15:28:46.719Z]     at async Zf (/home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1899:3278)
[2022-12-13T15:28:46.719Z]     at async aue (/home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:2020:15276)
[2022-12-13T15:28:46.719Z]     at async oue (/home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:2020:15030)
[2022-12-13T15:28:46.871Z] Stop (874977 ms): Run: /snap/code/114/usr/share/code/code --ms-enable-electron-run-as-node /home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/pabernet/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/pabernet/Code/operations --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/pabernet/Code/operations --log-level debug --log-format json --config /home/pabernet/Code/operations/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-12-13T15:28:46.872Z] Exit code 1
[2022-12-13T15:28:46.874Z] Command failed: /snap/code/114/usr/share/code/code --ms-enable-electron-run-as-node /home/pabernet/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/pabernet/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/pabernet/Code/operations --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/pabernet/Code/operations --log-level debug --log-format json --config /home/pabernet/Code/operations/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-12-13T15:28:46.874Z] Exit code 1
samruddhikhandale commented 1 year ago

I tried to open a Container with Python & Postgres template and it was successful.

- VS Code:  1.74.0 
- Dev Containers extension: v0.266.1
- MacOS:  13.0.1

Looking at your logs -

Error: No such image: operations_devcontainer_app

@PAbernet The Template's dockerfile mentions a python image. I wonder if you have accidentally modified that to operations_devcontainer_app?

PAbernet commented 1 year ago

Nope. FROM mcr.microsoft.com/devcontainers/python:0-3.9
When I manually run docker-compose build/up it works just fine. Only VSCode seems to have an issue with my setup.

samruddhikhandale commented 1 year ago

Could you provide me version details for the following? 👇

Also, could you provide your repro steps? If you could search for operations_devcontainer_app within your workspace, then that would be great.

PAbernet commented 1 year ago

From 'About VSCode':

Version: 1.74.0
Commit: 5235c6bb189b60b01b1f49062f4ffa42384f8c91
Date: 2022-12-05T16:47:18.476Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.14.0-1054-oem snap
Sandboxed: No

Repro steps:

  1. Create files from Python & Postgres template
  2. Change version string in docker-compose-yml to '3.7'. '3.8' fails immediately

The name operations_devcontainer_app is simply derived automatically. The repository/workspace I'm working in is named operations and the template uses app for the Python container.

samruddhikhandale commented 1 year ago

I still can not reproduce 😓 Comparing my logs with yours, I can see that the 👇 command either did not create the operations_devcontainer_app image or something deleted that.

docker-compose --project-name operations_devcontainer -f .... build --no-cache

In a terminal, can you check if this image exists with docker images ?

My successful log 👇 image

Also, can you paste your complete logs?

F1 > Dev Containers: Show Container Log

Also, I tried with docker-compose version 3.8 & 3.7. Works for both.

On another note, do you have Docker Compose installed? I believe it gets installed by default on Windows & Mac Docker Desktop but doesn't on Linux 🤔

PAbernet commented 1 year ago

Using docker-compose version 1.17.1, build unknown on the remote host, version 1.25.0 on the local machine. So that might be part of the reason.

Here's the entire log: remoteContainers-2022-12-14T18-46-22.464Z.log

samruddhikhandale commented 1 year ago

Found an issue which mentions this as a bug --> https://github.com/microsoft/vscode-remote-release/issues/7651

However, this is expected to be fixed with latest versions of Dev Containers Extension (0.266.1 and 0.267.0-pre-release)

@PAbernet can you help double check if you have latest extension? Else, feel free to re-open the issue ☝️

samruddhikhandale commented 1 year ago

Closing in favor of https://github.com/microsoft/vscode-remote-release/issues/7651

PAbernet commented 1 year ago

Thanks for you help, btw. I appreciate it.