Univention Bugzilla – Bug 34680
Traceback when UDM module is None (UDM_Error: 'NoneType' object has no attribute 'object')
Last modified: 2015-03-17 15:07:40 CET
Masked traceback feedback (see Bug #32979). I guess self.module is None, but I could be mistaken: obj = self.module.object( None, ldap_connection, None, ldap_dn, superordinate, attributes = attributes ) Traceback: File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run tmp = self._function() File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 879, in _thread return read_syntax_choices( request.options[ 'syntax' ], request.options ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 155, in wrapper_func ret = func( *args, **kwargs ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 1322, in read_syntax_choices obj = module.get( dn ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 155, in wrapper_func ret = func( *args, **kwargs ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 475, in get raise UDM_Error( get_exception_msg( e ) ) UDM_Error: 'NoneType' object has no attribute 'object' Remark: Im UMC - nach Update von UCS 3.1 auf 3,2 - Benutzerverwaltung - bestehenden Benutzereintrag zum Editieren öffnen => Interner Modulfehler ... Version: 3.2-1 errata88 (Borgfeld)
reported again, 3.2-1 errata111 (Borgfeld).
Also reported with 3.2-3 errata185 (Borgfeld).
Remark: Aufrufen eines Users Version: 3.2-3 errata206 (Borgfeld)
@Drees: Might this be related to Bug 29231 and Bug 34246?
svn r57078: Bug #34680: Fix errors when no module for specific ldap objects exists. Multiple checks contained these errors: Lines like the following were used often: "module = UDM_Module(udm_module); if module is None:" These could never be true, the correct check is "if module.module is None". The ModuleCache.get() method was wrong, it saved 'None' internally in some cases. A reload of modules then had no effect. get_module() returned UDM_Module() instances even if the handler module for them does not exists.
(In reply to Florian Best from comment #5) > Lines like the following were used often: > "module = UDM_Module(udm_module); if module is None:" > These could never be true, the correct check is "if module.module is None". Please also consider "if module not None". Maybe implement __nonzero__ in class UDM_Module? module.module seems... awkward. Note that there is also a lot of: module = get_module(flavor, superordinate) if not module: MODULE.error('Idenfified module %s for %s (flavor=%s) does not have a relating UDM module.' % (ldap_dn, flavor, modules[0])) s/Idenfified/Identified/ - and I guess the argument ordering is wrong? Your change in def move is error prone (although probably without any consequences): if 'container' not in options: yield {'$dn$': object, 'success': False, 'details': _('The destination is missing')} module = get_module(None, object) if not module: # <----- BTW another faulty test yield {'$dn$': object, 'success': False, 'details': _('Could not identify the given LDAP object')} ... can yield twice in one for-iteration - if 'container' not in options.
(In reply to Dirk Wiesenthal from comment #6) > (In reply to Florian Best from comment #5) > > Lines like the following were used often: > > "module = UDM_Module(udm_module); if module is None:" > > These could never be true, the correct check is "if module.module is None". > > Please also consider "if module not None". Maybe implement __nonzero__ in > class UDM_Module? module.module seems... awkward. Note that there is also a > lot of: > module = get_module(flavor, superordinate) > if not module: This is correct! get_module() will never return a module if module.module does not exists. Note that there were 2 different get_module functions: get_module() and self.get_module()(not anymore)/self.get_module_by_request(). > MODULE.error('Idenfified module %s for %s (flavor=%s) does not have a > relating UDM module.' % (ldap_dn, flavor, modules[0])) > > s/Idenfified/Identified/ - and I guess the argument ordering is wrong? yes, both has been fixed. > Your change in def move is error prone (although probably without any > consequences): > if 'container' not in options: > yield {'$dn$': object, 'success': False, 'details': _('The destination is > missing')} > module = get_module(None, object) > if not module: # <----- BTW another faulty test → not faulty, see the first comment. > yield {'$dn$': object, 'success': False, 'details': _('Could not identify > the given LDAP object')} > > ... can yield twice in one for-iteration - if 'container' not in options. yes, the 'continue' statement was missing.
OK, the traceback is gone
http://errata.univention.de/ucs/4.0/18.html
*** Bug 26966 has been marked as a duplicate of this bug. ***
*** Bug 29201 has been marked as a duplicate of this bug. ***