Re: Exception info: Already Exists on New Add

2007-12-18 Thread Michael Ströder
Ron Teitelbaum wrote:
> 
> I'm adding an organization 
> 
> I get an exception info:'', desc: 'Already Exists' but if I go to gq the
> record actually did get added.

You're trying to re-add an entry with the same RDN. That's what this 
message says.

> I have an exception handler that retrys the add on Can't contact server
> errors.

You should examine your exception handler...

> I've been getting errors: Can't contact LDAP server.  But it appears that if
> I retry bind, or search, (and now add) after hitting this error it succeeds,
> which is why I added a retry handler.

You might want to use yet undocumented ldapobject.ReconnectLDAPObject. 
It does a good job for this particular problem.

> I'm running on Ubuntu 7.04 (VMWare).  Python2.4. Python-ldap 2.2.1

You should use python-ldap 2.3.1 although this is probably not part of 
your problem.

> I've attached the trace file.

There are two calls of add_ext in there.

>  Any idea why I would get this result?

Well, it's your code... ;-)

Ciao, Michael.

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


RE: Exception info: Already Exists on New Add

2007-12-18 Thread Ron Teitelbaum
Hi Michael,

Thank you very much for your help.  I will look at the exception handler and
ReconnectLDAPObject.  I see the multiple calls to add_ext and the different
results, so you are right, it's me!

Thanks!

Ron

> -Original Message-
> From: Michael Ströder
> 
> Ron Teitelbaum wrote:
> >
> 
> You should examine your exception handler...
> 
> > I've been getting errors: Can't contact LDAP server.  But it appears
> > that if
> > I retry bind, or search, (and now add) after hitting this error it
> > succeeds,
> > which is why I added a retry handler.
> 
> You might want to use yet undocumented ldapobject.ReconnectLDAPObject.
> It does a good job for this particular problem.
> 
> There are two calls of add_ext in there.
> 
> >  Any idea why I would get this result?
> 
> Well, it's your code... ;-)
> 
> Ciao, Michael.
> 



-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: Local Error in simple_bind_s();

2007-12-18 Thread Leons Petrazickis
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 = ldap.initialize("ldap://bluepages.ibm.com:636/",trace_level=2);
l.protocol_version = 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
=> 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
=> 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.egg/ldap/ldapobject.py",
 line 199, in simple_bind_s
return self.result(msgid,all=1,timeout=self.timeout)
  File
"/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.egg/ldap/ldapobject.py",
 line 428, in result
res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
  File
"/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.egg/ldap/ldapobject.py",
 line 432, in result2
res_type, res_data, res_msgid, srv_ctrls =
self.result3(msgid,all,timeout)
  File
"/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.egg/ldap/ldapobject.py",
 line 438, in result3
rtype, rdata, rmsgid, serverctrls =
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.egg/ldap/ldapobject.py",
 line 97, 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

Does this mean that the connection is successful, but then there is a crash
in message processing? What can I do?

Thanks,

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





   
 Michael Ströder   
 <[EMAIL PROTECTED] 
 .com>  To 
   Leons Petrazickis/Toronto/[EMAIL 
PROTECTED] 
 15/12/2007 08:30   cc 
 AM[EMAIL PROTECTED] 
   et  
   Subject 
   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

Re: Local Error in simple_bind_s();

2007-12-18 Thread Michael Ströder
Leons Petrazickis wrote:
> 
> I've installed Thorsten Kurbad's python_ldap-2.3.1-py2.4-linux-i686.egg on
> my Python 2.4 install

Which OS? Which Linux distribution? Which OpenLDAP libs?

> And this is the log output:

Cannot see anything obviously wrong.

> 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 crash
> in message processing?

Hmm, yes something's really strange.

If on Linux could you please check with ldd 
/_ldap.so which OpenLDAP libs are actually used.

Ciao, Michael.

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev