Bug 30417 - univention-upgrade should suggest App Center updates
univention-upgrade should suggest App Center updates
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 4.0
Other Linux
: P5 enhancement (vote)
: UCS 4.0-3-errata
Assigned To: Philipp Hahn
Stefan Gohmann
:
: 39287 (view as bug list)
Depends on: 38697 39284 39287
Blocks: 33144 39082 39839
  Show dependency treegraph
 
Reported: 2013-02-13 11:43 CET by Ingo Steuwer
Modified: 2015-11-10 10:16 CET (History)
7 users (show)

See Also:
What kind of report is it?: ---
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):
Max CVSS v3 score:


Attachments
Poposed patch for updater (3.70 KB, patch)
2015-06-12 12:50 CEST, Philipp Hahn
Details | Diff
univention-upgrade.patch (2.74 KB, patch)
2015-07-13 19:33 CEST, Dirk Wiesenthal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Steuwer univentionstaff 2013-02-13 11:43:08 CET
Using "univention-upgrade" or the Online Update UMC Module tells the user the system is up to date even if there are updates in the App Center available. It would be easier for the user to be informed about available updates or at least to be informed about the other tool/UMC-module to check for updates.
Comment 1 Ingo Steuwer univentionstaff 2013-02-13 14:44:43 CET
Occured at a customer, too.
Comment 2 Moritz Muehlenhoff univentionstaff 2013-05-31 10:45:20 CEST
We will not ship a UCS 3.1-2 release; the next UCS release will be UCS 3.2.

As such, this bug is moved to the new target milestone.
Comment 3 Moritz Muehlenhoff univentionstaff 2013-06-14 14:05:39 CEST
This led to a broken system for customer 05520: 

DRBD was installed from the App Center, univention-upgrade installed the kernel errata update, but after the update the compatible drbd kernel module wasn't available and the in-kernel module was selected. That module is incompatible with the DRBD userland tools and refused to work, so that data partition couldn't be mounted.
Comment 4 Stefan Gohmann univentionstaff 2013-07-18 15:37:38 CEST
The README_*UPDATE should be shown during the upgrade.
Comment 5 Jan Christoph Ebersbach univentionstaff 2013-11-06 11:21:55 CET
This issue was mentioned also at ticket #2013091121001471.
Comment 6 Stefan Gohmann univentionstaff 2015-02-04 07:55:20 CET
Still valid with UCS 4.0
Comment 7 Stefan Gohmann univentionstaff 2015-05-11 10:55:00 CEST
@Dirk, can you give a short overview about the App Center API so that Philipp can integrate it into univention-upgrade?
Comment 8 Philipp Hahn univentionstaff 2015-06-12 12:50:54 CEST
Created attachment 6958 [details]
Poposed patch for updater

Currently not applicable, as the function in UMC is not yet committed.
Comment 9 Dirk Wiesenthal univentionstaff 2015-07-13 19:33:08 CEST
Created attachment 7022 [details]
univention-upgrade.patch

