Hello All,

I've been searching for an answer to this question but have come up blank.

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.

I'm using 
        {'objectclass':('organization',), 'o': 'test2'} input to modlist
which results in
        [('objectclass',('organization',)), ('o', 'test2')']

With a dn
        'o=test2, dc=example, dc=com'

I'm calling 'add_s'

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

First I check gq for the record and it does not exist.  I execute the add_s
code, get the Already Exists error then go back and check gq and the record
and it is there.

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.  Looking at the trace this could be my
problem.  It might be that it succeeds in the add but raises the Can't
contact server error anyway.  

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

I've attached the trace file.  Any idea why I would get this result?  If the
record was inserted then why am I getting this Can't contact error, and if
it didn't insert the record because it couldn't contact the server then why
am I getting the Already Exists error?

Any ideas about what may be causing either one of these errors are welcome!

Thank you for your help!

Ron Teitelbaum
*** ldap://127.0.0.1:389 - SimpleLDAPObject.set_option ((17, 3),{})
  ...SNIP...
=> result: (97, [], 1, [])
*** ldap://127.0.0.1:389 - SimpleLDAPObject.add_ext (('o=test2, dc=example, 
dc=com', [('objectclass', ('organization',)), ('o', 'test2')], None, None),{})
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 162, in add_s
    msgid = self.add(dn,modlist)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 159, in add
    return self.add_ext(dn,modlist,None,None)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 145, in 
add_ext
    return 
self._ldap_call(self._l.add_ext,dn,modlist,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 90, in 
_ldap_call
    traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
=> result: 2
*** ldap://127.0.0.1:389 - SimpleLDAPObject.result3 ((2, 1, -1),{})
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 163, in add_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 90, in 
_ldap_call
    traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
=> LDAPError - SERVER_DOWN: {'info': '', 'desc': "Can't contact LDAP server"}
*** ldap://127.0.0.1:389 - SimpleLDAPObject.add_ext (('o=test2, dc=example, 
dc=com', [('objectclass', ('organization',)), ('o', 'test2')], None, None),{})
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 162, in add_s
    msgid = self.add(dn,modlist)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 159, in add
    return self.add_ext(dn,modlist,None,None)
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 145, in 
add_ext
    return 
self._ldap_call(self._l.add_ext,dn,modlist,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 90, in 
_ldap_call
    traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
=> result: 3
*** ldap://127.0.0.1:389 - SimpleLDAPObject.result3 ((3, 1, -1),{})
  File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 163, in add_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 90, in 
_ldap_call
    traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
=> LDAPError - ALREADY_EXISTS: {'info': '', 'desc': 'Already exists'}
-------------------------------------------------------------------------
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
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev

Reply via email to