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

Devcontainer on GitHub Codespaces fails to install #653

Open
DevSecNinja opened this issue Jan 3, 2025 · 2 comments
Open

Devcontainer on GitHub Codespaces fails to install #653

DevSecNinja opened this issue Jan 3, 2025 · 2 comments
Assignees

Comments

@DevSecNinja
Copy link

Describe the bug
Devcontainer on GitHub Codespaces fails to install

To Reproduce
Steps to reproduce the behavior:

  1. Create a GitHub Codespace based on the latest commits. In my case: c7e5375
  2. The ✖ Running updateContentCommand... fails

Expected behavior
Devcontainer creation should finish without error

Additional context
Might also be interesting to make a prebuild container: https://docs.github.com/en/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds

Relevant log:

=================================================================================
2025-01-03 10:41:11.712Z: Running commands...
2025-01-03 10:41:11.731Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/generative-ai-for-beginners --expect-existing-container --skip-post-attach --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --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 --config "/var/lib/docker/codespacemount/workspace/generative-ai-for-beginners/.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 --secrets-file /root/.codespaces/shared/user-secrets-envs.json
2025-01-03 10:41:11.996Z: @devcontainers/cli 0.68.0. Node.js v18.20.5. linux 6.5.0-1025-azure x64.
2025-01-03 10:41:12.315Z: Running the updateContentCommand from devcontainer.json...

2025-01-03 10:41:12.317Z: python3 -m pip install -r requirements.txt
2025-01-03 10:41:13.942Z: Collecting ipywidgets==7.7.1 (from -r requirements.txt (line 1))
2025-01-03 10:41:13.955Z:   Downloading ipywidgets-7.7.1-py2.py3-none-any.whl.metadata (1.9 kB)
2025-01-03 10:41:14.121Z: Collecting matplotlib==3.7.0 (from -r requirements.txt (line 2))
2025-01-03 10:41:14.126Z:   Downloading matplotlib-3.7.0.tar.gz (36.3 MB)
2025-01-03 10:41:14.126Z: �[?25l2025-01-03 10:41:14.128Z:      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/36.3 MB ? eta -:--:--2025-01-03 10:41:14.330Z: 
�[2K     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━ 29.4/36.3 MB 235.6 MB/s eta 0:00:012025-01-03 10:41:14.533Z: 
�[2K     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 36.2/36.3 MB 132.4 MB/s eta 0:00:012025-01-03 10:41:14.735Z: 
�[2K     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 36.2/36.3 MB 132.4 MB/s eta 0:00:012025-01-03 10:41:14.908Z: 
�[2K     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36.3/36.3 MB 46.8 MB/s eta 0:00:00
�[?25h2025-01-03 10:41:18.301Z:   Installing build dependencies ... �[?25l-2025-01-03 10:41:18.450Z: � �\2025-01-03 10:41:18.585Z: � �|2025-01-03 10:41:19.046Z: � �/2025-01-03 10:41:19.417Z: � �-2025-01-03 10:41:19.808Z: � �\2025-01-03 10:41:20.195Z: � �|2025-01-03 10:41:27.305Z: � �/2025-01-03 10:41:27.440Z: � �done
2025-01-03 10:41:27.727Z: �[?25h  Getting requirements to build wheel ... �[?25l-2025-01-03 10:41:27.968Z: � �\2025-01-03 10:41:28.103Z: � �|2025-01-03 10:41:28.143Z: � �done
2025-01-03 10:41:28.420Z: �[?25h  Preparing metadata (pyproject.toml) ... �[?25l-2025-01-03 10:41:28.608Z: � �\2025-01-03 10:41:28.736Z: � �done
2025-01-03 10:41:29.961Z: �[?25hCollecting numpy==1.24.2 (from -r requirements.txt (line 3))
2025-01-03 10:41:29.968Z:   Downloading numpy-1.24.2.tar.gz (10.9 MB)2025-01-03 10:41:29.968Z: 
2025-01-03 10:41:29.969Z: �[?25l2025-01-03 10:41:29.973Z:      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/10.9 MB ? eta -:--:--2025-01-03 10:41:30.186Z: 
�[2K     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺ 10.7/10.9 MB 107.0 MB/s eta 0:00:012025-01-03 10:41:30.268Z: 
�[2K     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.9/10.9 MB 36.7 MB/s eta 0:00:00
�[?25h2025-01-03 10:41:32.609Z:   Installing build dependencies ... �[?25l-2025-01-03 10:41:33.127Z: � �\2025-01-03 10:41:34.490Z: � �|2025-01-03 10:41:34.749Z: � �/2025-01-03 10:41:35.926Z: � �-2025-01-03 10:41:36.039Z: � �done
2025-01-03 10:41:36.097Z: �[?25h  Getting requirements to build wheel ... �[?25ldone
2025-01-03 10:41:36.203Z: ERROR: Exception:
Traceback (most recent call last):
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 379, in run
    requirement_set = resolver.resolve(
                      ^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    return bool(self._sequence)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvel2025-01-03 10:41:36.204Z: ib/found_candidates.py", line 174, in __bool__
    return any(self)
           ^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 53, in _iter_built
    candidate = func()
                ^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 187, in _make_candidate_from_link
    base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 233, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
                                       ^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 304, in __init__
    super().__init__(
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 159, in __init__
    self.dist = self._prepare()
                ^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 236, in _prepare
    dist = self._prepare_distribution()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 315, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 527, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 642, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 72, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 56, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 126, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 103, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_internal/utils/misc.py", line 701, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/si2025-01-03 10:41:36.205Z: te-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "/home/codespace/.python/current/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/codespace/.python/current/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/tmp/pip-build-env-hwlo8pz0/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 10, in <module>
    import distutils.core
ModuleNotFoundError: No module named 'distutils'
Copy link

github-actions bot commented Jan 3, 2025

👋 Thanks for contributing @DevSecNinja! We will review the issue and get back to you soon.

@DevSecNinja
Copy link
Author

This fixed it for me: DevSecNinja@a257b5c

Seems like an issue with Python 3.12. I can strongly recommend to version pin the devcontainer image as it will prevent these issues in the future and make troubleshooting easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants