Failing to build a dev container

I have been running dev containers on Linux for quite a while now, building some extensions and even submitting a few patches. I followed the instructions on that page and life was great.

Last night code updated itself and today everything is broken. I cleaned all the docker images, and downgraded the environment but I cannot rebuild it.

Alwys the same error

error: failed to solve: process "/bin/bash -o pipefail -c pip3 install -r requirements.txt --use-deprecated=legacy-resolver" did not complete successfully: unable to find user root: invalid argument

I would appreciate any help and getting it back to work
Thanks

Full log is below if this helps

[28 ms] Dev Containers 0.262.3 in VS Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534).
[27 ms] Start: Resolving Remote
[35 ms] Start: Check Docker is running
[35 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[82 ms] Server API version: 1.42
[84 ms] Start: Run: docker volume ls -q
[133 ms] Start: Run: docker build -f /tmp/vsch-jfparis/bootstrap-image/0.262.3/bootstrap.Dockerfile -t vsc-volume-bootstrap /tmp/vsch-jfparis/bootstrap-image/0.262.3
[+] Building 0.2s (9/9) FINISHED                                                
 => [internal] load build definition from bootstrap.Dockerfile             0.0s
 => => transferring dockerfile: 324B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for mcr.microsoft.com/devcontainers/base:0-a  0.2s
 => [1/4] FROM mcr.microsoft.com/devcontainers/base:0-alpine-3.16@sha256:  0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 5.90kB                                        0.0s
 => CACHED [2/4] RUN apk add --no-cache  nodejs  python3  npm  make  g++   0.0s
 => CACHED [3/4] RUN cd && npm i node-pty                                  0.0s
 => CACHED [4/4] COPY .vscode-remote-containers /root/.vscode-remote-cont  0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:b84159cba79f2a4ab7a697f1f85d89a11f2a084648153  0.0s
 => => naming to docker.io/library/vsc-volume-bootstrap                    0.0s
[483 ms] Cloning Github repository: jfparis/core into /workspaces/core

[483 ms] Start: Run: docker run -d --mount type=volume,src=core-baa6bbc339a19ee8eb6de6eb83e60123,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[791 ms] Start: Run in container: /bin/sh
[796 ms] Start: Launching Dev Containers helper.
[796 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-5741ac0fd2705d65119a1135a39caec25282ef78.sock) forwarded to local host (/run/user/1000/keyring/ssh).
[797 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[800 ms] /run/user/1000/gnupg/S.gpg-agent.extra
[800 ms] 
[800 ms] Start: Run in container: gpgconf --list-dir agent-socket
[906 ms] /root/.gnupg/S.gpg-agent
[906 ms] 
[906 ms] Start: Run in container: gpgconf --list-dir homedir
[907 ms] /root/.gnupg
[907 ms] 
[907 ms] Start: Run in container: ls '/root/.gnupg/private-keys-v1.d' 2>/dev/null
[908 ms] 
[909 ms] 
[909 ms] Exit code 2
[909 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
[909 ms] Start: Run in container: /bin/sh
[912 ms] Start: Run in container: echo ~
[913 ms] 
[913 ms] 
[913 ms] Start: Run: gpgconf --list-dir homedir
[915 ms] /home/jfparis/.gnupg
[915 ms] 
[916 ms] Start: Run in container: gpgconf --list-dir homedir
[916 ms] /root/.gnupg
[916 ms] 
[933 ms] Start: Run in container: # Test for /root/.gnupg/pubring.gpg and gpg
[935 ms] 
[935 ms] 
[935 ms] Start: Run in container: # Copy /home/jfparis/.gnupg/pubring.gpg to /root/.gnupg/pubring.gpg
[968 ms] 
[968 ms] 
[969 ms] Start: Run in container: # Test for /root/.gnupg/trustdb.gpg and gpg
[970 ms] 
[970 ms] 
[970 ms] Start: Run in container: # Copy /home/jfparis/.gnupg/trustdb.gpg to /root/.gnupg/trustdb.gpg
[986 ms] 
[986 ms] 
[987 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[996 ms] /root
[996 ms] 
[996 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-5741ac0fd2705d65119a1135a39caec25282ef78.js' >/tmp/vscode-remote-containers-5741ac0fd2705d65119a1135a39caec25282ef78.js
[997 ms] 
[997 ms] 
[998 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-5741ac0fd2705d65119a1135a39caec25282ef78.js' >/tmp/vscode-remote-containers-server-5741ac0fd2705d65119a1135a39caec25282ef78.js_1675421349786
[1000 ms] 
[1000 ms] 
[1002 ms] Start: Run in container: # Test for /root/.gitconfig and git
[1003 ms] 
[1003 ms] 
[1003 ms] Start: Run in container: # Copy /home/jfparis/.gitconfig to /root/.gitconfig
[1005 ms] 
[1005 ms] 
[1005 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global --replace-all credential.helper '!f() { node /tmp/vscode-remote-containers-5741ac0fd2705d65119a1135a39caec25282ef78.js $*; }; f' || true
[1006 ms] 
[1006 ms] 
[1006 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[1007 ms] 
[1007 ms] 
[1007 ms] Start: Run in container: # Copy /home/jfparis/.ssh/known_hosts to /root/.ssh/known_hosts
[1009 ms] 
[1009 ms] 
[1050 ms] Start: Run in container: cat /workspaces/core/.devcontainer/devcontainer.json 2>/dev/null
[1052 ms] Start: Run in container: cat /workspaces/core/.devcontainer/devcontainer.json 2>/dev/null
[1054 ms] Start: Run in container: cat <<'EOF-/tmp/devcontainer-64089032-dba1-4800-877f-fa8b96386d89.json' >/tmp/devcontainer-64089032-dba1-4800-877f-fa8b96386d89.json_1675421349842
[1056 ms] 
[1056 ms] 
[1056 ms] Start: Run in container: docker volume ls -q
[1423 ms] Start: Run in container: docker ps -q -a --filter label=vsch.local.repository=https://github.com/jfparis/core --filter label=vsch.local.repository.volume=core-baa6bbc339a19ee8eb6de6eb83e60123 --filter label=vsch.local.repository.folder=core --filter label=vsch.quality=stable
[1535 ms] Start: Run in container: docker ps -q -a --filter label=vsch.local.repository=https://github.com/jfparis/core --filter label=vsch.local.repository.volume=core-baa6bbc339a19ee8eb6de6eb83e60123 --filter label=vsch.local.repository.folder=core
[1883 ms] Start: Run in container: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /workspaces/core --workspace-mount-consistency cached --id-label vsch.local.repository=https://github.com/jfparis/core --id-label vsch.local.repository.volume=core-baa6bbc339a19ee8eb6de6eb83e60123 --id-label vsch.local.repository.folder=core --log-level debug --log-format json --config /workspaces/core/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-64089032-dba1-4800-877f-fa8b96386d89.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=core-baa6bbc339a19ee8eb6de6eb83e60123,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root true
[2193 ms] (node:132) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2194 ms] (Use `node --trace-deprecation ...` to show where the warning was created)
[2195 ms] @devcontainers/cli 0.23.2. Node.js v16.17.1. linux 5.15.0-58-generic x64.
[2195 ms] Start: Run: docker buildx version
[2245 ms] github.com/docker/buildx v0.8.2 6224def4dd2c3d347eee19db595348c50d7cb491
[2245 ms] 
[2245 ms] Start: Resolving Remote
[2248 ms] Start: Run: git rev-parse --show-cdup
[2251 ms] Start: Run: docker ps -q -a --filter label=vsch.local.repository=https://github.com/jfparis/core --filter label=vsch.local.repository.volume=core-baa6bbc339a19ee8eb6de6eb83e60123 --filter label=vsch.local.repository.folder=core
[2269 ms] Start: Run: docker inspect --type image mcr.microsoft.com/vscode/devcontainers/python:0-3.10
[2287 ms] local container features stored at: /root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/node_modules/vscode-dev-containers/container-features
[2288 ms] Start: Run: tar --no-same-owner -x -f -
[2309 ms] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.23.2-1675421351075/Dockerfile-with-features -t vsc-core-a3326b3531d3eb2709cdfe792550e3f2 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /workspaces/core
[+] Building 0.1s (18/21)                                                       
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 227B                                          0.0s
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 4.57kB                                     0.0s
 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/p  0.0s
 => [dev_container_auto_added_stage_label  1/17] FROM mcr.microsoft.com/v  0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 6.55kB                                        0.0s
 => CACHED [dev_container_auto_added_stage_label  2/17] RUN pipx uninstal  0.0s
 => CACHED [dev_container_auto_added_stage_label  3/17] RUN pipx uninstal  0.0s
 => CACHED [dev_container_auto_added_stage_label  4/17] RUN pipx uninstal  0.0s
 => CACHED [dev_container_auto_added_stage_label  5/17] RUN pipx uninstal  0.0s
 => CACHED [dev_container_auto_added_stage_label  6/17] RUN pipx uninstal  0.0s
 => CACHED [dev_container_auto_added_stage_label  7/17] RUN pipx uninstal  0.0s
 => CACHED [dev_container_auto_added_stage_label  8/17] RUN     curl -sS   0.0s
 => CACHED [dev_container_auto_added_stage_label  9/17] WORKDIR /usr/src   0.0s
 => CACHED [dev_container_auto_added_stage_label 10/17] RUN git clone --d  0.0s
 => CACHED [dev_container_auto_added_stage_label 11/17] WORKDIR /workspac  0.0s
 => CACHED [dev_container_auto_added_stage_label 12/17] COPY requirements  0.0s
 => CACHED [dev_container_auto_added_stage_label 13/17] COPY homeassistan  0.0s
 => ERROR [dev_container_auto_added_stage_label 14/17] RUN pip3 install -  0.0s
------
 > [dev_container_auto_added_stage_label 14/17] RUN pip3 install -r requirements.txt --use-deprecated=legacy-resolver:
------
Dockerfile-with-features:50
--------------------
  48 |     COPY requirements.txt ./
  49 |     COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
  50 | >>> RUN pip3 install -r requirements.txt --use-deprecated=legacy-resolver
  51 |     COPY requirements_test.txt requirements_test_pre_commit.txt ./
  52 |     RUN pip3 install -r requirements_test.txt --use-deprecated=legacy-resolver
--------------------
error: failed to solve: process "/bin/bash -o pipefail -c pip3 install -r requirements.txt --use-deprecated=legacy-resolver" did not complete successfully: unable to find user root: invalid argument
[2445 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.23.2-1675421351075/Dockerfile-with-features -t vsc-core-a3326b3531d3eb2709cdfe792550e3f2 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /workspaces/core
[2445 ms]     at doe (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:1888:1635)
[2445 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2446 ms]     at async pF (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:1973)
[2446 ms]     at async eT (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:901)
[2446 ms]     at async voe (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:2049)
[2446 ms]     at async Xf (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:3212)
[2446 ms]     at async Jae (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:15058)
[2446 ms]     at async Wae (/root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:14812)
[2452 ms] Exit code 1
[2452 ms] Start: Run: docker rm -f 1e19ca7fda518186dd0c291082d0c296ac901a14b5d61b64c578902174f0b067
[2460 ms] Command failed: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.262.3/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /workspaces/core --workspace-mount-consistency cached --id-label vsch.local.repository=https://github.com/jfparis/core --id-label vsch.local.repository.volume=core-baa6bbc339a19ee8eb6de6eb83e60123 --id-label vsch.local.repository.folder=core --log-level debug --log-format json --config /workspaces/core/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-64089032-dba1-4800-877f-fa8b96386d89.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=core-baa6bbc339a19ee8eb6de6eb83e60123,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root true
[2460 ms] Exit code 1
[2536 ms] Container server terminated (code: 137, signal: null).

Alright. I am none the wiser but I managed to rebuild it by

  • Downgraded dev container to version 2.34 (click on the down arrow next to uninstall to downgrade); and
  • downgrading docker (some details at to what is going on here
sudo apt-get remove docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin docker-ce-rootless-extras docker-scan-plugin libslirp0 pigz slirp4netns
# figure out the exact previous version of docker
sudo apt-cache madison docker-ce-cli
sudo apt-cache madison docker-ce
# reinstalling them
sudo apt install docker-ce=5:20.10.23~3-0\~ubuntu-jammy  docker-ce-cli=5:20.10.23~3-0\~ubuntu-jamm

#hold the packages version for now
sudo apt-mark hold docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin docker-ce-rootless-extras docker-scan-plugin libslirp0 pigz slirp4netns

I’m getting the same error. While downgrading docker may help, I’d consider that workaround, not fix. Can this please be fixed in HA, so it works with latest docker?