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

Option to ignore default features in devcontainer recovery container #10115

Closed
evilhamsterman opened this issue Jul 30, 2024 · 7 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Milestone

Comments

@evilhamsterman
Copy link

When a devcontainer fails to build VSCode will offer to let you open it in a recovery container to try and fix the devcontainer.json. It will still install the default features that are set in the devcontainers extensions settings, however sometimes the issue is with a one of the default features, or the feature relies on something like apt-get but the recovery container is based on Alpine so that command is not available. To get into the recovery container then you have to open a new window, because you can't access settings in the broken window, and remove or comment out the problem feature. Fix the issue then reenable the problem feature.

Kind of like safe mode for Windows, the recovery container should not load anymore than is necessary to open the editor. Or at least have that as an option.

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Jul 30, 2024
@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Jul 31, 2024
@chrmarti
Copy link
Contributor

That is indeed an oversight. We shouldn't install the default features in the recovery container.

@joshspicer
Copy link
Member

joshspicer commented Jul 31, 2024

Repro steps:

  • Add a Feature to defaultFeatures setting that will fail to install on alpine, eg:
  "dev.containers.defaultFeatures": {
    "ghcr.io/devcontainers/features/docker-in-docker:2": {}
  }
  • Select a GitHub repo that has a broken configuration (to force recovery mode), eg: https://github.com/codspace/broken-project
  • Create a new dev container by cloning to volume with Dev Containers: Clone Repository in Container Volume and select the GitHub Repo
  • Select Edit devcontainer.json in Recovery Container
  • Note that the recovery container fails to create, logs confirm:
Start: Run: docker inspect --type image mcr.microsoft.com/devcontainers/base:0-alpine-3.20
...
...
0.092 ./install.sh: line 192: dpkg: command not found
0.092 ERROR: Feature "Docker (Docker-in-Docker)" (ghcr.io/devcontainers/features/docker-in-docker) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/docker-in-docker for help troubleshooting this error.
------

Removing the defaultFeatures setting and retrying the steps above successfully opens to a recovery container


Validate: When entering a recovery container, the line in the logs containing devContainersSpecCLI.js up should not have an --additional-features parameter passed to it.

@joshspicer joshspicer added this to the August 2024 milestone Jul 31, 2024
@joshspicer
Copy link
Member

joshspicer commented Jul 31, 2024

Thanks for the report!

This should be fixed in the next pre-release of the extension (i'll keep this issue open until we publish that)

@joshspicer
Copy link
Member

This change has shipped in pre-release v0.382.0. Please let us know if the change helps!

@joshspicer joshspicer added verification-needed Verification of issue is requested and removed verification-needed Verification of issue is requested labels Aug 26, 2024
@rzhao271 rzhao271 added the verified Verification succeeded label Aug 28, 2024
@rzhao271
Copy link

In the recovery container, I see --additional-features passed in the logs, but those logs seem to reflect the failed container build attempt. The recovery container loads properly.

@evilhamsterman
Copy link
Author

Sorry it took a bit to get back to it. I verified it with the v0.383.0 release. Including a default feature that uses apt to install a package no longer breaks the recovery container

@joshspicer
Copy link
Member

Appreciate you giving it a go, thanks!

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants