Bug 42934 - appcenter join script is copied to container during univention-app update in container
appcenter join script is copied to container during univention-app update in ...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-4-errata
Assigned To: Felix Botner
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-11 13:42 CET by Felix Botner
Modified: 2017-01-18 13:58 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
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.320
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 Felix Botner univentionstaff 2016-11-11 13:42:32 CET
docker apps:

The AppCenter join scripts (the ones in the repository) are supposed to run on the docker host, but an "univention-app updates" in the container copies these files (join script, unjoin , manybe others) into the containers /usr/lib/univention-install

@container-> univention-app  update
...
1 file(s) are new
Starting to download 1 file(s) directly
Copying /var/cache/univention-appcenter/egroupware_20161031104758.inst to /usr/lib/univention-install/50egroupware.inst

univention-run-join-script in the container now fails (the join script can't be executed in the container).

univention-check-join-status in the container gives an error (Error: Not all install files configured: 1 missing) and this is an indication for an App update:

@container -> /usr/share/univention-docker-container-mode/update_available
+ univention-check-join-status
+ '[' '!' 1 -eq 0 ']'
+ echo packages
packages

@host -> univention-upgrade --check
Checking for package updates:                           none
Checking for app updates:                               found
Please rerun command without --check argument to install.

But this update fails (of course) because the join script can not be successfully executed in the container, urgh

@host -> univention-upgrade 
Horde Groupware Webmail Edition: The underlying container can be upgraded
Starting app upgrade                                   
Do you want to upgrade Horde Groupware Webmail Edition [Y|n]? 
Username [Administrator]: 
Password for Administrator: 
ERROR: app upgrade failed. Please check /var/log/univention/updater.log

notice -> "The underlying container can be upgraded" - NO, join scripts are not executed

Even worse, univention-upgrade is aborted before release updates, so one has to ignore app updates (or use --disable-app-updates) in order to "release" update the docker host.

This should be easy to fix (do not copy appcenter files if univention-app is executed in the container), 
but man is this a complicated process, if something breaks in the appcenter/upgrade part, i think nobody except super duper univention-appcenter/docker/univention-upgrade experts are able to even find the problem ...
Comment 1 Felix Botner univentionstaff 2017-01-16 15:17:26 CET
Added utils.container_mode() (returns True if docker/container/uuid is set) and replaced ucr.get('docker/container/uuid') with container_mode() in univention-appcenter.

_update_local_files() returns if container_mode().

univention-appcenter: r75823
merged to 4.2-0
Comment 2 Dirk Wiesenthal univentionstaff 2017-01-17 11:02:51 CET
Changeset: OK
4.2: OK
YAML: OK
Comment 3 Janek Walkenhorst univentionstaff 2017-01-18 13:58:21 CET
<http://errata.software-univention.de/ucs/4.1/377.html>