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

Feat: check for common situations that cause inscrutable LXC errors and fail early with better warnings #631

Open
mikemccracken opened this issue Jul 24, 2024 · 0 comments

Comments

@mikemccracken
Copy link
Contributor

Is your feature request related to a problem? Please describe.

In some cases the system environment is in an unexpected state, and the build container that stacker tries to start will fail to start, and we get an error message straight from LXC that someone unfamiliar with stacker's use of LXC or unfamiliar with LXC, will not find helpful.

As an example, one such case was where the environment variable XDG_RUNTIME_DIR was un-set, by a stacker wrapper trying to create a clean build environment, so lxc was using the fallback default of $HOME/.cache, which had been replaced with a symlink to /data/hdd/.cache, probably in an attempt to avoid filling whatever is mounted at $HOME, but the symlink was not owned by the user, so creating the lock file there failed, with an error like this:

loading docker://<<image name was here>>
Failed to create lock for build-sanity-d5702d7c-6074-42d1-9014-32774fb011b6
error: allocating the container failed

Describe the solution you'd like

Ideally we could have an environment-check before each build (maybe this should also do the stacker check checks), to make sure that the LXCDIR and other required things are accessible with appropriate perms, etc.

The error message should give enough detail to understand the issue and suggest solutions if possible...

Describe alternatives you've considered

No response

Additional context

No response

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

No branches or pull requests

1 participant