Univention Bugzilla – Bug 30156
license import traceback when uploading invalid license
Last modified: 2013-12-02 08:56:00 CET
Die Ausführung des Kommandos udm/license/import ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 175, in wrapper_func ret = func( *args, **kwargs ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 237, in license_import importer = LicenseImport( open( filename, 'rb' ) ) IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/var/tmp/univention-management-console-frontend/135892704881303-24661LqLt9l'
This still occurs with current 3.2
Reported again.
This must be a generic problem with the file handling in UMC and has nothing to do with an invalid license. Somehow the uploaded file gets deleted before the module process of UDM executes the import_license method.
Piwik reports that the majority of all tracebacks (18%) occur during the import of a new license.
Seems that the method is executed twice by the UMC module process (maybe appended twice to the message queue?) I take this bug.
fixed in univention-management-console-module-udm (4.0.97-4) Responsible for the error was the LDAP_Connection decorator which executes the method again when a "LDAPError" or "udm_errors.base" exception occurs. Because the license file was invalid such a exception has been raised. The file was already deleted so it could not be opened again resulting in that the first second method call answered the UMCP response at first. I could trigger ValueError, AttributeError, ldap.UNDEFINED_TYPE exceptions which are now catched and a reasonable message is displayed.
YAML adapted.
License with wrong "dn:" line: Die Ausführung des Kommandos udm/license/import ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 268, in license_import importer.write( self._user_dn, self._password ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/tools.py", line 98, in write ldap_con.add_s( self.dn, self.addlist ) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 194, in add_s return self.result(msgid,all=1,timeout=self.timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 422, in result res_type,res_data,res_msgid = self.result2(msgid,all,timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 426, in result2 res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 432, in result3 ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call result = func(*args,**kwargs) UNWILLING_TO_PERFORM: {'info': 'no global superior knowledge', 'desc': 'Server is unwilling to perform'}
I do not see the reason why LDAP_Connection is used at all. The only purpose seems to be returning ldap_position and this is only used for getBase(). This is roughly ucr.get('ldap/base')
German: Die Lizenz konnte nich importiert werden: missgestaltetes LDIF-Format nich -> nicht missgestaltet -> ungültig, maybe change English, too.
Error in objectClass (e.g. wrong name): Die Ausführung des Kommandos udm/license/import ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 269, in license_import importer.write( self._user_dn, self._password ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/tools.py", line 98, in write ldap_con.add_s( self.dn, self.addlist ) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 194, in add_s return self.result(msgid,all=1,timeout=self.timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 422, in result res_type,res_data,res_msgid = self.result2(msgid,all,timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 426, in result2 res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 432, in result3 ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout) File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call result = func(*args,**kwargs) INVALID_SYNTAX: {'info': 'objectClass: value #1 invalid per syntax', 'desc': 'Invalid syntax'}
See also Bug#32160. There are several ways to let the import fail (all result in tracebacks). I would suggest catching all LDAP_Errors, assuming error in license file and present something like: "The import of the license failed. Check the integrity of the original file given to you. If this error persists, contact Univention or your Univention partner. LDAP error message was: %s" % err['desc']
(In reply to Dirk Wiesenthal from comment #12) > See also Bug#32160. > > There are several ways to let the import fail (all result in tracebacks). I > would suggest catching all LDAP_Errors, assuming error in license file and > present something like: > > "The import of the license failed. Check the integrity of the original file > given to you. If this error persists, contact Univention or your Univention > partner. LDAP error message was: %s" % err['desc'] Good idea! I added an explicit pre-check for the base DN, LDAP errors are not caught generically with the suggested error message. univention-management-console-module-udm (4.0.97-6): * Bug #30156: adjusted error handling and messages for license import
Fixed some typos that you found, Dirk. univention-management-console-module-udm (4.0.97-7): * Bug #30156: fixed typos
Once again, adjusted the error messages. univention-management-console-module-udm (4.0.97-8): * Bug #30156: adjusted error messages for license import
univention-management-console-module-udm (4.0.97-9): * Bug #30156: adjusted error representation in frontend
*** Bug 32160 has been marked as a duplicate of this bug. ***
Much better
http://errata.univention.de/ucs/3.2/3.html