devcontainer up fails with unclear error when specifying non-existent remoteUser
@v-Kaniska244 is already working on this.
Since Apr 29, 2025.
Assessment
This issue has not been assessed yet.
Description
When creating a devcontainer with a removeUser that does not exist in the container, devcontainer up fails without a clear error
The log output contains
Shell server terminated (code: 126, signal: null)
no users found
for one of the commands and exits with a generic error message in the final result. We use --log-format=json, and those lines are plain text, so aren't getting parsed and shown in the build output
To reproduce
Can reproduce with the following devcontainer.json:
{
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.10-bullseye",
"remoteUser": "foobar"
}
Logs:
$ devcontainer up --workspace-folder . --config .devcontainer/devcontainer.json --log-format=json
...
{"type":"start","level":2,"timestamp":1744618710700,"text":"Run: docker inspect --type container 240a168268e3"}
{"type":"stop","level":2,"timestamp":1744618710714,"text":"Run: docker inspect --type container 240a168268e3","startTimestamp":1744618710700}
{"type":"start","level":2,"timestamp":1744618710715,"text":"Inspecting container"}
{"type":"start","level":2,"timestamp":1744618710715,"text":"Run: docker inspect --type container 240a168268e39df374572d62dce4ff61599028711968f99e66c14d248f5a1fe7"}
{"type":"stop","level":2,"timestamp":1744618710731,"text":"Run: docker inspect --type container 240a168268e39df374572d62dce4ff61599028711968f99e66c14d248f5a1fe7","startTimestamp":1744618710715}
{"type":"stop","level":2,"timestamp":1744618710731,"text":"Inspecting container","startTimestamp":1744618710715}
{"type":"start","level":2,"timestamp":1744618710732,"text":"Run in container: /bin/sh"}
{"type":"start","level":2,"timestamp":1744618710734,"text":"Run in container: uname -m"}
{"type":"stop","level":2,"timestamp":1744618710753,"text":"Run in container: /bin/sh","startTimestamp":1744618710732}
Shell server terminated (code: 126, signal: null)
no users found
{"type":"start","level":2,"timestamp":1744618710754,"text":"Run in container: (command -v getent >/dev/null 2>&1 && getent passwd 'foobar' || grep -E '^foobar|^[^:]*:[^:]*:foobar:' /etc/passwd || true)"}
{"type":"text","level":2,"timestamp":1744618710754,"text":"Stdin closed!"}
Error: An error occurred setting up the container.
at D6 (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:467:1253)
at Ix (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:467:997)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async H6 (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:3842)
at async BC (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:4957)
at async d7 (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:665:202)
at async f7 (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:664:14804)
at async /usr/local/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:1188
{"outcome":"error","message":"An error occurred setting up the container.","description":"An error occurred setting up the container.","containerId":"240a168268e39df374572d62dce4ff61599028711968f99e66c14d248f5a1fe7"}
devcontainer CLI version: 0.75.0
OS: Ubuntu 24.04.2 LTS
Docker version: Docker version 27.5.1, build 9f9e405
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 461
- Avg merge
- 18m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devcontainers/cli
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
devcontainers/cli#1203 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
devcontainers/cli#1178 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
devcontainers/cli#1308 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
devcontainers/cli#1307 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
devcontainers/cli#1305 ·
All issues in devcontainers/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·