This is what I used to test Bug#38697
Comment 10 Dirk Wiesenthal univentionstaff 2015-08-05 00:42:22 CEST
(In reply to Dirk Wiesenthal from comment #9)
> Created attachment 7022 [details]
> univention-upgrade.patch
> 
> This is what I used to test Bug#38697

Sorry, the patch is broken. You need to initialize
  run_app = False
in the first line after "for app in new_apps:"
Comment 11 Dirk Wiesenthal univentionstaff 2015-08-05 00:54:40 CEST
And ask for credentials after telling why they are needed. See Bug#38697 Comment 7

Username and password file can be passed to app_upgrade.call(username=..., pwdfile=...)
Comment 12 Philipp Hahn univentionstaff 2015-08-28 15:27:07 CEST
r63317 | Bug #30417 updater: Add App update support
r63316 | Bug #30417 updater: Rework argument passing
r63315 | Bug #30417 updater: Fix Python issues
r63314 | Bug #30417 updater: Add App update support
r63313 | Bug #30417 updater: Rework argument passing
r63312 | Bug #30417 updater: Fix Python issues
 Patch updated and applied
 Added lots of error handling

Package: univention-updater
Version: 10.0.55-3.1400.201508281517
Branch: ucs_4.0-0
Scope: errata4.0-3

Package: univention-updater
Version: 11.0.1-2.1399.201508281517
Branch: ucs_4.1-0


FYI: Testes with xrdp app
OK: univention-upgrade
OK: univention-upgrade --skip-apps
OK: univention-upgrade --noninteractive
OK: univention-upgrade --noninteractive --username=... --pwdfile=..
OK: univention-upgrade --username=... --pwdfile=..
FYI: Credentials are not validated by updater - admin is supposed to know what he/she is doing.

r63318 | Bug #30417 updater: Add App update support YAML
 2015-08-28-univention-updater.yaml


(In reply to Dirk Wiesenthal from comment #10)
> Sorry, the patch is broken. You need to initialize
>   run_app = False
> in the first line after "for app in new_apps:"

That's wrong; should be True


(In reply to Dirk Wiesenthal from comment #11)
> And ask for credentials after telling why they are needed. See Bug#38697
> Comment 7
> 
> Username and password file can be passed to app_upgrade.call(username=...,
> pwdfile=...)

Providing a wrong username/password still seems to work - broken backend code?
Comment 13 Philipp Hahn univentionstaff 2015-09-07 09:16:33 CEST
r63473 | Bug #30417 updater: Add App update support
r63472 | Bug #30417 updater: Add App update support

TODO: fix credentials issue
TODO: build
Comment 14 Philipp Hahn univentionstaff 2015-09-15 10:23:56 CEST
*** Bug 39287 has been marked as a duplicate of this bug. ***
Comment 15 Philipp Hahn univentionstaff 2015-09-15 10:26:19 CEST
r63693 | Bug #30417 updater: Ignore app center unavailable
r63692 | Bug #30417 updater: Ignore app center unavailable
 Ignore App Center exception

Package: univention-updater
Version: 10.0.55-4.1406.201509151021
Branch: ucs_4.0-0
Scope: errata4.0-3

Package: univention-updater
Version: 11.0.2-3.1405.201509151021
Branch: ucs_4.1-0

r63694 | Bug #30417 updater: Ignore app center unavailable YAML
 2015-08-28-univention-updater.yaml
Comment 16 Erik Damrose univentionstaff 2015-09-22 15:36:41 CEST
I am unsure if the bug should be reopened because of the following issue, resolve it again if this is considered a minor issue.

If i try univention-upgrade on a unjoined system, univention-upgrade prints

[...]
Checking for release updates:                           none
Checking for package updates:                           none
Checking for app updates:                               skipped
Error: /etc/machine.secret not found

I think we should check if the system is joined, and only then print the error message.
Comment 17 Philipp Hahn univentionstaff 2015-09-25 12:07:57 CEST
(In reply to Erik Damrose from comment #16)
> If i try univention-upgrade on a unjoined system, univention-upgrade prints
> 
> [...]
> Checking for release updates:                           none
> Checking for package updates:                           none
> Checking for app updates:                               skipped
> Error: /etc/machine.secret not found

This is a bug in "univention-check-joins-status" which is called by the updater:

# mv machine.secret X
# univention-check-join-status 
Error: /etc/machine.secret not found
# dpkg -S univention-check-join-status
univention-join: /usr/sbin/univention-check-join-status

While fixing that, the test also needs to be skipped on "server/role=basesystem"
Comment 18 Stefan Gohmann univentionstaff 2015-10-03 14:27:22 CEST
See Bug #39405#c2, the output of univention-updater is now confusing.

> This is a bug in "univention-check-joins-status" which is called by the
> updater:
> 
> # mv machine.secret X
> # univention-check-join-status 
> Error: /etc/machine.secret not found

I'm not sure if it is really a bug in univention-check-join-status. That is the target of the tool.

We should either remove univention-check-join-status from univention-upgrade or we shouldn't print the messages of univention-check-join-status directly to the console.
Comment 19 Philipp Hahn univentionstaff 2015-10-05 09:33:14 CEST
(In reply to Stefan Gohmann from comment #18)
> See Bug #39405#c2, the output of univention-updater is now confusing.
> 
> > This is a bug in "univention-check-joins-status" which is called by the
> > updater:
> > 
> > # mv machine.secret X
> > # univention-check-join-status 
> > Error: /etc/machine.secret not found
> 
> I'm not sure if it is really a bug in univention-check-join-status. That is
> the target of the tool.

See Bug #39405 comment 3

> We should either remove univention-check-join-status from univention-upgrade
> or we shouldn't print the messages of univention-check-join-status directly
> to the console.

r64204 | Bug #30417 updater: Remove join status check

Package: univention-updater
Version: 11.0.2-6.1408.201510050855
Branch: ucs_4.1-0
Comment 20 Stefan Gohmann univentionstaff 2015-10-26 09:02:16 CET
YAML: OK (small adjustments with r64836 because perfroma is no English word and the updates are not installed by default).

ucs-test: OK

Tests without App update: Fail

(In reply to Philipp Hahn from comment #19) 
> > We should either remove univention-check-join-status from univention-upgrade
> > or we shouldn't print the messages of univention-check-join-status directly
> > to the console.
> 
> r64204 | Bug #30417 updater: Remove join status check
> 
> Package: univention-updater
> Version: 11.0.2-6.1408.201510050855
> Branch: ucs_4.1-0

root@member404:~# mv /etc/machine.secret /etc/machine.secret2
root@member404:~# univention-upgrade --enable-app-updates

Starting univention-upgrade. Current UCS version is 4.0-3 errata342

Checking for local repository:                          none
Checking for release updates:                           none
Checking for package updates:                           none
Checking for app updates:                               unavailable
Error: /etc/machine.secret not found
root@member404:~# 

→ Please merge r64204 from UCS 4.1 to 4.0-3-errata.

Tests with more than one App update: TODO

Tests on a member server: TODO

Release upgrade via UMC: TODO
Comment 21 Philipp Hahn univentionstaff 2015-10-26 10:48:39 CET
(In reply to Stefan Gohmann from comment #20)
> Error: /etc/machine.secret not found
...
> → Please merge r64204 from UCS 4.1 to 4.0-3-errata.

r64840 | Bug #30417 updater: Remove join status check

Package: univention-updater
Version: 10.0.55-5.1418.201510261045
Branch: ucs_4.0-0
Scope: errata4.0-3

r64841 | Bug #30417 updater: Remove join status check CL
 2015-08-28-univention-updater.yaml
Comment 22 Stefan Gohmann univentionstaff 2015-10-26 21:29:58 CET
(In reply to Philipp Hahn from comment #21)
> (In reply to Stefan Gohmann from comment #20)
> > Error: /etc/machine.secret not found
> ...
> > → Please merge r64204 from UCS 4.1 to 4.0-3-errata.
> 
> r64840 | Bug #30417 updater: Remove join status check
> 
> Package: univention-updater
> Version: 10.0.55-5.1418.201510261045
> Branch: ucs_4.0-0
> Scope: errata4.0-3
> 
> r64841 | Bug #30417 updater: Remove join status check CL
>  2015-08-28-univention-updater.yaml

OK, that looks good now.

But the App upgrade does not work. I've installed the following versions:

univention-updater 10.0.55-5.1418.2015102610
univention-management-console-module-appcenter 4.1.20-49.432.201509171525

"Checking for app updates" shows always the status unavailable:

root@master401:~# univention-upgrade --enable-app-updates

Starting univention-upgrade. Current UCS version is 4.0-3 errata342

Checking for local repository:                          none
Checking for release updates:                           none
Checking for package updates:                           none
Checking for app updates:                               unavailable
root@master401:~# 

This import fails which leads to the unavailable status:

root@master401:~# python2.7 -c 'from univention.appcenter.app_center import AppcenterServerContactFailed'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named app_center
root@master401:~#
Comment 23 Dirk Wiesenthal univentionstaff 2015-10-27 00:58:38 CET
Fixed ImportError in
  univention-updater 10.0.55-6.1421.201510270053

Also silenced UCR's print statements during update search. Don't know if this is enough, though.
Comment 24 Stefan Gohmann univentionstaff 2015-10-27 06:35:32 CET
(In reply to Stefan Gohmann from comment #20)
> Tests with more than one App update: TODO

→ OK

> Tests on a member server: TODO

→ OK
 
> Release upgrade via UMC: TODO

→ OK

Non interactive upgrade: OK

(In reply to Dirk Wiesenthal from comment #23)
> Fixed ImportError in
>   univention-updater 10.0.55-6.1421.201510270053

→ I've added the new version to the YAML file.
 
> Also silenced UCR's print statements during update search. Don't know if
> this is enough, though.

Not really, but I think we should start with this version:
---------------------------------------------------------------------
root@master401:~# univention-upgrade --enable-app-updates

Starting univention-upgrade. Current UCS version is 4.0-3 errata342

Checking for local repository:                          none
Checking for release updates:                           none
Checking for package updates:                           none
Checking for app updates:                               found

The following apps can be updated:

Dudle: Version 1.0.0-1 can be updated to 1.0.0-2
ownCloud 8: Version 8.0.3 can be updated to 8.0.8

Starting app upgrade                                   
Do you want to upgrade Dudle [Y|n]? y

                           Dudle 1.0.0-2 Update Notes

Bug fixes

     * An encoding related issue made new dudle entries with non-ascii
       characters in the title unaccessible after creation. This release
       fixes it, the App now supports UTF-8 characters everywhere.
Press [ENTER] to continue
Username [Administrator]: 
Password for Administrator: 
File: /etc/apt/sources.list.d/20_ucs-online-component.list
File: /var/www/ucs-overview/entries.json
File: /etc/apt/mirror.list
File: /etc/apt/sources.list.d/15_ucs-online-version.list
File: /usr/share/univention-management-console/modules/apps.xml
File: /usr/share/univention-management-console/i18n/de/apps.mo
File: /etc/apt/apt.conf.d/55user_agent

Do you want to upgrade ownCloud 8 [Y|n]? y

Username [Administrator]: 
Password for Administrator: 
File: /etc/apt/sources.list.d/20_ucs-online-component.list
File: /var/www/ucs-overview/entries.json
File: /etc/apt/mirror.list
File: /etc/apt/sources.list.d/15_ucs-online-version.list
File: /usr/share/univention-management-console/modules/apps.xml
File: /usr/share/univention-management-console/i18n/de/apps.mo
File: /etc/apt/apt.conf.d/55user_agent
done
Setting update/available
root@master401:~#
---------------------------------------------------------------------
Comment 25 Janek Walkenhorst univentionstaff 2015-10-28 13:23:08 CET
<http://errata.software-univention.de/ucs/4.0/345.html>