Local error in simple_bind_s() continued

Leons Petrazickis leonsp at ca.ibm.com
Mon Mar 3 20:38:13 CET 2008


Hello,

I just installed Suse Linux Enterprise Desktop 10. It comes with OpenLDAP
2.3.19 and Python 2.4. On top of that, I built the latest CVS checkout of
python-ldap.

I am getting the same error as with Ubuntu. OpenLDAP works, but python-ldap
crashes. Previous thread:
<http://sourceforge.net/mailarchive/forum.php?thread_name=OFB4CEB31F.56A5A98B-ON852573B1.00808384-852573B1.0081B67C%40ca.ibm.com&forum_name=python-ldap-dev
>

This script crashes:

import ldap;
ldap.set_option(ldap.OPT_DEBUG_LEVEL,4095);
l = ldap.initialize("ldap://bluepages.ibm.com:636/",trace_level=2);
l.simple_bind_s();


This is the output:

ldap_create
ldap_url_parse_ext(ldap://bluepages.ibm.com:636/)
*** ldap://bluepages.ibm.com:636/ - SimpleLDAPObject.set_option ((17,
3),{})
*** ldap://bluepages.ibm.com:636/ - SimpleLDAPObject.simple_bind (('', '',
None, None),{})
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP bluepages.ibm.com:636
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 9.17.186.253:636
ldap_connect_timeout: fd: 3 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
=> result: 1
*** ldap://bluepages.ibm.com:636/ - SimpleLDAPObject.result3 ((1, 1,
-1),{})
ldap_result ld 0x805a3d0 msgid 1
ldap_chkResponseList ld 0x805a3d0 msgid 1 all 1
ldap_chkResponseList returns ld 0x805a3d0 NULL
wait4msg ld 0x805a3d0 msgid 1 (infinite timeout)
wait4msg continue ld 0x805a3d0 msgid 1 all 1
** ld 0x805a3d0 Connections:
* host: bluepages.ibm.com  port: 636  (default)
  refcnt: 2  status: Connected
  last used: Mon Mar  3 09:04:02 2008

** ld 0x805a3d0 Outstanding Requests:
 * msgid 1,  origid 1, status InProgress
   outstanding referrals 0, parent count 0
** ld 0x805a3d0 Response Queue:
   Empty
ldap_chkResponseList ld 0x805a3d0 msgid 1 all 1
ldap_chkResponseList returns ld 0x805a3d0 NULL
ldap_int_select
read1msg: ld 0x805a3d0 msgid 1 all 1
ldap_err2string
=> LDAPError - LOCAL_ERROR: {'desc': 'Local error'}
Traceback (most recent call last):
  File "test.py", line 6, in ?
    l.simple_bind_s();
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 176, in
simple_bind_s
    return self.result(msgid,all=1,timeout=self.timeout)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 405, in
result
    res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 409, in
result2
    res_type, res_data, res_msgid, srv_ctrls =
self.result3(msgid,all,timeout)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 415, in
result3
    rtype, rdata, rmsgid, serverctrls =
self._ldap_call(self._l.result3,msgid,all,timeout)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 94, in
_ldap_call
    result = func(*args,**kwargs)
ldap.LOCAL_ERROR: {'desc': 'Local error'}
ldap_free_request (origid 1, msgid 1)
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed


But this command works:

ldapsearch -h bluepages.ibm.com -x -b "ou=bluepages,o=ibm.com" -s sub
"(sn=leonsp)" cn tieline -d 1


This is some of the output:

ldap_create
ldap_url_parse_ext(ldap://bluepages.ibm.com)
ldap_bind
ldap_simple_bind
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP bluepages.ibm.com:389
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 9.17.186.253:389
ldap_connect_timeout: fd: 3 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
ber_scanf fmt ({it) ber:
ber_scanf fmt ({i) ber:
ber_flush: 14 bytes to sd 3
ldap_result ld 0x80570a8 msgid 1
ldap_chkResponseList ld 0x80570a8 msgid 1 all 1
ldap_chkResponseList returns ld 0x80570a8 NULL
wait4msg ld 0x80570a8 msgid 1 (infinite timeout)
wait4msg continue ld 0x80570a8 msgid 1 all 1
** ld 0x80570a8 Connections:
* host: bluepages.ibm.com  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Mon Mar  3 09:16:27 2008

** ld 0x80570a8 Outstanding Requests:
 * msgid 1,  origid 1, status InProgress
   outstanding referrals 0, parent count 0
** ld 0x80570a8 Response Queue:
   Empty
ldap_chkResponseList ld 0x80570a8 msgid 1 all 1
ldap_chkResponseList returns ld 0x80570a8 NULL

### CRASH HAPPENS HERE IN python-ldap ###

ldap_int_select
read1msg: ld 0x80570a8 msgid 1 all 1
ber_get_next
ber_get_next: tag 0x30 len 16 contents:
read1msg: ld 0x80570a8 msgid 1 message type bind
ber_scanf fmt ({eaa) ber:
read1msg: ld 0x80570a8 0 new referrals
read1msg:  mark request completed, ld 0x80570a8 msgid 1
request done: ld 0x80570a8 msgid 1
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_free_connection 0 1
ldap_free_connection: refcnt 1
ldap_parse_result
ber_scanf fmt ({iaa) ber:
ber_scanf fmt (}) ber:
ldap_msgfree

### SNIP ###


The host is running Tivoli Directory Server 5.2. I do not control the host,
but I can install any distro on the client.

What can I do to help resolve this issue? Is there further debugging
information that I could provide?

Regards,

Leons Petrazickis
http://lpetr.org/blog/





More information about the python-ldap mailing list