Univention Bugzilla – Bug 38665
opening setup wizard fails due to ignored import errors
Last modified: 2019-01-03 07:16:24 CET
Die Ausführung des Kommandos setup/apps/query wizard ist fehlgeschlagen:
Traceback (most recent call last):
File "%PY2.7%/univention/management/console/base.py", line 282, in execute
File "%PY2.7%/univention/management/console/modules/decorators.py", line 316, in _response
result = _multi_response(self, request)
File "%PY2.7%/univention/management/console/modules/decorators.py", line 460, in _response
return list(function(self, iterator, *nones))
File "%PY2.7%/univention/management/console/modules/decorators.py", line 282, in _fake_func
yield function(self, *args)
File "%PY2.7%/univention/management/console/modules/setup/__init__.py", line 710, in apps_query
File "%PY2.7%/univention/management/console/modules/setup/util.py", line 696, in get_apps
package_manager = PackageManager(
NameError: global name 'PackageManager' is not defined
UCS-Einrichtungsassistent auf einem DC Slave geöffnet
4.0-2 errata205 (Walle)
The reason is the code """
57 » # execute imports in try/except block as during build test scripts are
58 » # triggered that refer to the netconf python submodules... and this
59 » # reference triggers the import below
60 » import dns.resolver
61 » import dns.reversename
62 » import dns.exception
63 » import univention.management.console.modules.appcenter.app_center as app_center
64 » from univention.lib.package_manager import PackageManager
65 except ImportError as e:
66 » MODULE.warn('Ignoring import error: %s' % e)
I got the corresponding error log message:
"Ignoring import error: No module named appcenter.app"
The system was updated from UCS 3.X to UCS 4.0. After this the module "Setup wizard" was shown (another bug), the traceback occurred when opening this module.
The system only used official package sources.
The "appcenter.app" module only exists in the 4.0 docker scope, right?
Created attachment 6950 [details]
list of installed packages of the system
Created attachment 6951 [details]
apt sources used on the system
It could be this line which fails, not the docker thing:
management/univention-management-console-module-appcenter/umc/python/appcenter/app_center.py:import univention.admin.handlers.appcenter.app as appcenter_udm_module
This would mean that the register_ldap_extension failed.
The system was a DC Slave. The failure should be fixed after "univention-run-join-scripts".
From the discussion with Dirk we assume the following:
* the listener failed when doing registerLdapExtension so that the appcenter.app handler is not installed
* we should not import a handler module directly but use univention.admin.modules.get('appcenter/app') instead (because only then extended attributes are also evaluated). The check for None can be implemented then and a failure will only occur at runtime not on import time. As it is the system-setup module there will be no runtime error as that code is not used by system-setup.
This issue has been filled against UCS 4.0. The maintenance with bug and security fixes for UCS 4.0 has ended on 31st of May 2016.
Customers still on UCS 4.0 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.
If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.