Bug 37539 - add RequiredAppsDomain (app is required, but not on the localhost )
add RequiredAppsDomain (app is required, but not on the localhost )
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.0
Other Linux
: P5 enhancement (vote)
: UCS 4.1-0-errata
Assigned To: Dirk Wiesenthal
Felix Botner
Depends on:
  Show dependency treegraph
Reported: 2015-01-14 11:53 CET by Felix Botner
Modified: 2016-02-04 14:10 CET (History)
6 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): Roadmap discussion (moved)
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2015-01-14 11:53:41 CET
We should add an ini option RequiredAppsDomain. The apps in RequiredAppsDomain are required for the app, but it is sufficient if they are available in the domain (rather than on the localhost, as RequiredApps).

e.g. horde app and mailserver app, horde can be installed on a different server
Comment 1 Felix Botner univentionstaff 2015-03-11 12:06:19 CET
see ticket #2014110821000113
Comment 2 Nico Gulden univentionstaff 2015-05-27 10:23:25 CEST
Interesting for Ticket#2015051421000022, but required.
Comment 3 Dirk Wiesenthal univentionstaff 2015-12-10 17:57:14 CET
Needs to be implemented in the old and the new App class.
  univention-appcenter 5.0.19-24.84.201512101750


Can be combined with ConflictedApps=app1 which will result in a slightly different error message.

Checks whether the specified app is installed before installation.
Checks whether it is the last installation when apps are installed that rely on it.
Comment 4 Dirk Wiesenthal univentionstaff 2015-12-14 00:26:42 CET
Improved in
  univention-appcenter 5.0.19-28.86.201512140023
Comment 5 Felix Botner univentionstaff 2015-12-17 12:23:53 CET
horde_20150804.ini - RequiredAppsInDomain=mailserver, dudle-docker, fetchmail,drbd
dudle-docker.ini - RequiredAppsInDomain=mailserver

FAIL - tried to remove a app (horde with RequiredAppsInDomain=mailserver, dudle-docker, fetchmail,drbd
) on a slave/master

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/base.py", line 283, in execute
    function(self, request)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/__init__.py", line 300, in invoke_dry_run
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 656, in _decorated
    return function(self, request, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 190, in _response
    return function(self, request)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/__init__.py", line 478, in invoke
    forbidden, warnings = application.check_invokation(function, self.package_manager)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/app_center.py", line 1216, in check_invokation
    return _check(True), _check(False)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/app_center.py", line 1212, in _check
    reason = method(**kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/app_center.py", line 1163, in must_not_be_depended_on
    apps = [app for app in Application.get_all_apps() if self.id in app.get('requiredappsindomain')]
AttributeError: type object 'Application' has no attribute 'get_all_apps'

FAIL - at some point python-simplejson was deinstalled (due to apt-get autoremove?) and UMC appcenter wasn't usable any longer 

failed to load module appcenter: No module named simplejson
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/modserver.py", line 100, in _load_module
    self.__module = __import__(file_, [], [], modname)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/__init__.py", line 67, in <module>
    from app_center import Application, AppcenterServerContactFailed, LICENSE
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/app_center.py", line 68, in <module>
    from simplejson import loads
ImportError: No module named simplejson

univention-management-console-module-appcenter should depends on python-simplejson (this has probably nothing to do with this bug, but can easily fixed)

FAIL - error message in UMC

all i get in UMC is

  Error performing the action
  The requested action cannot be carried out. Please consider the information   
  listed below in order to resolve the problem and try again.

this does not help very much.

univention-add app says

  (must_have_no_unmet_dependencies) The application requires the following 
  applications: [{'local_allowed': True, 'in_domain': True, 
  'id': 'mailserver', 'name': 'Mailserver'}]
  Unable to install dudle-docker. Aborting

OK - RequiredAppsInDomain=mailserver (in dudle-docker)
     * installation forbidden
     * installed mailserver on a different ucs server
     * installation ok

OK - RequiredAppsInDomain=mailserver, dudle-docker, fetchmail,drbd (in horde)
     * installation forbidden
     * installed apps on different ucs servers
     * installation ok
Comment 6 Florian Best univentionstaff 2015-12-17 12:32:34 CET
AppCenter uses simplejson while not depending on it. The reason why this occurs now is that I removed it from system-setup which currently causes a lot of these errors (e.g. also in ucs-test).
Comment 7 Florian Best univentionstaff 2015-12-17 14:26:29 CET
I changed simplejson → json in svn r66433 so that the QA doesn't need to wait until Dirk is back.
Comment 8 Dirk Wiesenthal univentionstaff 2015-12-17 14:55:47 CET
there is one more issue with the patch
Comment 9 Dirk Wiesenthal univentionstaff 2015-12-18 02:26:19 CET
Should be fixed in
  univention-appcenter 5.0.19-33
Comment 10 Felix Botner univentionstaff 2015-12-18 15:59:37 CET
FAIL - remove app with dependecies
       * if i install app A (on server1) that depends on app B (on server1)
         i can't remove  app B as long as app A is installed - OK
       * but, if i installed app B on a different server (server2) and app A
         on server1, i can remove app B on server2,

OK - simplejson (no longer used)
OK - error message in UMC
     Dudle-docker benötigt die folgenden Applikationen.
     Mailserver (diese Applikation kann auf einem beliebigen Rechner
     in der Domäne installiert werden)
OK - RequiredAppsInDomain=mailserver (in dudle-docker)
OK - RequiredAppsInDomain=mailserver, dudle-docker, fetchmail,drbd (in horde)
Comment 11 Dirk Wiesenthal univentionstaff 2016-01-15 10:10:13 CET
I tried to reproduce it without success. In my tests, it worked. Could you please try again?
Comment 12 Felix Botner univentionstaff 2016-01-15 12:40:54 CET
(In reply to Dirk Wiesenthal from comment #11)
> I tried to reproduce it without success. In my tests, it worked. Could you
> please try again?

Yes, me neither (removed the wrong app)

Comment 13 Nico Gulden univentionstaff 2016-01-20 10:00:13 CET
Also interesting to have that feature for Ticket#2016012021000212.
Comment 14 Janek Walkenhorst univentionstaff 2016-02-04 14:10:47 CET