0

Problem:

I'm trying to delete an entry in a ldap directory. The entry exists but for some bad reasons the schema of the class of the entry doesn't exist anymore.

The entry I want to delete is the one with dn: userr=lucio,dc=labammsis:

$ ldapsearch -LLL -x -h 10.1.1.254 -b "dc=labammsis" -s sub
dn: dc=labammsis
objectClass: top
objectClass: dcObject
objectClass: organization
o: labammsis
dc: labammsis

dn: cn=admin,dc=labammsis
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator

dn: userr=lucio,dc=labammsis
objectClass: data
limit: 200

When I try to do the ldapdelete, I face an Invalid DN syntax error:

$ ldapdelete -x -D "cn=admin,dc=labammsis" -w "[mypassword]" -h 10.1.1.254 "userr=lucio,dc=labammsis"
ldap_delete: Invalid DN syntax (34)
    additional info: invalid DN

Do I face this error because the schema doesn't exist anymore? If yes, what could I do? If no, what's the problem then?

Personal researches:

Both on ServerFault and on the web there are plenty of people like me that face this error. Anyway, even if I read a lot of Q&A about this, they always seem to be on ldapadd or ldapmodify.

I found this post about ldapdelete, but the problem is about the order of the options in the command syntax.

1 Answer 1

0

After long reasearches, I found out that you can't delete an ldap entry of an objectClass if you have deleted the objectClass definition from the schema.

The solution is to add an objectClass to the schema with the same name of the objectClass you deleted, then delete the entry with ldapdelete and finally remove the objectClass from the schema.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .