Bug 44821 - Updater should remove sources.list entry of the new release if the master still uses the old UCS version
Updater should remove sources.list entry of the new release if the master sti...
Status: RESOLVED FIXED
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Philipp Hahn
Stefan Gohmann
:
Depends on:
Blocks: 45328
  Show dependency treegraph
 
Reported: 2017-06-20 07:19 CEST by Stefan Gohmann
Modified: 2017-09-20 18:04 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 4: A User would return the product
User Pain: 0.229
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2017-06-20 07:19:35 CEST
The updater should remove the sources list entry of the new release if the upgrade didn't really start for example if the master hasn't been updated or the ignoressh parameter is missing:

root@slave423:~# ls /etc/apt/sources.list.d/*
/etc/apt/sources.list.d/15_ucs-online-version.list  /etc/apt/sources.list.d/20_ucs-online-component.list
root@slave423:~# univention-upgrade --ignoressh --ignoreterm

Starting univention-upgrade. Current UCS version is 4.2-0 errata45

Checking for local repository:                          none
Checking for package updates:                           none
Checking for app updates:                               none
Checking for release updates:                           found: UCS 4.2-1
Do you want to update to 4.2-1 [Y|n]? y

Starting update to UCS version 4.2-1

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

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

Do you want to continue [Y/n]? y

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
WARNING: Your domain controller master is still on version 4.2-0.
         It is strongly recommended that the domain controller master is
         always the first system to be updated during a release update.
This check can be skipped by setting the UCR
variable update42/ignore_version to yes.
Error: Please check "/var/log/univention/updater.log" for details.
ERROR: update failed. Please check /var/log/univention/updater.log

root@slave423:~# cat /etc/apt/sources.list.d/00_ucs_update_in_progress.list 
deb http://apt.knut.univention.de/4.2/maintained/ 4.2-1/all/
deb http://apt.knut.univention.de/4.2/maintained/ 4.2-1/amd64/
root@slave423:~#
Comment 1 Philipp Hahn univentionstaff 2017-06-23 08:22:59 CEST
r80435 | Bug #44821 up: Remove temporary sources list on preup failure

Package: univention-updater
Version: 12.0.11-2A~4.2.0.201706230818
Branch: ucs_4.2-0
Scope: errata4.2-1

r80437 | Bug #44821, Bug #44842 updater.yaml
r80436 | Bug #44821, Bug #44842 updater.yaml
Comment 2 Philipp Hahn univentionstaff 2017-06-23 09:37:57 CEST
For QA: I copied the updated scripts to the test mirrors; after QA they must be copied to the public mirror (mirror/ftp) as well:

cd /var/univention/buildsystem2/test_mirror/ftp/4.2/maintained/4.2-1/all
cp -v ~/GIT2/base/univention-updater/script/p*up.sh .
repo-ng-sign-release-file -i preup.sh -o preup.sh.gpg -p /etc/archive-keys/ucs4.0.txt -k 6B8BFD3C
repo-ng-sign-release-file -i postup.sh -o postup.sh.gpg -p /etc/archive-keys/ucs4.0.txt -k 6B8BFD3C

cd /var/univention/buildsystem2/mirror/testing/4.2/maintained/4.2-1/all
cp -v ~/GIT2/base/univention-updater/script/p*up.sh .
repo-ng-sign-release-file -i preup.sh -o preup.sh.gpg -p /etc/archive-keys/ucs4.0.txt -k 6B8BFD3C
repo-ng-sign-release-file -i postup.sh -o postup.sh.gpg -p /etc/archive-keys/ucs4.0.txt -k 6B8BFD3C
sudo update_mirror.sh -v testing/4.2/maintained/4.2-1/all
Comment 3 Stefan Gohmann univentionstaff 2017-07-25 06:57:53 CEST
Code review: OK

Tests: OK

UCS test: OK

YAML: OK
Comment 4 Arvid Requate univentionstaff 2017-08-30 16:29:40 CEST
<http://errata.software-univention.de/ucs/4.2/151.html>
Comment 5 Felix Botner univentionstaff 2017-09-19 14:57:31 CEST
seems that this is not yet published.

I need to make changes to the 4.2-1 postup.sh for Bug #45328 but there are changes on the testing/4.2/maintained/4.2-1/all/postup.sh script:

diff -Nur ftp/4.2/maintained/4.2-1/all/postup.sh testing/4.2/maintained/4.2-1/all/postup.sh
--- ftp/4.2/maintained/4.2-1/all/postup.sh	2017-06-20 16:47:09.846276213 +0200
+++ testing/4.2/maintained/4.2-1/all/postup.sh	2017-09-12 17:04:43.476689765 +0200
@@ -156,6 +156,12 @@
 	repository/online/component/4.2-1-errata/description="Errata updates for UCS 4.2-1" \
 	repository/online/component/4.2-1-errata/version="4.2" >>"$UPDATER_LOG" 2>&1
 
+# Bug 45328
+# update/register appcenter at this point because 4.2-0 postup still is in 4.1 mode
+univention-app update || true
+univention-app register --app || true
+# Bug 45328
+
 # run remaining joinscripts
 if [ "$server_role" = "domaincontroller_master" ]; then
 	univention-run-join-scripts >>"$UPDATER_LOG" 2>&1
@@ -189,7 +195,4 @@
 service apache2 restart >>"$UPDATER_LOG" 2>&1
 EOF
 
-# Bug #44346: Pin temporary sources list
-rm -f /etc/apt/sources.list.d/00_ucs_update_in_progress.list
-
Comment 6 Philipp Hahn univentionstaff 2017-09-20 18:04:51 CEST
sudo update_mirror.sh -v ftp/4.2/maintained/4.2-1/all