My codespace Failed to creation dev. Container #180940
Replies: 7 comments
-
|
The error "unable to find user codespace: no matching entries in passwd file" indicates a user permission issue in your dev container configuration. Try these fixes: 1. Check your {
"remoteUser": "vscode",
"containerUser": "vscode"
}2. If using a custom Dockerfile, ensure the user exists: RUN useradd -m -s /bin/bash vscode
USER vscode3. Reset the codespace:
4. Check for authentication issues: {
"postCreateCommand": "sudo chown -R vscode:vscode /workspaces"
}5. If using a prebuild: |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
This means: Your dev container is trying to start as a user that does not exist inside the container image. Because of this, Codespaces drops into recovery mode, and rebuilding won’t help until the configuration is fixed. Why this happens Usually caused by one of these in .devcontainer/devcontainer.json or the Dockerfile: remoteUser is set to a user that doesn’t exist USER codespace (or similar) is set in the Dockerfile but never created A custom base image that doesn’t include the expected user A mismatch between: remoteUser /etc/passwd the image you’re using Codespaces expects the user to exist in /etc/passwd. ✅ Quick fix (most common solution) Look for this: "remoteUser": "codespace" or "remoteUser": "vscode" 👉 Fix option A (recommended) Remove remoteUser entirely and let Codespaces handle it: { Then rebuild. |
Beta Was this translation helpful? Give feedback.
-
|
❌This error happens because the dev container is trying to use a user that does not exist inside the container. Open .devcontainer/devcontainer.json and check remoteUser or containerUser. 👉"remoteUser": "vscode" or remove the remoteUser field completely. After saving, rebuild the container using Codespaces: Rebuild Container (full rebuild). If the container still opens in recovery mode, delete the Codespace and create a new one. |
Beta Was this translation helpful? Give feedback.
-
|
This error usually happens because the user configured in your devcontainer doesn’t exist inside the image. Quick fix: // "remoteUser": "root" If you’re using a custom Dockerfile, make sure the user is created: //RUN useradd -m codespace and then: //"remoteUser": "codespace" After that, Rebuild Container. |
Beta Was this translation helpful? Give feedback.
-
How to Fix GitHub Codespace Recovery Mode ErrorThe error "unable to find user codespace: no matching entries in passwd file" means your dev container configuration has a user setup problem. Step-by-Step SolutionStep 1: Check Your Dev Container Configuration
Step 2: Fix Common IssuesOption A - Remove User Settings (Simplest Fix) Remove or comment out these lines in "remoteUser": "codespace"
"containerUser": "codespace"Option B - Use Default User Change to: "remoteUser": "vscode"Option C - Fix Dockerfile User Issues If you have a custom Dockerfile in RUN useradd -m -s /bin/bash codespace
USER codespaceStep 3: Delete and Recreate Codespace
Step 4: If Issue Persists - Use Minimal ConfigReplace your {
"name": "My Project",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu"
}Then rebuild the container. Quick Fix Summary
This should resolve the "no matching entries in passwd file" error. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
code space show this message:
This codespace is currently running in recovery mode due to a configuration error. Please review the creation logs, update your dev container configuration as needed, and run the "Rebuild Container" command to rectify.
i rebuild container more but this issue still there.
this is all showing
In the creation logs:
Stop: Run: docker start f59f105b3592aeb123bdccfe2f4f839c4942e336c7590692dc587bfab11e5820
Shell server terminated (code: 126, signal: null)
unable to find user codespace: no matching entries in passwd file
{"outcome":"error","message":"An error occurred setting up the container.","description":"An error occurred setting up the container.","containerId":"f59f105b3592aeb123bdccfe2f4f839c4942e336c7590692dc587bfab11e5820"}
Error: An error occurred setting up the container.
at w6: (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:467:1253)
at ax: (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:467:997)
at process. processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Y6 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:3842)
at async BC (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:4957)
at async p7 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:665:202)
at async d7 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:664:14804)
at async /.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:1188
devcontainer process exited with exit code 1
ERROR =
2025-12-02 17:37:12.998Z: Failed to create container
how to solve this issue ?
Beta Was this translation helpful? Give feedback.
All reactions