Local Error in simple_bind_s();

Leons Petrazickis leonsp at ca.ibm.com
Sat Dec 15 00:36:49 CET 2007


When I run this Python script under either 2.5 or 2.4:

import ldap
ds = ldap.initialize("ldap://foobar.ibm.com:636")
ds.protocol_version = ldap.VERSION2
ds.simple_bind_s()

I get this error:

Traceback (most recent call last):
  File "test.py", line 13, in <module>
    ds.simple_bind_s();
  File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 199, in
simple_bind_s
    return self.result(msgid,all=1,timeout=self.timeout)
  File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 428, in
result
    res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
  File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 432, in
result2
    res_type, res_data, res_msgid, srv_ctrls =
self.result3(msgid,all,timeout)
  File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 438, in
result3
    rtype, rdata, rmsgid, serverctrls =
self._ldap_call(self._l.result3,msgid,all,timeout)
  File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 97, in
_ldap_call
    result = func(*args,**kwargs)
ldap.LOCAL_ERROR: {'desc': 'Local error'}

But OpenLDAP commands  work fine from the command prompt:

ldapsearch -h foobar.ibm.com -P 2 -x -b "ou=bluepages,o=ibm.com" -s sub
"(sn=Test)" cn tieline

Any ideas? I can't figure out what would cause a "Local error" from the
source code.

I am using the python-ldap package on Ubuntu Gutsy.

Regards,

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





More information about the python-ldap mailing list