Problem
When trying to install an app you are getting an error:
univentionAppInstalledOnServer: value #0 provided more than once
Environment
You get a traceback similar to this one:
28891 utils 20-09-17 14:47:03 [ DEBUG]: send_information: action=install app=letsencrypt value=Type or value exists: univentionAppInstalledOnServer: value #0 provided more than once status=502
28891 utils 20-09-17 14:47:03 [ DEBUG]: tracking information: {'status': 502, 'uuid': '771eab32-b8c9-49f7-8566-e4dc784e957e', 'app': u'letsencrypt', 'value': 'Type or value exists: univentionAppInstalledOnServer: value #0 provided more than once', 'version': u'1.2.2-8', 'role': 'memberserver', 'action': 'install', 'system-uuid': '0ece5e06-b33b-4d4a-8494-bb4b214f564e'}
28891 actions.upgrade-search 20-09-17 14:47:04 [ DEBUG]: Calling upgrade-search
28891 actions.upgrade-search.progress 20-09-17 14:47:04 [ DEBUG]: 0
28891 actions.upgrade-search 20-09-17 14:47:04 [ DEBUG]: Checking letsencrypt=1.2.2-8
28891 actions.upgrade-search.progress 20-09-17 14:47:04 [ DEBUG]: 100
28891 actions.install 20-09-17 14:47:04 [ ERROR]: Type or value exists: univentionAppInstalledOnServer: value #0 provided more than once
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/univention/appcenter/actions/__init__.py", line 226, in call_with_namespace
result = self.main(namespace)
File "/usr/lib/python2.7/dist-packages/univention/appcenter/actions/install.py", line 84, in main
return self.do_it(args)
File "/usr/lib/python2.7/dist-packages/univention/appcenter/actions/install_base.py", line 143, in do_it
self._do_it(app, args)
File "/usr/lib/python2.7/dist-packages/univention/appcenter/actions/docker_install.py", line 71, in _do_it
ret = super(Install, self)._do_it(app, args)
File "/usr/lib/python2.7/dist-packages/univention/appcenter/actions/install.py", line 107, in _do_it
self._register_app(app, args)
File "/usr/lib/python2.7/dist-packages/univention/appcenter/actions/register.py", line 438, in _register_app
ldap_object.add_localhost()
File "/usr/lib/python2.7/dist-packages/univention/appcenter/udm.py", line 245, in add_localhost
self._udm_obj.modify()
File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 650, in modify
dn = self._modify(modify_childs, ignore_license=ignore_license, response=response)
File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 1327, in _modify
self.dn = self.lo.modify(self.dn, ml, ignore_license=ignore_license, serverctrls=serverctrls, response=response)
File "/usr/lib/python2.7/dist-packages/univention/admin/uldap.py", line 902, in modify
raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
ldapError: Type or value exists: univentionAppInstalledOnServer: value #0 provided more than once
Solution
For some reason the app is already registered to be installed on the server and a second installation is not possible.
Step 1
Identify on which servers the app is installed. Shown here with “letsencrypt” as example:
root@master:~# univention-ldapsearch -LLL "univentionAppId=letsencrypt"
dn: univentionAppID=letsencrypt_1.2.2-8,cn=letsencrypt,cn=apps,cn=univention,dc=ppa,dc=local
univentionAppWebsite: [en] https://github.com/diafygi/acme-tiny
objectClass: univentionApp
objectClass: top
objectClass: univentionObject
univentionAppCategory: Administration
univentionAppDescription: [de] Zertifikate von Let's Encrypt in ihren UCS-Servern
univentionAppDescription: [en] Certificates issued by Let's Encrypt Certificate Authority in your UCS server
univentionAppName: [en] Let's Encrypt
univentionAppIcon:
[...]
univentionAppID: letsencrypt_1.2.2-8
univentionAppVersion: 1.2.2-8
univentionAppContact: feedback@univention.de
univentionObjectType: appcenter/app
univentionAppServerRole: domaincontroller_master
univentionAppServerRole: memberserver
univentionAppServerRole: domaincontroller_slave
univentionAppServerRole: domaincontroller_backup
univentionAppWebsiteVendor: [en] https://univention.com/
univentionAppInstalledOnServer: master.multi.ucs
univentionAppInstalledOnServer: backup.multi.ucs
univentionAppInstalledOnServer: slave.multi.ucs
Here, we want to install the app on the slave server but according to the flag univentionAppInstalledOnServer
it is already installed. Which is not!
Step 2
Re-write the flag indicating the installation state.
root@ucs:~# ldapmodify -D "$( ucr get ldap/hostdn )" -y /etc/machine.secret <<EOR
dn: univentionAppID=letsencrypt_1.2.2-8,cn=letsencrypt,cn=apps,cn=univention,dc=multi,dc=ucs
changetype: modify
delete: univentionAppInstalledOnServer
univentionAppInstalledOnServer: slave.multi.ucs
EOR
Step 3
Retry the installation of the app. It should succeed now.