Bug 1111786

Summary: quit() tries to remove current snapshot
Product: [openSUSE] openSUSE Tumbleweed Reporter: Thorsten Kukuk <kukuk>
Component: KubicAssignee: Ignaz Forster <iforster>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: kukuk
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: transactional-update.log

Description Thorsten Kukuk 2018-10-15 07:21:28 UTC
Created attachment 785936 [details]

g126.suse.de is running openSUSE Kubic with nightly automatic updates and reboots via rebootmgrd.

In the logs I saw know:

2018-10-13 00:36 Trying to rebuild kdump initrd
2018-10-13 00:36 transactional-update finished - rebooting machine
2018-10-13 00:36 Removing snapshot #26...
Deleting snapshot failed.
2018-10-13 00:36 Removing snapshot #25...
2018-10-13 00:36 transactional-update finished

That's the "quit()" routine, why does it thinks it has to remove the current snapshot?
Comment 1 Ignaz Forster 2018-10-15 08:58:58 UTC
quit() is called when prematurely exiting the application, so it will try to revert everything it has done. On successful completion the teardown() routine is used instead.

Is this error happening with the upstream transactional-update, or is this a modified version? I've just verified that every time quit() is called an error message is printed, so the attached log should not be possible...
Comment 2 Thorsten Kukuk 2018-10-15 09:24:25 UTC
g126:~ # rpm -qi transactional-update 
Name        : transactional-update
Version     : 2.6
Release     : 2.1
Architecture: x86_64
Install Date: Tue Oct  2 07:12:02 2018

It's what currently is in Factory, it was a plain openSUSE Kubic installation.
And I agree that this log should not be possible,that's why I created the bug ...

Could it be that the log file is not written in the correct order?

reboot_via_systemd() {
    log_info "transactional-update finished - rebooting machine"
    systemctl reboot |& tee -a ${LOGFILE}
    exit 0

Or is it coming from the self-update?
Comment 3 Thorsten Kukuk 2018-10-15 09:25:43 UTC
2018-10-13 00:36 Removing snapshot #26...
Deleting snapshot failed.
2018-10-13 00:36 Removing snapshot #25...

Snapshot #25 is clearly missing on the system.
Comment 4 Ignaz Forster 2018-10-15 14:39:54 UTC
That's interesting. There's exactly one condition when quit is called without a message in the log file, and this is when it receives a termination signal. It seems systemd is faster to send termination signals to all processes than the transactional-update Bash script can complete the next line where it would just exit.
Comment 6 Ignaz Forster 2018-10-23 14:45:48 UTC
Fixed by unsetting the error handling traps before initiating a reboot.

Will be available in transactional-update 2.10 (https://github.com/openSUSE/transactional-update/commit/6c9359fb6841ffea835fc7e2c0d56dac5da1260d)
Comment 7 Swamp Workflow Management 2018-11-23 14:31:03 UTC
This is an autogenerated message for OBS integration:
This bug (1111786) was mentioned in
https://build.opensuse.org/request/show/651388 15.0 / transactional-update
Comment 8 Swamp Workflow Management 2018-12-07 23:10:03 UTC
openSUSE-RU-2018:4027-1: An update that has 6 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1088676,1097619,1105992,1111319,1111321,1111786
CVE References: 
Sources used:
openSUSE Leap 15.0 (src):    transactional-update-2.11-lp150.2.9.1
openSUSE Backports SLE-15 (src):    transactional-update-2.11-bp150.2.6.1
Comment 9 Ignaz Forster 2018-12-11 11:04:15 UTC
Fix released in all affected products.