add_s: ldap.INVALID_DN_SYNTAX

Chaos Eternal chaoseternal at gmail.com
Sat Mar 10 05:33:28 CET 2007


hello there,
 Since your script is run by cron every one minute, i wonder that do
you have any lock mechanisms to prevent more than one instance of your
script to start? some buggy or mis-configured ldapserver can not work
properly when large amounts of write operations come simultaneously.
 What I suggest is carefully re-design your script. use some lock
mechanisms and some queue technologies.

On 3/10/07, Ervin Hegedüs <airween at gmail.com> wrote:
> Hello,
>
> > >   File "/usr/local/checkftpdir/Ldapfunctions.py", line 61, in addEntry
> > >     self.l.add_s(_dn, ldif)
> [...]
> > >   File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 94,
> > > in _ldap_call     result = func(*args,**kwargs)
> > > ldap.INVALID_DN_SYNTAX: {'info': 'invalid DN', 'desc': 'Invalid DN syntax'}
> >
> > This is an error the server sends back. Probably you're generating a DN
> > with invalid syntax. I'd recommend to set trace_level=2 with
> > ldap.initialize() to see what the python-ldap API receives from your script.
>
> I'm not sure about it - as I wrote when I run script from system shell (I mean:
> interactively), then script doesn't drop any exception. I try to print
> out the DN
> value, what I give to the function as first argument, and it looks
> like a normally
> DN, eg.: cn=airtest,ou=ftp,o=company,dc=domain,dc=com.
>
> There aren't any spaces, or other chars, what I miss then.
>
> By the way: I try to set up those trace_level, may be it will be more
> informative...
>
> thanks:
>
> a.
>
> 


More information about the python-ldap mailing list