Bug 53578 - App Settings broken for installation
App Settings broken for installation
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Felix Botner
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-07-14 13:57 CEST by Felix Botner
Modified: 2021-07-21 10:49 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 4: Will affect most installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.183
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 2021-07-14 13:57:16 CEST
example relution io, this app has a required settings for the installation

app installation fails
 10290 actions.configure                21-07-14 12:10:23 [    INFO]: Configuring relution=5.3
 10290 settings                         21-07-14 12:10:23 [    INFO]: Setting HOSTNAME to 'https://master.five.new'
 10290 actions.configure                21-07-14 12:10:23 [CRITICAL]: Failed to configure: Relution: SYSTEM_ADMIN_PASSWORD is required
 10290 actions.configure.progress       21-07-14 12:10:23 [   DEBUG]: 100
 10290 packages                         21-07-14 12:10:23 [   DEBUG]: Releasing LOCK
 10290 actions.install                  21-07-14 12:10:23 [CRITICAL]: Failed to configure: Relution: SYSTEM_ADMIN_PASSWORD is required
 10290 actions.install                  21-07-14 12:10:23 [ WARNING]: Aborting...
 10290 actions.remove                   21-07-14 12:10:23 [   DEBUG]: Calling remove

although SYSTEM_ADMIN_PASSWORD has been set during the installation 

UMC json
{"options":{"apps":["relution"],"auto_installed":[],"action":"install","hosts":{"master.five.new":["relution"]},"settings":{"relution":{"HOSTNAME":"https://master.five.new","SYSTEM_ADMIN_PASSWORD":"univention","ORGA_NAME":"Orga1","ORGA_FULLNAME":"Organisation 1","ORGA_REPLYTOMAIL":"relution@master.five.new","ORGA_CONTACT_NAME":"Relution Support","ORGA_CONTACT_EMAIL":"relution@master.five.new","ORGA_ADMIN_USERNAME":"admin","ORGA_ADMIN_PASSWORD":"univention","ORGA_ADMIN_GIVENNAME":"admin","ORGA_ADMIN_SURNAME":"admin","ORGA_ADMIN_EMAIL":"orgaadmin@master.five.new","SMTP_HOST":"localhost","SMTP_PORT":"25","SMTP_USERNAME":"","SMTP_PASSWORD":"","SMTP_SSL":false,"SMTP_TTLS":false}},"dry_run":false}}

-> SYSTEM_ADMIN_PASSWORD is set, OK

But  Configure.main.args.set_vars in the backend is

set_vars = {
	'relution': {
		'HOSTNAME': 'https://master.five.new',
		'SYSTEM_ADMIN_PASSWORD': 'univention',
		...
		'ORGA_ADMIN_USERNAME': 'admin',
		'ORGA_ADMIN_PASSWORD': 'univention',
		'ORGA_ADMIN_GIVENNAME': 'admin',
		'ORGA_ADMIN_SURNAME': 'admin', 
		...
		'SMTP_TTLS': False
	}, 
	'HOSTNAME': 'https://master.five.new', 
	'SYSTEM_ADMIN_PASSWORD': None, 
	'ORGA_NAME': 'Orga1',
	'ORGA_FULLNAME': 'Organisation 1',
	'ORGA_REPLYTOMAIL': 'relution@master.five.new',
	'ORGA_CONTACT_NAME': 'Relution Support',
	'ORGA_CONTACT_EMAIL': 'relution@master.five.new',
	'ORGA_ADMIN_USERNAME': None,
	'ORGA_ADMIN_PASSWORD': None,
	'ORGA_ADMIN_GIVENNAME': None,
	'ORGA_ADMIN_SURNAME': None,
	'ORGA_ADMIN_EMAIL': 'orgaadmin@master.five.new',
	'SMTP_HOST': 'localhost',
	'SMTP_PORT': '25',
	'SMTP_USERNAME': None,
	'SMTP_PASSWORD': None,
	'SMTP_SSL': 'False',
	'SMTP_TTLS': 'False',
	'docker/host/name': 'master.five.new',
	'ldap/hostdn': 'cn=relut-02811855,cn=memberserver,cn=computers,dc=five,dc=new',
	...
}

All "configured" settings are within the key "relution" and the other settings are just the defaults, and these "defaults" are used
Comment 1 Felix Botner univentionstaff 2021-07-14 14:02:51 CEST
settings in the UMC backend is now a dict with 

{
 app_id: {
  setting=val
  setting=val
 }
}

and _run_local just passes this dict as set_vars to action.call, but action.call wants a settings dict like

{
 setting=val
 setting=val
}

so a simple fix could be

diff --git a/management/univention-appcenter/umc/python/appcenter/__init__.py b/management/univention-appcenter/umc/python/appcenter/__init__.py
index 2c917a1084..1f9fe4b28b 100644
--- a/management/univention-appcenter/umc/python/appcenter/__init__.py
+++ b/management/univention-appcenter/umc/python/appcenter/__init__.py
@@ -320,8 +320,9 @@ class Instance(umcm.Base, ProgressMixin):
                        'noninteractive': True,
                        'auto_installed': auto_installed,
                        'skip_checks': ['shall_have_enough_ram', 'shall_only_be_installed_in_ad_env_with_password_service', 'must_not_have_concurrent_operation'],
-                       'set_vars': settings,
                }
+               if settings.get(app.id):
+                       kwargs['set_vars'] = settings[app.id]
                if action == 'install':
                        progress.title = _('Installing %s') % (app.name,)
                elif action == 'remove':
Comment 3 Felix Botner univentionstaff 2021-07-19 12:40:27 CEST
969253952e94ac2f9e3dc6f5327b8a0be689154f - univention-appcenter
d08befda660e626376ec5e6064bec66546080482 - yaml
Comment 4 Dirk Wiesenthal univentionstaff 2021-07-20 16:03:19 CEST
Installation of Apps with settings now works (Wekan, Relution) and gives correct values in "univention-app configure wekan --list".

YAML: OK
Comment 5 Erik Damrose univentionstaff 2021-07-21 10:49:44 CEST
<https://errata.software-univention.de/#/?erratum=5.0x51>