Bug 20381

Summary: Falsche uldap-Klasse
Product: UCS Reporter: Philipp Hahn <hahn>
Component: UDM (Generic)Assignee: UMC maintainers <umc-maintainers>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P5 CC: best
Version: UCS 2.4   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
What kind of report is it?: --- 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):
Max CVSS v3 score:

Description Philipp Hahn univentionstaff 2010-10-14 14:12:27 CEST
Es gibt zwei uldap-Klassen:
1. univention.uldap.search() liefert im Fehlerfall None
2. univention.admin.uldap.search() wirft eine Exception

In univention/admin/handlers/__init__.py:1169#__modify_dhcp_object() wird zwingend Variante 1 benötig, ansonsten passieren schlimme Dinge:

Traceback (most recent call last):
  File "/usr/sbin/univention-dvs-create-desktop", line 278, in ?
    dn = computer.create()
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 307, in create
    return self._create()
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 652, in _create
    raise e

Die eigentliche Ursache liegt aber tiefer, was dort erst ein zusätzliches "print traceback.format_exc()" zeigt:
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 645, in _create
    self._ldap_post_create()
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/computers/windows.py", line 438, in _ldap_post_create
    univention.admin.handlers.simpleComputer._ldap_post_create( self )
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 1880, in _ldap_post_create
    self.__modify_dhcp_object( dn, self[ 'name' ], ip, mac )
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 1169, in __modify_dhcp_object
    results = self.lo.search( base = position, scope = 'domain', attr = [ 'univentionDhcpFixedAddress' ], filter = 'dhcpHWAddress=%s' % ethernet, unique = 0 )
  File "/usr/lib/python2.4/site-packages/univention/admin/uldap.py", line 303, in search
    raise univention.admin.uexceptions.noObject, msg[0]['desc']
noObject: No such object

Solche fiesen Fallen sollten deutlich dokumentiert sein und noch besser rechtzeitig abgefangen werden!
Comment 1 Philipp Hahn univentionstaff 2010-10-14 15:35:32 CEST
In diesem konkreten Fall war die Ursache, daß es die LDAP-Basis nicht gabe:
Gesucht wurde unter: cn=univention.qa,cn=dhcp,dc=ucsdvs,dc=qa
Geben tat es aber:   cn=ucsdvs.qa    ,cn=dhcp,dc=ucsdvs,dc=qa

Dann wirft bereits das
  res = self.lo.search_ext_s(base, ldap_scope,filter, attr, serverctrls=serverctrls, clientctrls=None, timeout=timeout, sizelimit=sizelimit)
aus univention/uldap.py:274#search() eine ldap.NO_SUCH_OBJECT Exception, die von univention/admin/uldap.py:312#search() in eine univention.admin.uexceptions.noObject Exception umgewandelt wird.
Comment 2 Stefan Gohmann univentionstaff 2016-04-25 07:52:07 CEST
This issue has been filed against UCS 2.4.

UCS 2.4 is out of maintenance and many UCS components have vastly changed in
later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug".
In this case please provide detailed information on how this issue is affecting
you.
Comment 3 Florian Best univentionstaff 2016-05-27 11:14:33 CEST
Continue in Bug #41368