URGENT: Codespace reports successful creation but fails to install Flutter SDK #169787
Replies: 5 comments
-
Update: I have an important additional detail. Every time I try to create the codespace, the tab immediately shows the message: "This codespace is currently running in recovery mode due to a configuration error." This confirms that the main container build is always failing, and the 'successful' log I posted previously was likely for the creation of the recovery container itself. |
Beta Was this translation helpful? Give feedback.
-
Hi Edwin, Thanks for the detailed report about your Flutter Codespace issues. The recovery mode message you mentioned is indeed the key indicator here - it confirms that your main devcontainer build is failing, which explains why Flutter commands aren't available. Here are the steps to diagnose and fix this issue: 1. Check Your devcontainer.json ConfigurationFirst, let's ensure your {
"name": "Flutter",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
"features": {
"ghcr.io/devcontainers/features/flutter:1": {
"version": "latest",
"androidSdk": "true"
},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"postCreateCommand": "flutter doctor",
"customizations": {
"vscode": {
"extensions": [
"Dart-Code.flutter",
"Dart-Code.dart-code"
]
}
},
"forwardPorts": [3000, 8080],
"remoteUser": "vscode"
} 2. Alternative Approach - Using Flutter Docker ImageIf the features approach doesn't work, try using a pre-built Flutter image: {
"name": "Flutter Development",
"image": "cirrusci/flutter:stable",
"customizations": {
"vscode": {
"extensions": [
"Dart-Code.flutter",
"Dart-Code.dart-code"
]
}
},
"postCreateCommand": "flutter doctor -v",
"forwardPorts": [3000, 8080]
} 3. Debugging StepsTo get more detailed error information:
4. Common Issues to Check
5. Alternative Debugging MethodCreate a minimal devcontainer first to isolate the issue: {
"name": "Debug Container",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
"postCreateCommand": "echo 'Container built successfully' && whoami && pwd && ls -la"
} If this works, gradually add Flutter-specific configurations. 6. Getting Detailed Error LogsWhen the Codespace enters recovery mode:
The key is getting the actual error message from the failed build step, which should be in the detailed creation logs. Let me know what you find in the detailed logs, and I can help troubleshoot the specific error that's causing the build failure! Cheers, |
Beta Was this translation helpful? Give feedback.
-
Click here to see the full creation log2025-08-14 12:02:45.544Z: Configuration starting... 2025-08-14 12:02:45.546Z: Cloning...================================================================================= ====================================== ERROR ====================================
|
Beta Was this translation helpful? Give feedback.
-
Hi Edwin, I can see exactly what's happening from your logs. The issue is that your devcontainer configuration is trying to use Immediate SolutionHere are two working devcontainer configurations you can use to fix this: Option 1: Updated Flutter Feature (Recommended) {
"name": "Flutter Development",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/flutter:latest": {
"version": "stable",
"androidSdk": false
}
},
"customizations": {
"vscode": {
"extensions": [
"Dart-Code.dart-code",
"Dart-Code.flutter"
]
}
},
"forwardPorts": [3000, 8080],
"postCreateCommand": "flutter doctor"
} Option 2: Manual Installation (More Reliable) {
"name": "Flutter Development",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"customizations": {
"vscode": {
"extensions": [
"Dart-Code.dart-code",
"Dart-Code.flutter"
]
}
},
"forwardPorts": [3000, 8080],
"postCreateCommand": [
"bash",
"-c",
"curl -fsSL https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.16.9-stable.tar.xz | tar -xJ -C /opt && echo 'export PATH=\"$PATH:/opt/flutter/bin\"' >> ~/.bashrc && export PATH=\"$PATH:/opt/flutter/bin\" && flutter doctor"
]
} Quick Fix for Current SessionIf you need to get unblocked right now with your existing recovery container, run these commands in the terminal: curl -fsSL https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.16.9-stable.tar.xz | tar -xJ -C /opt
echo 'export PATH="$PATH:/opt/flutter/bin"' >> ~/.bashrc
source ~/.bashrc
flutter doctor Steps to Implement
The issue isn't with the Codespaces service itself, but with the specific Flutter feature reference in your devcontainer config. These updated configurations should resolve the problem completely. |
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
Hello,
I am experiencing a persistent and critical issue with creating a GitHub Codespace for my Flutter repository.
My repository is: https://github.com/edwinpalyga/moja-aplikacja-dla-rodzicow
I have tried creating a Codespace multiple times, including using a custom devcontainer.json. The latest attempt produced a creation log that states "Finished configuring codespace" with multiple "Outcome: success" messages.
However, immediately after the environment loads, when I open a terminal and type any flutter command (like 'flutter --version'), I get the error: "bash: flutter: command not found".
This is a critical failure: the logs report a success, but the environment is broken and missing the core SDK. This proves there is a fundamental issue with the Codespace provisioning service.
I am completely blocked. Could you please investigate this immediately?
The successful (but incorrect) creation log is attached below.
Thank you,
Edwin Palyga
Click to see full Creation Log
================================================================================= 2025-08-14 10:55:46.195Z: Configuration starting... 2025-08-14 10:55:46.209Z: Cloning...=================================================================================
2025-08-14 10:55:46.297Z: Creating container...
2025-08-14 10:55:46.346Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/moja-aplikacja-dla-rodzicow --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --user-data-folder /var/lib/docker/codespacemount/.persistedshare --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 --omit-config-remote-env-from-metadata --skip-non-blocking-commands --skip-post-create --expect-existing-container --config "/var/lib/docker/codespacemount/workspace/moja-aplikacja-dla-rodzicow/.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-08-14 10:55:46.479Z: @devcontainers/cli 0.80.0. Node.js v18.20.6. linux 6.8.0-1030-azure x64.
2025-08-14 10:55:46.670Z: $ docker start 2c452e5619ca6ff7fc4777969b3dc5143419b0cd96baf1255f4669d141f20b51
2025-08-14 10:55:46.832Z: 2c452e5619ca6ff7fc4777969b3dc5143419b0cd96baf1255f4669d141f20b51
2025-08-14 10:55:46.834Z: Stop: Run: docker start 2c452e5619ca6ff7fc4777969b3dc5143419b0cd96baf1255f4669d141f20b51
2025-08-14 10:55:46.971Z: Outcome: success User: vscode WorkspaceFolder: /workspaces/moja-aplikacja-dla-rodzicow
2025-08-14 10:55:46.980Z: devcontainer process exited with exit code 0
=================================================================================
2025-08-14 10:55:47.240Z: Running blocking commands...
2025-08-14 10:55:47.269Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/moja-aplikacja-dla-rodzicow --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --user-data-folder /var/lib/docker/codespacemount/.persistedshare --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 --omit-config-remote-env-from-metadata --skip-non-blocking-commands --expect-existing-container --config "/var/lib/docker/codespacemount/workspace/moja-aplikacja-dla-rodzicow/.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-08-14 10:55:47.408Z: @devcontainers/cli 0.80.0. Node.js v18.20.6. linux 6.8.0-1030-azure x64.
2025-08-14 10:55:47.639Z: Outcome: success User: vscode WorkspaceFolder: /workspaces/moja-aplikacja-dla-rodzicow
2025-08-14 10:55:47.643Z: devcontainer process exited with exit code 0
=================================================================================
2025-08-14 10:55:47.655Z: Configuring codespace...
=================================================================================
2025-08-14 10:55:47.775Z: Running commands...
2025-08-14 10:55:47.809Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/moja-aplikacja-dla-rodzicow --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/moja-aplikacja-dla-rodzicow/.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-08-14 10:55:47.958Z: @devcontainers/cli 0.80.0. Node.js v18.20.6. linux 6.8.0-1030-azure x64.
2025-08-14 10:55:48.237Z: Outcome: success User: vscode WorkspaceFolder: /workspaces/moja-aplikacja-dla-rodzicow
2025-08-14 10:55:48.251Z: devcontainer process exited with exit code 0
=================================================================================
2025-08-14 10:55:48.389Z: Finished configuring codespace.
Beta Was this translation helpful? Give feedback.
All reactions