I'm trying to add two entries in ldap just below one another. But it's not letting me add. Error-
adding new entry "dc=R2D2"
ldap_add: No such object (32)
additional info: Unable to add entry 'dc=R2D2' because its parent entry 'null' does not exist in the server.
This is a new openLDAP server running on a Feora29. I've tried many modifications to my ldif file but it's still not working.
The LDAP expected structure:
dc=R2D2 -> o=TD
I have added objectClass: country on line 4 because it said:
adding new entry "dc=R2D2"
ldap_add: Object class violation (65)
additional info: Unable to add entry 'dc=R2D2' because it violates the provided schema: The entry does not have a structural object class.
This is the ldif i'm trying to add via ldapadd
dn: dc=R2D2
dc: R2D2
objectClass: dcObject
objectClass: country
objectClass: top
c=DE
dn: o=TD,dc=R2D2
o: TD
objectClass: organization
objectClass: top
The LDAP result code noSuchObject (32) returned for a failed add operation means that the parent entry was not found.
If dc=R2D2 is really the full DN of the entry to be added, then you have to define a database with this particular DN used as database suffix.
For static OpenLDAP config method this would look like:
[..]
database mdb
suffix dc=R2D2
[..]
See also: OpenLDAP Software 2.4 Administrator's Guide
I guess this is because your ldif has an unnecessary space character at line 4 (after "country" like "country ").
I have been able to successfully execute ldapadd command with the following ldif that has no unnecessary space character after "country":
dn: dc=R2D2
dc: R2D2
objectClass: dcObject
objectClass: country
objectClass: top
c: DE
dn: o=TD,dc=R2D2
o: TD
objectClass: organization
objectClass: top
New to LDAP. Exported the DIT as an LDIF from Apache Studio. Tried to import the LDIF file. Error occurs:
...
#!ERROR [LDAP: error code 32 - Unable to add entry 'dc=example,dc=com' because its parent entry 'dc=com' does not exist in the server.]
dn: dc=example,dc=com
changetype: add
dc: example
objectClass: domain
objectClass: top
The LDAP server is UnboundID LDAP SDK for Java 3.2.0.
I don't know enough LDAP to fix it.
Should Apache Studio have created dc=com before this entry?
LDIF export does not guarentee ordering. LDIF import assumes ordering.
So to answer your question, yes, you should have created dc=com first.
There is a subtle exception where you can have a dc=example.com as a single node which looks confusing. But periods are legal in a name.
I just Installed OpenLDAP on Ubuntu Server 12.10, and I added an ldif file using slapadd -c -l init.ldif as the following :
dn:dc=tpw,dc=uca,dc=ma
dc: tpw
objectClass: dcObject
objectClass: top
objectClass: domain
dn: ou=people,dc=tpw,dc=uca,dc=ma
ou: people
objectClass: organizationalUnit
objectClass: top
dn: ou=groupes,dc=tpw,dc=uca,dc=ma
ou: groupes
objectClass: organizationalUnit
objectClass: top
dn: uid=admin,ou=people,dc=tpw,dc=uca,dc=ma
uid: admin
sn: Admin
cn: Admin
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
userPassword:: e1NIQX0wRFBpS3VOSXJyVm1EOElVQ3V3MWhReE5xWmM9
mail: admin#uca.ma
givenName: admin
dn: cn=GI,ou=groupes,dc=tpw,dc=uca,dc=ma
uniquemember: uid=admin,ou=people,dc=tpw,dc=uca,dc=ma
cn: GI
objectClass: groupOfUniqueNames
objectClass: top
dn: cn=GP,ou=groupes,dc=tpw,dc=uca,dc=ma
uniquemember: uid=admin,ou=people,dc=tpw,dc=uca,dc=ma
cn: GP
objectClass: groupOfUniqueNames
objectClass: top
dn: cn=GT,ou=groupes,dc=tpw,dc=uca,dc=ma
uniquemember: uid=admin,ou=people,dc=tpw,dc=uca,dc=ma
cn: GT
objectClass: groupOfUniqueNames
objectClass: top
Now my ldap tree looks like this :
Then I tried to add a new inetOrgPerson using Apache Directory Studio, but I got this error :
[LDAP: error code 80 - index generation failed]
Then I tried the same thing using phpLDAPadmin, but I got this error :
Impossible d'ajouter l'objet au serveur LDAP.
LDAP dit :: Other (e.g., implementation specific) error
Erreur numéro :: 0x50 (LDAP_OTHER)
Then I created a file which I named xx.ldif :
dn: uid=xx,ou=people,dc=tpw,dc=uca,dc=ma
cn: XX
givenname: xx
mail: xx#edu.uca.ma
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
objectclass: top
sn: XX
uid: xx
userpassword: toor
And I tried to add this entry using this command via terminal :
sudo ldapadd -x -D cn=Manager,dc=tpw,dc=uca,dc=ma -W -f xx.ldif
But I got this error :
ldap_add: Other (e.g., implementation specific) error (80)
additional info: index generation failed
How can I solve this problem ?
PS : In another scenario I deleted my database and I modified the file init.ldif wich contains all the entries I want to add, and I added the entry xx, then I imported my file using the slapadd command, but In this way I have to delete the database every time I want to add a new entry, which is not practical.
Edit1 :
This is the output of the command slapindex :
WARNING!
Runnig as root!
There's a fair chance slapd will fail to start.
Check file permissions!
5370d6f9 /etc/ldap/slapd.conf: line 95: rootdn is always granted unlimited privileges.
5370d6f9 /etc/ldap/slapd.conf: line 112: rootdn is always granted unlimited privileges.
5370d6f9 hdb_db_open: database "dc=tpw,dc=uca,dc=ma": database already in use.
5370d6f9 backend_startup_one (type=hdb, suffix="dc=tpw,dc=uca,dc=ma"): bi_db_open failed! (-1)
slap_startup failed
The first thing is that init.ldif file seems to be misconfigured :
domainComponent "uca" (dc=uca) is missing, there should be an entry (dcObject or domain objectClass) to define this attribute that holds a component of the domain name.
dcObject is intended to be used in entries for which there is an appropriate structural object class. For example, if the domain represents a particular organization, the entry would have as its structural object class 'organization', and the 'dcObject' class would be an auxiliary class.
domain is a structural object class used for entries in which no other information is being stored. The domain object class is typically used for entries that are placeholders or whose domains do not correspond to real-world entities.
In your .ldif file you can replace the first entry "dn: dc=tpw,dc=uca,dc=ma" with these 2 (then delete your database again and redo the slapadd command) :
dn: dc=uca,dc=ma
objectClass: top
objectClass: organization
objectClass: dcObject
dc: uca
o: an organization name (mandatory with 'organization' objectClass)
dn: dc=tpw,dc=uca,dc=ma
objectClass: top
objectClass: domain
dc: tpw
Second thing : obviously you have landed into an index issue. I think you do want to use indexes but if not, find and remove any line beginning with index from slapd.conf, e.g. :
index objectClass eq.
Remember to stop slapd and run slapindex after every change comitted to the index definitions in slapd.conf, and ensure all ldap clients have been disconnected before running slap commands to prevent database already in use messages.
So take the hints given you by slapindex. Don't run slapd as root, fix lines 95 and 112, and don't run slapd twice, or fix whatever is causing it to think the database is already in use.
While this isn't relevant to the OP's question, I ran into a similar error of:
bdb_db_open: database already in use
or
hdb_db_open: database "dc=XXX,dc=XXX,dc=XXX": database already in use.
One of our Openshift nodes went down and the PVC's (mount) /var/lib/ldap/ __db.001, __db.002 and __db.003 had become locked. After googling for hours, the only solution I found was to perform the following (and note, since it was OpenShift, I had to use a debug pod to get a shell).
mkdir /var/lib/ldap/backup
mv /var/lib/ldap/__db.* /var/lib/ldap/backup
Try and restart slapD, if it still fails as it did with one of OpenLDap instances, then move the alock file
mv /var/lib/ldap/__db.* /var/lib/ldap/backup
Restart slapD or in our instance delete the OpenShift pod and let it be recreated. Everything may now be working as it did for us - hope this might help anyone else running into the same issue.
I am working now with the Apache Directory Server. I am a freshman in LDAP.
After few paragraphs of reading about it I noticed that I need my own tree to particular case that I want to design. For know, let's say I have some domain bubble.com. I want to create dc object for it dc=buble, dc=com. When I try to do so using Apache Directory Studio I get the following error:
Error while creating entry
- [LDAP: error code 32 - NO_SUCH_OBJECT: failed for Add Request
javax.naming.NameNotFoundException: [LDAP: error code 32 - NO_SUCH_OBJECT: failed for Add Request :
ClientEntry
dn: dc=bubble+dc=com
objectClass: dcObject
objectClass: top
dc: bubble
dc: com
: ERR_268 Cannot find a partition for dc=bubble+dc=com]; remaining name 'dc=bubble+dc=com'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3112)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2840)
at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:811)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:337)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:266)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper$4.run(JNDIConnectionWrapper.java:658)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.runAndMonitor(JNDIConnectionWrapper.java:1272)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.checkConnectionAndRunAndMonitor(JNDIConnectionWrapper.java:1203)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.createEntry(JNDIConnectionWrapper.java:704)
at org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable.createEntry(CreateEntryRunnable.java:226)
at org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable.run(CreateEntryRunnable.java:117)
at org.apache.directory.studio.connection.ui.RunnableContextRunner$1.run(RunnableContextRunner.java:113)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
[LDAP: error code 32 - NO_SUCH_OBJECT: failed for Add Request :
ClientEntry
dn: dc=bubble+dc=com
objectClass: dcObject
objectClass: top
dc: bubble
dc: com
: ERR_268 Cannot find a partition for dc=bubble+dc=com]
To be honest, I don't really understand what is going on. What is the idea of partitions?Is it possible to create own dc in such way? Or maybe do I have to put everything into ou=schema or ou=system? What is the purpose of ou=schema and ou=system, present in ADS by default?
dc=bubble+dc=com is a distinguished name with a multi-valued relative distinguished name, and no parent. The DIT must have a suffix or namingContext hosted by a backend and then you could add the entry as a subordinate to that suffix or namingContext, for example, dc=bubble+dc=com,o=my-suffix.
You need to restart apacheds service on remote server, this tutorial explains in details: https://technology.amis.nl/2014/10/22/getting-started-with-apacheds-ldap-server-and-directory-studio/
Create data partition with the suffix "dc=bubble,dc=com".
http://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html
I have successfully registered and retrieved the connection factory object from LDAP server.But when i try to look up for queue from LDAP server it gives NPE.
I'm using OracleAQ with ApacheDS..
My code is;
DirContext destctxQF = (DirContext) inictx.lookup("cn=OracleDBQueues");
System.out.println("OracleDBQueues look up success " + destctxQF.toString());
Queue queue = (Queue) destctxQF.lookup("cn=ratha.test");
And my LDIF definition for the queue is;
dn: cn=ratha.test,cn=OracleDBQueues,cn=ORCL,cn=OracleContext,ou=Services,o=s
gi,c=us
objectClass: javaContainer
objectClass: orclDBAQObject
objectClass: javaNamingReference
objectClass: javaObject
objectClass: top
cn: ratha.test
javaClassName: oracle.jms.AQjmsDestination
orcldbaqobjtype: Queue
javaFactory: oracle.jms.AQjmsDestinationFactory
orcldbaqobjname: test
orcldbaqobjowner: ratha
orcldbaqpointerattr: cn=ratha.test_table,cn=OracleDBQueuesTables,cn=ORCL,cn=
OracleContext,ou=Services,o=sgi,c=us
Any clue on this?
Complete error stack is;
javax.naming.NamingException: problem generating object using object factory [Root exception is java.lang.NullPointerException]; remaining name 'cn=ratha.test'
at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:1070)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(ComponentContext.java:526)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:159)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:148)
at OracleAQJNDIClient.get_Factory_from_LDAP(OracleAQJNDIClient.java:93)
at OracleAQJNDIClient.main(OracleAQJNDIClient.java:142)
Caused by: java.lang.NullPointerException
at oracle.jms.AQjmsDestinationFactory.getObjectInstance(AQjmsDestinationFactory.java:120)
at javax.naming.spi.DirectoryManager.getObjectInstance(DirectoryManager.java:176)
at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:1063)
... 5 more
Thanks,
-Ratha