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

Running envbuilder CLI on a local laptop may destroy the filesystem #144

Closed
bpmct opened this issue Apr 25, 2024 · 7 comments · Fixed by #160
Closed

Running envbuilder CLI on a local laptop may destroy the filesystem #144

bpmct opened this issue Apr 25, 2024 · 7 comments · Fixed by #160
Assignees
Labels
docs Improvements or additions to documentation

Comments

@bpmct
Copy link
Member

bpmct commented Apr 25, 2024

Can we add a warning that explains the CLI is not intended to be ran locally on a laptop (Macbook) and a warning of the outcome?

VM use cases are encouraged, but we should still warn

@coder-labeler coder-labeler bot added the docs Improvements or additions to documentation label Apr 25, 2024
@bpmct bpmct mentioned this issue Apr 25, 2024
36 tasks
@bpmct bpmct changed the title Running envbuilder CLI locally may destroy the filesystem Running envbuilder CLI on a local laptop may destroy the filesystem Apr 25, 2024
@bpmct
Copy link
Member Author

bpmct commented Apr 25, 2024

FYI @mtojek

@matifali
Copy link
Member

I have been through this :( Lost all my data.

@mtojek
Copy link
Member

mtojek commented Apr 25, 2024

I have been through this :( Lost all my data.

Can you share more details about what exactly happened? We may describe this in README.

@matifali
Copy link
Member

matifali commented Apr 25, 2024

I was logged in through SSH to a Linux VM and executed the envbuilder binary. I got disconnected and could not log in again. I assume it destroyed/overrode the filesystem.

@johnstcn
Copy link
Member

While VM use-cases for envbuilder are definitely possible, its primary use-case is to run inside a container.

@johnstcn
Copy link
Member

johnstcn commented Apr 26, 2024

I was logged in through SSH to a Linux VM and executed the envbuilder binary. I got disconnected and could not log in again. I assume it destroyed/overrode the filesystem.

I was able to reproduce this, but needed to run envbuilder as root. I assume that's what happend here?

@johnstcn
Copy link
Member

johnstcn commented Apr 29, 2024

Root cause: util.DeleteFilesystem will delete RootDir.
In the envbuilder Dockerfile, we set KANIKO_DIR=/.envbuilder.
We will use this to determine if envbuilder is being running inside a container.
The existing FORCE_SAFE environment variable can be used to bypass this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants