Bug 40458 - UMC Software Update shows valid release update as the invalid one
UMC Software Update shows valid release update as the invalid one
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-2-errata
Assigned To: Philipp Hahn
Dirk Wiesenthal
:
Depends on: 37028 37029
Blocks: 41866
  Show dependency treegraph
 
Reported: 2016-01-19 11:02 CET by Dirk Wiesenthal
Modified: 2016-08-03 15:56 CEST (History)
5 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

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2016-01-19 11:02:56 CET
UCS 3.2-7 wants to update. Existing release updates: UCS 3.2-8, 4.0-x, 4.1-0

UCS 3.2-7 has an outdated version of an App installed that was released for UCS 4.0, but not for UCS 4.1.

Expected result: UCS 3.2-8, 4.0-x is available, UCS 4.1-0 is not.
Actual result: Like expected but there is a sentence that says: "3.2-8 is available, but your App [...] is not yet released for it and therefore 3.2-8 may not be installed. Please remove the App"

3.2-8 is actually available in the list, but the sentence is super confusing, as 4.0-4 is preselected. You need to know that despite the sentence 3.2-8 is available AND you need to be brave enough to install 3.2-8 although the system says it is impossible. Currently happens for OX App Suite.

The problem is:
try:
	result['release_update_available'] = self.uu.release_update_available(errorsto='exception')
except RequiredComponentError as exc:
	result['release_update_available'] = exc.version

Here, exc.version is 3.2-8, not 4.1-0. So this is a bug in the underlying lib. I think the code in UMC is correct.
Comment 1 Jens Thorp-Hansen univentionstaff 2016-03-08 11:01:29 CET
Customer asked again: Ticket#2016011521000348
Comment 2 Stefan Gohmann univentionstaff 2016-04-27 11:54:13 CEST
I think it has to be fixed for UCS 3.2-8.
Comment 3 Michael Grandjean univentionstaff 2016-05-02 15:38:37 CEST
Also Ticket#2016042821000363 (Nr. 8)

* UCS Version: 4.0-4
* Affected App: ownCloud 8
* Combobox shows "UCS 4.0-5" as available, but not 4.1-x
* Text says: 
"Version 4.0-5 is available but cannot be installed. For UCS 4.0-5 the application ownCloud 8 is not available in the currently installed version. You may wait for the app to be released for the new UCS version. Using the "App Center" module, you may also search for alternative apps or uninstall the application."
Comment 4 Philipp Hahn univentionstaff 2016-07-27 16:07:00 CEST
(In reply to Dirk Wiesenthal from comment #0)
> The problem is:
...
> Here, exc.version is 3.2-8, not 4.1-0. So this is a bug in the underlying
> lib. I think the code in UMC is correct.

No, the bug is in the UMC part introduced by r57403 in UCS-4.0-0 (so not present in 3.2-8):
> +»··var theoreticalReleaseUpdate = this._form.getWidget('release_update_available').get('value');

That's not the "theoretical" limit, but only the next release still being allowed:

$ ucr set update33/skip/ucs3.3=true version/{version=3.2,patchlevel=8} repository/online/component/xrdp{=enabled,/description=Xrdp,/server=appcenter.software-univention.de,/unmaintained=disabled,/version=current,/localmirror=false}
$ python
 from univention.updater.tools import UniventionUpdater
 u = UniventionUpdater()
 u.release_update_available(errorsto='exception')
# '4.0-0'
 u.get_all_available_release_updates()
# (['4.0-0', '4.0-1', '4.0-2', '4.0-3', '4.0-4', '4.0-5'], set(['xrdp']))

So the updater is telling you, that the next immediate working update is to "4.0-0" and it could even go up to "4.0-5" (in steps) right now, but not further, as the next updater after "4.0-5" (which would be 4.1-0) is currently blocked by the missing component "xrdp".

(If you compare univention.updater.tools.UniventionUpdater.get_all_available_release_updates() with release_update_available() you will see that the rua() is a simplified variant of gaaru(), which returns *only the next* releases, while gaaru() returns information about *all following* releases.)

What the code actually should do is to check if there are further updates, if all required components are disabled:

$ ucr set repository/online/component/xrdp=disabled
$ python -c 'from univention.updater.tools import UniventionUpdater as U;u=U();print u.get_all_available_release_updates()'
(['4.0-0', '4.0-1', '4.0-2', '4.0-3', '4.0-4', '4.0-5', '4.1-0', '4.1-1', '4.1-2'], None)

$ ucr set version/{version=4.1,patchlevel=1} repository/online/component/uvmm-ec2{=enabled,/description=uvmm-ec2,/server=appcenter.software-univention.de,/unmaintained=disabled,/version=current,/localmirror=false}
$ python -c 'from univention.updater.tools import UniventionUpdater as U;u=U();print u.get_all_available_release_updates()'
(['4.1-2'], None)

$ ucr set version/{version=4.1,patchlevel=2}
$ python -c 'from univention.updater.tools import UniventionUpdater as U;u=U();print u.get_all_available_release_updates()'
([], None)

$ umc-command -U Administrator -P univention -r updater/updates/get

r71270 | Bug #40458 up: Fix confusing update message about next blocked release

Package: univention-updater
Version: 11.0.10-3.1480.201607271601
Branch: ucs_4.1-0
Scope: errata4.1-2

r71271 | Bug #40458 up: Fix confusing update message about next blocked release YAML
 univention-updater.yaml
Comment 5 Dirk Wiesenthal univentionstaff 2016-07-28 01:11:09 CEST
OK, I see. UMC code is broken.

The correct code would be a copy of gaaru() but with ones own "error handling": Instead of returning the accumulated versions, one should use exc.version.

ucs_version = uu.current_version
components = uu.get_current_components()
while ucs_version:
  try:
    uu.get_next_version(UCS_Version(ucs_version), components, errorsto='exception')
  except ...

To be correct, one would need a new variable name for the blocked release.

Code: OK
YAML: OK

Note that this was not introduced in 4.0.0. The related bugs are 3.2-4 errata. I will clone this bug. After 3 more months, maybe the fix is not necessary anymore.
Comment 6 Janek Walkenhorst univentionstaff 2016-08-03 15:56:35 CEST
<http://errata.software-univention.de/ucs/4.1/226.html>