Univention Bugzilla – Bug 49478
container/ou creation fails underneath of not identifyable object: AttributeError: 'NoneType' object has no attribute 'module'
Last modified: 2019-11-25 18:08:09 CET
Just found the exception in my S4 connector logs, after ucs-test was executed: 12.05.2019 01:56:24,421 LDAP (PROCESS): sync to ucs: Resync rejected dn: OU=8wo6wyt3sq,OU=idgtq2oj7e,OU=h0upu84rvh,DC=school,DC=dev 12.05.2019 01:56:24,425 LDAP (PROCESS): sync to ucs: [ ou] [ add] ou=8wo6wyt3sq,ou=idgtq2oj7e,ou=h0upu84rvh,l=school,l=dev 12.05.2019 01:56:24,441 LDAP (ERROR ): Unknown Exception during sync_to_ucs 12.05.2019 01:56:24,442 LDAP (ERROR ): Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/s4connector/__init__.py", line 1547, in sync_to_ucs result = self.add_in_ucs(property_type, object, module, position) File "/usr/lib/python2.7/dist-packages/univention/s4connector/__init__.py", line 1295, in add_in_ucs res = ucs_object.create(serverctrls=serverctrls, response=response) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 549, in create dn = self._create(response=response, serverctrls=serverctrls) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1216, in _create self._ldap_pre_create() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/container/ou.py", line 212, in _ldap_pre_create if m.module == 'container/cn': AttributeError: 'NoneType' object has no attribute 'module'
s4-connector.log: attachment 10121 [details] (Bug #49850). 11.07.2019 16:08:43.127 LDAP (PROCESS): sync to ucs: [ ou] [ delete] ou=ûaqÄ!:Å#ô6,ou=âjiÄ!ß|$ŷâ DEL:d65d295e-0096-40ef-8c78-f658e8197fa4,CN=Deleted Objects,dc=AutoTest091,dc=local 11.07.2019 16:08:43.128 LDAP (WARNING): Object to delete doesn't exsist, ignore (ou=ûaqÄ!:Å#ô6,ou=âjiÄ!ß|$ŷâ DEL:d65d295e-0096-40ef-8c78-f658e8197fa4,CN=Deleted Objects,dc=AutoTest091,dc=local) 11.07.2019 16:08:43.137 LDAP (PROCESS): sync to ucs: [ ou] [ add] ou=gzg85xsewx,ou=uahzm8vm3e,dc=AutoTest091,dc=local 11.07.2019 16:08:43.151 LDAP (ERROR ): Unknown Exception during sync_to_ucs 11.07.2019 16:08:43.164 LDAP (ERROR ): Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/s4connector/__init__.py", line 1547, in sync_to_ucs result = self.add_in_ucs(property_type, object, module, position) File "/usr/lib/python2.7/dist-packages/univention/s4connector/__init__.py", line 1295, in add_in_ucs res = ucs_object.create(serverctrls=serverctrls, response=response) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 550, in create dn = self._create(response=response, serverctrls=serverctrls) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1217, in _create self._ldap_pre_create() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/container/ou.py", line 211, in _ldap_pre_create if m.module == 'container/cn': AttributeError: 'NoneType' object has no attribute 'module'
Easily reproducible: # udm container/ou create --position cn=default,cn=ppolicy,cn=univention,l=school,l=dev --set name=foo Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 218, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 408, in doit out = _doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 755, in _doit dn = object.create() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 550, in create dn = self._create(response=response, serverctrls=serverctrls) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1217, in _create self._ldap_pre_create() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/container/ou.py", line 211, in _ldap_pre_create if m.module == 'container/cn': AttributeError: 'NoneType' object has no attribute 'module'
Fixed the broken check. identifyOne() has been replaced with identify() because there might be multiple UDM objects detected (and even None returned e.g. by the first entry if the object has univentionObjectType set but the module doesn't exists on the system). univention-directory-manager-modules (14.0.13-2) b5d5d4c63d5f | Bug #49478: prevent crashing container/ou creation if parent object cannot be identified univention-directory-manager-modules.yaml b5d5d4c63d5f | Bug #49478: prevent crashing container/ou creation if parent object cannot be identified
What I tested: Created ou under dc and ou -> OK Created ou under cn -> Error -> OK Jenkins -> OK YAML ->OK -> Verified
<http://errata.software-univention.de/ucs/4.4/205.html>