Repository navigation
Fresh clone won't successfully build dev container #83
Copy link
Copy link
Description
Activity
- added a commit that references this issue
on Mar 12, 2023 - linked a pull request that will close this issuefix: broken isort in docker build #85
on Mar 12, 2023 dciborow commented
on Mar 12, 2023 ContributorMore actionsthanks for catching this. I will add back in the .pre-commit-config.
- linked a pull request that will close this issuechore: enable precommit hooks in container #90
on Mar 12, 2023 I have the exact same problem, also after applying the fix in #90.
Any ideas?
Logs:
[7 ms] Dev Containers 0.321.0 in VS Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e). [7 ms] Start: Resolving Remote [15 ms] Setting up container for folder or workspace: /home/stef/proj/test-template-2 [69 ms] Start: Check Docker is running [70 ms] Start: Run: docker version --format {{.Server.APIVersion}} [86 ms] Server API version: 1.43 [87 ms] Start: Run: docker volume ls -q [97 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/home/stef/proj/test-template-2 --filter label=vsch.quality=stable [108 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/stef/proj/test-template-2 --filter label=devcontainer.config_file=/home/stef/proj/test-template-2/.devcontainer/devcontainer.json [119 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/stef/proj/test-template-2 [130 ms] Start: Run: /usr/share/code/code --ms-enable-electron-run-as-node /home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/stef/proj/test-template-2 --id-label devcontainer.local_folder=/home/stef/proj/test-template-2 --id-label devcontainer.config_file=/home/stef/proj/test-template-2/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/stef/proj/test-template-2/.devcontainer/devcontainer.json --mount-workspace-git-root [262 ms] @devcontainers/cli 0.52.1. Node.js v18.15.0. linux 6.6.2-201.fc39.x86_64 x64. [262 ms] Start: Run: git rev-parse --show-cdup [268 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/stef/proj/test-template-2 --filter label=devcontainer.config_file=/home/stef/proj/test-template-2/.devcontainer/devcontainer.json [282 ms] Start: Run: /usr/share/code/code --ms-enable-electron-run-as-node /home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/stef/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-cc111ff0-570b-404c-a6cf-dafd853ce0581701374112969 --workspace-folder /home/stef/proj/test-template-2 --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/stef/proj/test-template-2 --id-label devcontainer.config_file=/home/stef/proj/test-template-2/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/stef/proj/test-template-2/.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 [413 ms] @devcontainers/cli 0.52.1. Node.js v18.15.0. linux 6.6.2-201.fc39.x86_64 x64. [413 ms] Start: Run: docker buildx version [455 ms] github.com/docker/buildx v0.11.2 9872040 [455 ms] [455 ms] Start: Resolving Remote [457 ms] Start: Run: git rev-parse --show-cdup [506 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/stef/proj/test-template-2 --filter label=devcontainer.config_file=/home/stef/proj/test-template-2/.devcontainer/devcontainer.json [519 ms] Start: Run: docker inspect --type image mcr.microsoft.com/devcontainers/python:3 [847 ms] local container features stored at: /home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/node_modules/vscode-dev-containers/container-features [847 ms] Start: Run: tar --no-same-owner -x -f - [856 ms] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-stef/container-features/0.52.1-1701374114102/Dockerfile-with-features -t vsc-test-template-2-60f06196c0293bb6c958939cdcefef70d20bc269d1767afdad11ea7e5399ffe5 --target dev_containers_target_stage --no-cache --pull --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /home/stef/proj/test-template-2 [+] Building 35.9s (10/10) FINISHED docker:default => [internal] load build definition from Dockerfile-with-features 0.1s => => transferring dockerfile: 2.04kB 0.0s => [internal] load .dockerignore 0.1s => => transferring context: 2B 0.0s => [internal] load metadata for mcr.microsoft.com/devcontainers/python:3 0.1s => CACHED [dev_container_auto_added_stage_label 1/6] FROM mcr.microsoft. 0.0s => [internal] load build context 0.0s => => transferring context: 197B 0.0s => [dev_container_auto_added_stage_label 2/6] RUN python -m pip install 3.0s => [dev_container_auto_added_stage_label 3/6] COPY pyproject.toml . 0.1s => [dev_container_auto_added_stage_label 4/6] RUN touch README.md & 10.7s => [dev_container_auto_added_stage_label 5/6] COPY .pre-commit-config.ya 0.1s => ERROR [dev_container_auto_added_stage_label 6/6] RUN git init . && p 21.5s ------ > [dev_container_auto_added_stage_label 6/6] RUN git init . && pre-commit install-hooks: 0.298 hint: Using 'master' as the name for the initial branch. This default branch name 0.298 hint: is subject to change. To configure the initial branch name to use in all 0.298 hint: of your new repositories, which will suppress this warning, call: 0.298 hint: 0.298 hint: git config --global init.defaultBranch <name> 0.298 hint: 0.298 hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and 0.298 hint: 'development'. The just-created branch can be renamed via this command: 0.298 hint: 0.298 hint: git branch -m <name> 0.298 Initialized empty Git repository in /.git/ 0.438 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. 1.119 [INFO] Initializing environment for https://github.com/PyCQA/isort. 2.031 [INFO] Initializing environment for https://github.com/asottile/pyupgrade. 2.716 [INFO] Initializing environment for https://github.com/hadialqattan/pycln. 3.346 [INFO] Initializing environment for https://github.com/codespell-project/codespell. 4.053 [INFO] Initializing environment for https://github.com/pre-commit/pygrep-hooks. 4.682 [INFO] Initializing environment for https://github.com/mgedmin/check-manifest. 5.268 [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. 5.268 [INFO] Once installed this environment will be reused. 5.268 [INFO] This may take a few minutes... 7.729 [INFO] Installing environment for https://github.com/PyCQA/isort. 7.729 [INFO] Once installed this environment will be reused. 7.729 [INFO] This may take a few minutes... 9.392 [INFO] Installing environment for https://github.com/asottile/pyupgrade. 9.392 [INFO] Once installed this environment will be reused. 9.392 [INFO] This may take a few minutes... 11.55 [INFO] Installing environment for https://github.com/hadialqattan/pycln. 11.55 [INFO] Once installed this environment will be reused. 11.55 [INFO] This may take a few minutes... 21.46 An unexpected error has occurred: CalledProcessError: command: ('/root/.cache/pre-commit/repo4w1q9rkv/py_env-python3/bin/python', '-mpip', 'install', '.') 21.46 return code: 1 21.46 stdout: 21.46 Processing /root/.cache/pre-commit/repo4w1q9rkv 21.46 Installing build dependencies: started 21.46 Installing build dependencies: finished with status 'done' 21.46 Getting requirements to build wheel: started 21.46 Getting requirements to build wheel: finished with status 'done' 21.46 Preparing metadata (pyproject.toml): started 21.46 Preparing metadata (pyproject.toml): finished with status 'done' 21.46 Collecting libcst<0.4.0,>=0.3.10 (from pycln==1.2.5) 21.46 Downloading libcst-0.3.23-py3-none-any.whl (517 kB) 21.46 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 517.4/517.4 kB 18.1 MB/s eta 0:00:00 21.46 Collecting pathspec<0.10.0,>=0.9.0 (from pycln==1.2.5) 21.46 Downloading pathspec-0.9.0-py2.py3-none-any.whl (31 kB) 21.46 Collecting pyyaml<6.0.0,>=5.3.1 (from pycln==1.2.5) 21.46 Downloading PyYAML-5.4.1.tar.gz (175 kB) 21.46 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 18.1 MB/s eta 0:00:00 21.46 Installing build dependencies: started 21.46 Installing build dependencies: finished with status 'done' 21.46 Getting requirements to build wheel: started 21.46 Getting requirements to build wheel: finished with status 'error' 21.46 stderr: 21.46 error: subprocess-exited-with-error 21.46 21.46 × Getting requirements to build wheel did not run successfully. 21.46 │ exit code: 1 21.46 ╰─> [54 lines of output] 21.46 running egg_info 21.46 writing lib3/PyYAML.egg-info/PKG-INFO 21.46 writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt 21.46 writing top-level names to lib3/PyYAML.egg-info/top_level.txt 21.46 Traceback (most recent call last): 21.46 File "/root/.cache/pre-commit/repo4w1q9rkv/py_env-python3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> 21.46 main() 21.46 File "/root/.cache/pre-commit/repo4w1q9rkv/py_env-python3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main 21.46 json_out['return_val'] = hook(**hook_input['kwargs']) 21.46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21.46 File "/root/.cache/pre-commit/repo4w1q9rkv/py_env-python3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel 21.46 return hook(config_settings) 21.46 ^^^^^^^^^^^^^^^^^^^^^ 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel 21.46 return self._get_build_requires(config_settings, requirements=['wheel']) 21.46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires 21.46 self.run_setup() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup 21.46 exec(code, locals()) 21.46 File "<string>", line 271, in <module> 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup 21.46 return distutils.core.setup(**attrs) 21.46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup 21.46 return run_commands(dist) 21.46 ^^^^^^^^^^^^^^^^^^ 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands 21.46 dist.run_commands() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands 21.46 self.run_command(cmd) 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command 21.46 super().run_command(command) 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command 21.46 cmd_obj.run() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run 21.46 self.find_sources() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources 21.46 mm.run() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 551, in run 21.46 self.add_defaults() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults 21.46 sdist.add_defaults(self) 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/command/sdist.py", line 112, in add_defaults 21.46 super().add_defaults() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults 21.46 self._add_defaults_ext() 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext 21.46 self.filelist.extend(build_ext.get_source_files()) 21.46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21.46 File "<string>", line 201, in get_source_files 21.46 File "/tmp/pip-build-env-qozjjc_0/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__ 21.46 raise AttributeError(attr) 21.46 AttributeError: cython_sources 21.46 [end of output] 21.46 21.46 note: This error originates from a subprocess, and is likely not a problem with pip. 21.46 error: subprocess-exited-with-error 21.46 21.46 × Getting requirements to build wheel did not run successfully. 21.46 │ exit code: 1 21.46 ╰─> See above for output. 21.46 21.46 note: This error originates from a subprocess, and is likely not a problem with pip. 21.46 Check the log at /root/.cache/pre-commit/pre-commit.log ------ Dockerfile-with-features:14 -------------------- 12 | 13 | COPY .pre-commit-config.yaml . 14 | >>> RUN git init . && pre-commit install-hooks 15 | 16 | FROM $_DEV_CONTAINERS_BASE_IMAGE AS dev_containers_target_stage -------------------- ERROR: failed to solve: process "/bin/sh -c git init . && pre-commit install-hooks" did not complete successfully: exit code: 3 [36820 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-stef/container-features/0.52.1-1701374114102/Dockerfile-with-features -t vsc-test-template-2-60f06196c0293bb6c958939cdcefef70d20bc269d1767afdad11ea7e5399ffe5 --target dev_containers_target_stage --no-cache --pull --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /home/stef/proj/test-template-2 [36821 ms] at cAA (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:463:1860) [36821 ms] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [36821 ms] at async zw (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:462:1841) [36822 ms] at async kK (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:462:610) [36823 ms] at async NAA (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:479:3660) [36823 ms] at async vC (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:479:4775) [36823 ms] at async etA (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:613:10941) [36824 ms] at async AtA (/home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js:613:10682) [36834 ms] Exit code 1 [36836 ms] Command failed: /usr/share/code/code --ms-enable-electron-run-as-node /home/stef/.vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/stef/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-cc111ff0-570b-404c-a6cf-dafd853ce0581701374112969 --workspace-folder /home/stef/proj/test-template-2 --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/stef/proj/test-template-2 --id-label devcontainer.config_file=/home/stef/proj/test-template-2/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/stef/proj/test-template-2/.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 [36836 ms] Exit code 1Stef (@Stef16Robbe), FWIW, I believe the error you got is the same as I (much more recently) reported in #151, and finally looked into today, yielding pull request #154. I imagine it's far too late to be useful to you, but commenting just in case!
Tao Klerks (@TaoK) Appreciate the follow-up. I have indeed since moved on, I might test it out for you later on to verify 👍
Metadata
Metadata
Assignees
Labels
No labels
This could be a problem with my setup, but I'm not sure what ths issue is.
Steps to reproduce:
git clone https://github.com/microsoft/python-package-template.gitWhat I expected to happen:
Container builds
What actually happens: