Bug 51880 - block update to next version if postup.sh failed
block update to next version if postup.sh failed
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-5-errata
Assigned To: Florian Best
Jürn Brodersen
https://help.univention.com/t/what-to...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-21 12:44 CEST by Florian Best
Modified: 2020-08-26 16:35 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-08-21 12:44:27 CEST
The update to the next version should be blocked if the previous upgrade failed, e.g. because the postup.sh execution failed.
(postup.sh never fails, but the team/PO wants this...)

Additionally a link to an SDB article would be helpful.

The preup.sh should check the status.

Instead of setting UCR variables which describe the current updater step we can use the existing /var/lib/univention-updater/univention-updater.status which looks like:
"""
status=FAILED
errorsource=POSTUP
""" or "status=DONE".

This change should be done because Bug #46465 changed that version/version is set before postup.sh is executed. So when the postup.sh fails the version/version is not the old version and one can simply upgrade to the next version instead if repeating the update. In UCS 5 the repository structure changes so that when we would revert version/version to the old version, the sources.list would be build with the new pool structure which is not compatible with version=4.4.
Comment 1 Florian Best univentionstaff 2020-08-21 13:31:59 CEST
univention-updater.yaml
f9f6721a5421 | YAML Bug #51880

univention-updater (14.0.2-17)
633a67967953 | Bug #51880: fix typo
449a36fb64e8 | Bug #51880: block upgrade if previous postup.sh failed
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2020-08-23 21:39:21 CEST
Please hide the grep error message if univention-updater.status does not exist:

HINT:
Please check the release notes carefully BEFORE updating to UCS :
 English version: https://docs.software-univention.de/release-notes--en.html
 German version:  https://docs.software-univention.de/release-notes--de.html

Please also consider documents of following release updates and
3rd party components.

Do you want to continue [Y/n]? 

Checking for space on /var/cache/apt/archives: OK
Checking for space on /boot: OK
Checking for space on /: OK
Checking for package status: OK
Checking LDAP schema: OK
grep: /var/lib/univention-updater/univention-updater.status: Datei oder Verzeichnis nicht gefunden

Starting update process, this may take a while.
Check /var/log/univention/updater.log for more information.
Comment 3 Florian Best univentionstaff 2020-08-24 09:57:10 CEST
univention-updater (14.0.2-18)
2ec8b7aa64eb | Bug #51880: ignore not existing status file
Comment 4 Florian Best univentionstaff 2020-08-25 10:49:40 CEST
The status file is already overwritten in the preup.sh.
Therefore the logic has been move into univention-updater.

univention-updater (14.0.2-19)
78261412a39a | Bug #51880: move logic to univention-updater
Comment 5 Jürn Brodersen univentionstaff 2020-08-25 12:44:39 CEST
Ok works now
[4.4-5 799148c049] Bug #51880: Update dev docu
[4.4-5 d20a7e9643] Bug #51880: yaml