From: Leons P. <le...@ca...> - 2007-12-18 19:38:01
|
Hi Michael, Thank you very much for the logging tip. I've installed Thorsten Kurbad's python_ldap-2.3.1-py2.4-linux-i686.egg= on my Python 2.4 install This is the script: ldap.set_option(ldap.OPT_DEBUG_LEVEL,4095) l =3D ldap.initialize("ldap://bluepages.ibm.com:636/",trace_level=3D2);= l.protocol_version =3D ldap.VERSION2; l.simple_bind_s(); And this is the log 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.set_option ((17, 2),{}) *** 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 =3D> result: 1 *** ldap://bluepages.ibm.com:636/ - SimpleLDAPObject.result3 ((1, 1, -1),{}) ldap_result ld 0x81afba8 msgid 1 ldap_chkResponseList ld 0x81afba8 msgid 1 all 1 ldap_chkResponseList returns ld 0x81afba8 NULL wait4msg ld 0x81afba8 msgid 1 (infinite timeout) wait4msg continue ld 0x81afba8 msgid 1 all 1 ** ld 0x81afba8 Connections: * host: bluepages.ibm.com port: 636 (default) refcnt: 2 status: Connected last used: Mon Dec 17 18:34:20 2007 ** ld 0x81afba8 Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ** ld 0x81afba8 Response Queue: Empty ldap_chkResponseList ld 0x81afba8 msgid 1 all 1 ldap_chkResponseList returns ld 0x81afba8 NULL ldap_int_select read1msg: ld 0x81afba8 msgid 1 all 1 ldap_err2string =3D> LDAPError - LOCAL_ERROR: {'desc': 'Local error'} Traceback (most recent call last): File "test.py", line 15, in ? l.simple_bind_s(); File "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.eg= g/ldap/ldapobject.py", line 199, in simple_bind_s return self.result(msgid,all=3D1,timeout=3Dself.timeout) File "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.eg= g/ldap/ldapobject.py", line 428, in result res_type,res_data,res_msgid =3D self.result2(msgid,all,timeout) File "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.eg= g/ldap/ldapobject.py", line 432, in result2 res_type, res_data, res_msgid, srv_ctrls =3D self.result3(msgid,all,timeout) File "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.eg= g/ldap/ldapobject.py", line 438, in result3 rtype, rdata, rmsgid, serverctrls =3D self._ldap_call(self._l.result3,msgid,all,timeout) File "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.eg= g/ldap/ldapobject.py", line 97, in _ldap_call result =3D 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 Does this mean that the connection is successful, but then there is a c= rash in message processing? What can I do? Thanks, Leons Petrazickis http://lpetr.org/blog/ = Michael Str=F6der = <michael@stroeder = .com> = To Leons Petrazickis/Toronto/IBM@IB= MCA 15/12/2007 08:30 = cc AM pyt...@li...urceforg= e.n et = Subj= ect Re: Local Error in simple_bind_s= (); = = = = = = Leons Petrazickis wrote: > ldap.LOCAL_ERROR: {'desc': 'Local error'} > [..] > But OpenLDAP commands work fine from the command prompt: > [..] > I am using the python-ldap package on Ubuntu Gutsy. I have no clue which version of python-ldap Ubuntu is using. Nor do I know whether they applied any patches *they* believe to be necessary before packaging it. Could you please try to reproduce the problem with= a stock python-ldap 2.3.1 built from official source distribution against recent OpenLDAP libs 2.3.x? Another option to track down issues is to turn on debug logging in python-ldap and also in the OpenLDAP libs: ldap.set_option(ldap.OPT_DEBUG_LEVEL,4095) and l =3D ldap.initialize('ldap://yourserver:port',trace_level=3D2) Ciao, Michael. = |