Page MenuHomekolab.org

Resolve finding no entries, too many entries, and ensure that LDAP failures are triggered immediately
ClosedPublic

Authored by vanmeeuwen on Jul 22 2016, 1:41 PM.

Details

Summary

Resolve T1171 and T1318

Test Plan

Authenticate with attribute values configured, duplicate and non-existent, correct and incorrect passwords.

Expect the corresponding successes and failures.

Diff Detail

Repository
rP pykolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vanmeeuwen updated this revision to Diff 434.Jul 22 2016, 1:41 PM
vanmeeuwen retitled this revision from to Resolve finding no entries, too many entries, and ensure that LDAP failures are triggered immediately.
vanmeeuwen updated this object.
vanmeeuwen edited the test plan for this revision. (Show Details)
vanmeeuwen added a reviewer: PyKolab Developers.
vanmeeuwen added a subscriber: machniak.
machniak requested changes to this revision.Jul 22 2016, 2:10 PM
machniak added a reviewer: machniak.

Looks good to me. Only one objection, sometimes you use try/except for log.info() call, I'm not sure why you would do that. And you do not do this consistently.

This revision now requires changes to proceed.Jul 22 2016, 2:10 PM
vanmeeuwen requested a review of this revision.Jul 22 2016, 3:13 PM
vanmeeuwen edited edge metadata.
In D199#2931, @machniak wrote:

Looks good to me. Only one objection, sometimes you use try/except for log.info() call, I'm not sure why you would do that. And you do not do this consistently.

In the past, attempting to display the contents of login[0] in log.*() calls has triggered encoding tracebacks.

machniak accepted this revision.Jul 22 2016, 3:18 PM
machniak edited edge metadata.
This revision is now accepted and ready to land.Jul 22 2016, 3:18 PM
This revision was automatically updated to reflect the committed changes.
vendel.colja added a subscriber: vendel.colja.EditedJul 25 2016, 3:29 PM

We added this new "__init__.py" to our system and restarted kolabd and found some TIMEOUT tracebacks and a kolabd stooping after processing a buch of new users created.

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/kolabd/__init__.py", line 208, in run
    self.do_sync()
  File "/usr/lib/python2.6/site-packages/kolabd/__init__.py", line 333, in do_sync
    domain_auth[domain].start()
  File "/usr/lib64/python2.6/multiprocessing/process.py", line 104, in start
    self._popen = Popen(self)
  File "/usr/lib64/python2.6/multiprocessing/forking.py", line 100, in __init__
    sys.stdout.flush()
IOError: [Errno 9] Bad file descriptor
Traceback occurred, please report a bug at https://issues.kolab.org
2016-07-25 15:11:58,272 pykolab.auth ERROR An error occured using _persistent_search: TIMEOUT()
2016-07-25 15:11:58,281 pykolab.auth ERROR Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 3059, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 2738, in _persistent_search
    resp_ctrl_classes={ecnc.controlType:ecnc}
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 476, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 99, in _ldap_call
    result = func(*args,**kwargs)
TIMEOUT

2016-07-25 15:12:08,282 pykolab.auth ERROR An error occured using _paged_search: TIMEOUT()
2016-07-25 15:12:08,282 pykolab.auth ERROR Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 3059, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 2826, in _paged_search
    ) = self.ldap.result3(_search)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 469, in result3
    resp_ctrl_classes=resp_ctrl_classes
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 476, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 99, in _ldap_call
    result = func(*args,**kwargs)
TIMEOUT

2016-07-25 15:12:27,049 pykolab.auth ERROR An error occured using _persistent_search: TIMEOUT()
2016-07-25 15:12:27,050 pykolab.auth ERROR Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 3059, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 2738, in _persistent_search
    resp_ctrl_classes={ecnc.controlType:ecnc}
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 476, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 99, in _ldap_call
    result = func(*args,**kwargs)
TIMEOUT

2016-07-25 15:12:37,053 pykolab.auth ERROR An error occured using _paged_search: TIMEOUT()
2016-07-25 15:12:37,054 pykolab.auth ERROR Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 3059, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 2826, in _paged_search
    ) = self.ldap.result3(_search)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 469, in result3
    resp_ctrl_classes=resp_ctrl_classes
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 476, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 99, in _ldap_call
    result = func(*args,**kwargs)
TIMEOUT

created exactly 100 users to LDAP and restarted kolabd

..... LAST 4 of those 100 users and than the TIMEOUT Traceback and a kolabd completely stopping ! ......

2016-07-25 15:17:20,758 pykolab.imap INFO Creating new mailbox for user sahrervonsahrvonscho@domain.tld
2016-07-25 15:17:22,551 pykolab.imap INFO Creating new mailbox for user t.lahovic@domain.tld
2016-07-25 15:17:24,587 pykolab.imap INFO Creating new mailbox for user lisbeth.fabsch@domain.tld
2016-07-25 15:17:26,576 pykolab.imap INFO Creating new mailbox for user robe.raus@domain.tld
2016-07-25 15:17:54,216 pykolab.auth ERROR An error occured using _persistent_search: TIMEOUT()
2016-07-25 15:17:54,218 pykolab.auth ERROR Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 3059, in _search
    secondary_domains
  File "<string>", line 10, in <module>
  File "/usr/lib/python2.6/site-packages/pykolab/auth/ldap/__init__.py", line 2738, in _persistent_search
    resp_ctrl_classes={ecnc.controlType:ecnc}
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 476, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib64/python2.6/site-packages/ldap/ldapobject.py", line 99, in _ldap_call
    result = func(*args,**kwargs)
TIMEOUT

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/kolabd/__init__.py", line 208, in run
    self.do_sync()
  File "/usr/lib/python2.6/site-packages/kolabd/__init__.py", line 333, in do_sync
    domain_auth[domain].start()
  File "/usr/lib64/python2.6/multiprocessing/process.py", line 104, in start
    self._popen = Popen(self)
  File "/usr/lib64/python2.6/multiprocessing/forking.py", line 100, in __init__
    sys.stdout.flush()
IOError: [Errno 9] Bad file descriptor
Traceback occurred, please report a bug at https://issues.kolab.org
2016-07-25 15:21:10,974 pykolab.imap INFO Creating new mailbox for user anica.brecht@domain.tld
2016-07-25 15:21:13,512 pykolab.imap INFO Creating new mailbox for user caterin.cortess@domain.tld