Skip to content

Commit

Permalink
Modify upgrade not terminate after lockfile detected
Browse files Browse the repository at this point in the history
Previously, when the upgrade failed in the initram the file
/sysroot/root/tmp_leapp_py3/.leapp_upgrade_failed has been generated and
upon detecting this file leapp triggered an emergency shell. This caused
the original failure to be hidden from the customer.

With this commit, we no longer crash immediately upon detecting the file
but rather continue and "wait" for the underlying issue and error to
emerge.
  • Loading branch information
dkubek committed Apr 10, 2024
1 parent b65ef94 commit f3aa2e1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ do_upgrade() {
local dirname
dirname="$("$NEWROOT/bin/dirname" "$NEWROOT$LEAPP_FAILED_FLAG_FILE")"
[ -d "$dirname" ] || mkdir "$dirname"

echo >&2 "Creating file $NEWROOT$LEAPP_FAILED_FLAG_FILE"
echo >&2 "Warning: Leapp upgrade failed and there is an issue blocking the upgrade."
echo >&2 "If possible, try to boot to the original system or restore the system from a backup."
echo >&2 "Please file a support case with $NEWROOT/var/log/leapp/leapp-upgrade.log attached"

"$NEWROOT/bin/touch" "$NEWROOT$LEAPP_FAILED_FLAG_FILE"
fi

Expand Down Expand Up @@ -358,10 +364,9 @@ mount -o "remount,rw" "$NEWROOT"
# check if leapp previously failed in the initramfs, if it did return to the emergency shell
[ -f "$NEWROOT$LEAPP_FAILED_FLAG_FILE" ] && {
echo >&2 "Found file $NEWROOT$LEAPP_FAILED_FLAG_FILE"
echo >&2 "Error: Leapp previously failed and cannot continue, returning back to emergency shell"
echo >&2 "Warning: Leapp failed on a previous execution and something might be blocking the upgrade."
echo >&2 "If possible, try to boot to the original system or restore the system from a backup."
echo >&2 "Please file a support case with $NEWROOT/var/log/leapp/leapp-upgrade.log attached"
echo >&2 "To rerun the upgrade upon exiting the dracut shell remove the $NEWROOT$LEAPP_FAILED_FLAG_FILE file"
exit 1
}

[ ! -x "$NEWROOT$LEAPPBIN" ] && {
Expand Down

0 comments on commit f3aa2e1

Please sign in to comment.