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

fail snapshot if snapper fails to set it as default #118

Closed
lnussel opened this issue Dec 14, 2023 · 5 comments
Closed

fail snapshot if snapper fails to set it as default #118

lnussel opened this issue Dec 14, 2023 · 5 comments

Comments

@lnussel
Copy link
Member

lnussel commented Dec 14, 2023

snapper now returns failures from plugins. That is important with systemd-boot. It could happen that the ESP runs out of space for example. In that case sdbootutil would fail to copy the kernel to the ESP and signal failure to snapper which in turn exits with code != 0. Transactional-update must then consider the snapshot as failed as it wouldn't boot.

@lnussel
Copy link
Member Author

lnussel commented Jan 15, 2024

ping?

@laenion
Copy link
Collaborator

laenion commented Jan 19, 2024

Implementing now.

@laenion
Copy link
Collaborator

laenion commented Jan 19, 2024

If snapper returns with an error code an exception will be thrown, which in turn will result in the snapshot being deleted again (see https://github.com/openSUSE/transactional-update/blob/master/lib/Snapshot/Snapper.cpp).
There are two exceptions: setDefault and setReadOnly will try to use btrfs directly if snapper failed; this is for compatibility with older snapper versions, e.g. during version updates.

I guess the later is causing a problem because then the snapper plugins won't be executed any more?

@lnussel
Copy link
Member Author

lnussel commented Jan 22, 2024

yes. If snapper fails but t-u still treats the snapshot as good, the snapshot may not be bootable

laenion added a commit to laenion/transactional-update that referenced this issue Feb 23, 2024
For compatibility reasons (older snapper versions don't support some
parameters) some snapper calls also have an alternate fallback call.

With [gh#openSUSE#118] / [poo#127169] snapper can
also return errors from plugins now, so only try an alternate way if
snapper fails because of unsupported command line parameters.
laenion added a commit to laenion/transactional-update that referenced this issue Feb 26, 2024
For compatibility reasons (older snapper versions don't support some
parameters) some snapper calls also have an alternate fallback call.

With [gh#openSUSE#118] / [poo#127169] snapper can
also return errors from plugins now, so only try an alternate way if
snapper fails because of unsupported command line parameters.
@laenion
Copy link
Collaborator

laenion commented Mar 4, 2024

Added with transactional-update 4.6.0.

@laenion laenion closed this as completed Mar 4, 2024
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

2 participants