Bug 45124 - search for highestCommittedUSN failed
search for highestCommittedUSN failed
Status: RESOLVED DUPLICATE of bug 11658
Product: UCS
Classification: Unclassified
Component: AD Connector
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: Lukas Oyen
Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-02 15:33 CEST by Florian Best
Modified: 2018-04-14 14:14 CEST (History)
1 user (show)

See Also:
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:
oyen: Patch_Available+


Attachments
45124-adc-usn-out-of-range-421.patch (1.27 KB, patch)
2017-08-03 18:49 CEST, Lukas Oyen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-08-02 15:33:54 CEST
The current connector.log of all AD Member Jenkins instances contain the following traceback:

02.08.2017 00:38:05,564 LDAP        (PROCESS): The object u'cn=admember225,cn=dc,cn=computers,dc=autotest225,dc=local' will be ignored because a valid match filter for this object was not found.
02.08.2017 00:38:05,621 LDAP        (ERROR  ): search for highestCommittedUSN failed
02.08.2017 00:38:05,621 LDAP        (ERROR  ): Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/connector/ad/__init__.py", line 1293, in __get_highestCommittedUSN
    usn = self.lo_ad.getAttr('', 'highestCommittedUSN')[0]
IndexError: list index out of range

Additionally there is the following warning very often (related?):
02.08.2017 00:38:07,117 LDAP        (WARNING): lastKnownParent attribute for deleted object rdn="CN=Deleted Objects,DC=autotest225,DC=l" was not set, so we must ignore the object
Comment 1 Arvid Requate univentionstaff 2017-08-02 16:30:06 CEST
The last change there is r81452 (Bug #11658)
Comment 3 Florian Best univentionstaff 2017-08-03 17:46:53 CEST
My guess is lo.getAttr() is wrong (the function is broken, see Bug #43420).
Use lo.get(dn, [attr])[attr][0] instead.
Comment 4 Florian Best univentionstaff 2017-08-03 17:51:38 CEST
See also Bug #32086 comment 19.
Comment 5 Lukas Oyen univentionstaff 2017-08-03 18:49:37 CEST
Created attachment 9090 [details]
45124-adc-usn-out-of-range-421.patch

The error only occured on a fresh install (or by deleting /etc/univention/connector/*.sqlite). `uldap.get{Attr}()` are not usable, as they don't permit emtpy DNs, but that is needed to get to the rootDSE.
Comment 6 Florian Best univentionstaff 2017-08-04 15:43:50 CEST
Ah yes, empty DN's aren't allowed, see the code:
univention-python/modules/uldap.py:
  254 »   def get(self, dn, attr=[], required=False):
  257 »   »   if dn:
  258 »   »   »   try:
  259 »   »   »   »   result = self.lo.search_s(dn, ldap.SCOPE_BASE, '(objectClass=*)', attr)
  260 »   »   »   except ldap.NO_SUCH_OBJECT:
  261 »   »   »   »   result = []
  266 »   »   return {}

So this is introduced in Bug #11658. Please fix it directly.

*** This bug has been marked as a duplicate of bug 11658 ***