directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tanguy tlrx <tlrx....@gmail.com>
Subject Re: LDAP error code 80 when recursively delete entry
Date Thu, 21 Mar 2013 11:07:26 GMT
Thanks Emmanuel,

You pointed me to the right direction: I can see in
the DeleteRequestHandler log that Spring Ldap is not deleting all the sub
entries before trying to unbind the parent entry.

The deleteRecursively method of Spring Ldap list all sub entries with
Context.listBindings() method, but in my case not all results are returned.

----
protected void deleteRecursively(DirContext ctx, DistinguishedName name) {

NamingEnumeration enumeration = null;
try {
enumeration = ctx.listBindings(name);  // Not all results here
while (enumeration.hasMore()) {
Binding binding = (Binding) enumeration.next();
DistinguishedName childName = new DistinguishedName(binding.getName());
childName.prepend((DistinguishedName) name);
deleteRecursively(ctx, childName);
}
ctx.unbind(name);
if (log.isDebugEnabled()) {
log.debug("Entry " + name + " deleted");
}
}
catch (javax.naming.NamingException e) {
throw LdapUtils.convertLdapException(e);
}
finally {
try {
enumeration.close();
}
catch (Exception e) {
// Never mind this
}
}
}
----

By the way, I reimplemented a recursive delete and it seems to work now.

Wasn't an ApacheDS bug at all.

And we already planned to update to M11 version :=)

Thanks again,

-- Tanguy



2013/3/21 Emmanuel Lécharny <elecharny@gmail.com>

> Hi,
>
> What would be helpful here is that yoi just activate the
> DeleteRequestHandler log only, by modifying the ApacheDS
> log4j.properties this way :
>
> log4j.rootCategory=OFF, stdout
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] -
> %m%n
>
>
> log4j.logger.org.apache.directory.server.ldap.handlers.request.DeleteRequestHandler=DEBUG
>
>
> You will get a trace with the delete requests.
>
>
> I wonder if they are received in the right order.
>
> Also you should switch to ApacheDS 2.0.0-M11, there are ciritical fixes
> in this version (although they should not be teh cause of your issue)
>
>
> Le 3/21/13 10:36 AM, Tanguy tlrx a écrit :
> > Hi all,
> >
> > We are using the Spring LDAP framework (1.3.1.RELEASE) to create/update
> and
> > delete LDAP entries in an ApacheDS (2.0.0-M10) server.
> >
> > In a custom partition, we create entries with a custom objectClass
> defined
> > in our schema. Theses entries have sub-entries, also with a custom
> > objectClass.
> >
> > We use the recursive delete method of the LdapTemplate object (provided
> by
> > spring ldap framework) to delete a parent entry, and we sometimes (but
> not
> > always) have the following exception:
> >
> > -----
> > org.springframework.ldap.UncategorizedLdapException: Uncategorized
> > exception occured during LDAP processing; nested exception is
> > javax.naming.NamingException: [LDAP: error code 80 - OTHER: failed for
> > MessageType : SEARCH_REQUEST
> > Message ID : 2
> > SearchRequest
> > baseDn : 'cn=license2,ou=licenses,o=myorg'
> > filter : '(objectClass=*:[244])'
> > scope : single level
> > typesOnly : false
> > Size Limit : no limit
> > Time Limit : no limit
> > Deref Aliases : deref Always
> > attributes :
> >
> org.apache.directory.api.ldap.model.message.SearchRequestImpl@96abbb02ManageDsaITImpl
> > Control
> > Type OID : '2.16.840.1.113730.3.4.2'
> > Criticality : 'false'
> > '
> > : null]; remaining name 'cn=license2,ou=licenses'
> > at
> >
> org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:217)
> > at
> >
> org.springframework.ldap.core.LdapTemplate.deleteRecursively(LdapTemplate.java:1122)
> > at
> >
> org.springframework.ldap.core.LdapTemplate$25.executeWithContext(LdapTemplate.java:1083)
> > at
> >
> org.springframework.ldap.core.LdapTemplate.executeWithContext(LdapTemplate.java:807)
> > at
> >
> org.springframework.ldap.core.LdapTemplate.executeReadWrite(LdapTemplate.java:802)
> > at
> >
> org.springframework.ldap.core.LdapTemplate.doUnbindRecursively(LdapTemplate.java:1081)
> > at
> org.springframework.ldap.core.LdapTemplate.unbind(LdapTemplate.java:1044)
> > -----
> >
> > The deleteRecursively method simply tries to unbind sub entries before
> the
> > parent entry. I can't debug what is going on on ApacheDS side because to
> > many DEBUG traces are logged :/ When looking into the LDAP, the entry +
> sub
> > entries are not deleted.
> >
> > Do you have any idea? There's an index defined in the partition for "cn"
> > attribute, do you think it can be the origin of the issue?
> >
> > Thanks,
> >
> > -- Tanguy
> >
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message