[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: continuous cache corruption behaviour ?



Hi,
   check in self.ldap_server.delete_s(dn) function if
you have made an ldap_bind to the rootdn with the
correct rootdn and rootpw.I hope you have not done
ldap_bind properly in delete.but have done it rightly
in self.ldap_server.add_s(dn)

Regards
Prashanth
--- Luc Stepniewski <luc.stepniewski@c2a.fr> wrote:
> Hello,
> 
> I get strange behaviour from OpenLDAP when adding
> NEW entries:
> 
> I'm using OpenLDAP 1.2.10 on a Debian GNU/Linux 2.2
> box. The LDAP
> database
> (which contains aliases) is interfaced with a
> Postfix STMP mailer.
> I've made a daemon that adds users to the LDAP
> database in Python.
> The only 'special' thing that it does is that it
> tries to remove the
> user before adding a new one (I don't test if it
> exists or not, I delete
> it):
> 
> try:
>    self.ldap_server.delete_s(dn)
> except:
>    pass
> try:
>    self.ldap_server.add_s(dn,[
>    ('objectclass', ['virtualuser']),
>    ('cn',[username]),
>    ('mailacceptinggeneralid', [username]),
>    ('maildrop', [alias])
>    ])
> except ldap.LDAPError,why:
>    print "Error adding user"
>    ...
> 
> With this, what happens is that I get sometimes (not
> every time) an
> error
> which says that the user already exists ! ({'desc':
> 'Already exists'}).
> 
> I don't understand how can this be possible, as I
> delete anything before
> adding a user. Moreover, when I look at the database
> records, the user
> doesn't exist (before invocation AND even after the
> error) !
> 
> Here are the entries I get in the logs:
> slapd[11337]: conn=5480 fd=19 connection from
> forwarder.domain.com
> (214.66.34.61) accepted.
> slapd[23792]: conn=5480 op=0 BIND
> dn="CN=ADMIN,DC=DOMAIN,DC=COM"
> method=128
> slapd[23792]: conn=5480 op=0 RESULT err=0 tag=97
> nentries=0
> slapd[23793]: conn=5480 op=1 DEL
> dn="CN=SOMEUSER@DOMAIN.COM,DC=DOMAIN,DC=COM"
> slapd[23793]: conn=5480 op=1 RESULT err=32 tag=107
> nentries=0
> slapd[23794]: conn=5480 op=2 ADD
> dn="CN=SOMEUSER@DOMAIN.COM,DC=DOMAIN,DC=COM"
> slapd[23794]: ====> entry
> cn=someuser@domain.com,dc=domain,dc=com id
> 6255 already in id cache
> slapd[23794]: cache_add_entry_lock failed
> slapd[23794]: conn=5480 op=2 RESULT err=68 tag=105
> nentries=0
> 
> Can anyone explain me why OpenLDAP returns these
> errors ? Is my database
> corrupted ?
> 
> Thanks,
> Luc Stepniewski <lstep@banquise.org>

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/