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

Handle run_lxc_download_script failure #223

Closed
Jip-Hop opened this issue Jul 8, 2024 · 2 comments
Closed

Handle run_lxc_download_script failure #223

Jip-Hop opened this issue Jul 8, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Jip-Hop
Copy link
Owner

Jip-Hop commented Jul 8, 2024

When run_lxc_download_script fails, jlmkr still returns 0 exit code.

root@ubuntu:~/jailmaker# ./jlmkr.py images
ERROR: Missing required tool: wget
root@ubuntu:~/jailmaker# echo $?
0

When run_lxc_download_script fails during jail creation, the jail is not cleaned up.

@Jip-Hop Jip-Hop added bug Something isn't working help wanted Extra attention is needed labels Jul 8, 2024
@Jip-Hop
Copy link
Owner Author

Jip-Hop commented Jul 9, 2024

jlmkr create --distro=nonexistent test
USE THIS SCRIPT AT YOUR OWN RISK!
IT COMES WITHOUT WARRANTY AND IS NOT SUPPORTED BY IXSYSTEMS.
Creating jail test with default config.
Overriding distro config value with nonexistent.
Overriding systemd_nspawn_user_args config value with [].
Downloading the image index
ERROR: Couldn't find a matching image
Aborting...

Jail is created but the rootfs directory remains empty. Exit code is 1 in this case, but the failed jail is not cleaned up.

@Jip-Hop
Copy link
Owner Author

Jip-Hop commented Jul 9, 2024

Awaiting lxc/lxc#4462 to decide how to handle this case:

root@ubuntu:~/jailmaker# ./jlmkr.py images
ERROR: Missing required tool: wget
root@ubuntu:~/jailmaker# echo $?
0

But jlmkr create --distro=nonexistent test now triggers a cleanup (develop branch).

@Jip-Hop Jip-Hop self-assigned this Jul 18, 2024
@Jip-Hop Jip-Hop removed the help wanted Extra attention is needed label Jul 18, 2024
Jip-Hop added a commit that referenced this issue Jul 18, 2024
@Jip-Hop Jip-Hop closed this as completed in 66b12a6 Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant