Local error in simple_bind_s() continued

2008-03-03 Thread Leons Petrazickis

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:


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.

Wh

Re: Local error in simple_bind_s() continued

2008-03-03 Thread Michael Ströder
Leons Petrazickis wrote:
> 
> 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.

Could you please try to install Ralf Haferkamp's recent OpenLDAP 
RPMs for SLE 10 from here and rebuild python-ldap:

http://download.opensuse.org/repositories/OpenLDAP/SLE_10/i586/openldap2-client-2.3.41-2.1.i586.rpm
http://download.opensuse.org/repositories/OpenLDAP/SLE_10/i586/openldap2-devel-2.3.41-2.1.i586.rpm

> I am getting the same error as with Ubuntu. OpenLDAP works, but python-ldap
> crashes. Previous thread:
>  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:

You're setting trace_level=2 but there are no python-ldap debug 
messages in your output at all.

> The host is running Tivoli Directory Server 5.2.

I'm pretty sure I've already accessed this LDAP server with 
web2ldap, hence python-ldap worked. Don't remember the versions 
though.

Ciao, Michael.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: Local error in simple_bind_s() continued

2008-03-03 Thread Michael Ströder
Leons Petrazickis wrote:
> l = ldap.initialize("ldap://bluepages.ibm.com:636/",trace_level=2);
 > [..]
> ldapsearch -h bluepages.ibm.com -x -b "ou=bluepages,o=ibm.com" -s sub
> "(sn=leonsp)" cn tieline -d 1

BTW: The connection parameters are not the same!

You would have to test with
ldapsearch -h bluepages.ibm.com -p 636 [..]
and I doubt that will work because port 636 is normally used for 
LDAP tunneled within SSL.

Ciao, Michael.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev