Bug 49478 - container/ou creation fails underneath of not identifyable object: AttributeError: 'NoneType' object has no attribute 'module'
container/ou creation fails underneath of not identifyable object: AttributeE...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-1-errata
Assigned To: Florian Best
Jürn Brodersen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-15 13:18 CEST by Florian Best
Modified: 2019-11-25 18:08 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup, Error handling
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-05-15 13:18:25 CEST
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'
Comment 1 Florian Best univentionstaff 2019-07-15 17:30:37 CEST
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'
Comment 2 Florian Best univentionstaff 2019-07-19 18:17:05 CEST
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'
Comment 3 Florian Best univentionstaff 2019-07-25 12:37:20 CEST
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
Comment 4 Jürn Brodersen univentionstaff 2019-07-26 11:34:57 CEST
What I tested:
Created ou under dc and ou -> OK
Created ou under cn -> Error -> OK
Jenkins -> OK
YAML ->OK

-> Verified
Comment 5 Arvid Requate univentionstaff 2019-07-31 13:58:39 CEST
<http://errata.software-univention.de/ucs/4.4/205.html>