Custom tree in LDAP - ldap

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

Related

Adding initial entries in openldap returns- ldap_add: No such object (32)

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

Error while importing LDIF file in Apache Directory Studio

I'm connected to my LDAP connection.
I'm trying to import an LDIF file to it by right clicking and using the wizard.
As I choose the file, check the overwrite option and press OK,
I get the following error:
Error while importing LDIF
javax.naming.NameAlreadyBoundException:
at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkResponse(DirectoryApiConnectionWrapper.java:1359)
And this appears in the Modification Logs tab:
#!RESULT ERROR
#!CONNECTION ldap://192.168.99.100:389
#!DATE 2018-01-24T11:01:17.743
#!ERROR
dn: dc=mycompany,dc=net
changetype: add
dc: mycompany
objectclass: dcObject
objectclass: organization
o: mycompany.net
I tried googling around with the error but can't find anything on this particular matter.
Also, as I choose the LDIF-file, even after uninstalling and reinstalling the program, it warns already upon selecting the LDIF-file that "selected logfile already exists".
The description of javax.naming.NameAlreadyBoundException sounds like this is a weird name for the LDAP result code entryAlreadyExists(68) returned when processing the LDAP Add Operation.
It means just that: An LDAP entry with this DN already exists. You cannot add a second one with the same DN.

Two domain components of 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.

Error while importing LDIF

Server: Apache DS 2.0
Client: Apache Directory Studio 2.0
The problem: I am running into error while importing a LDIF
This one works http://pastebin.com/DKZ4fT0U
This one does not http://pastebin.com/Z5NxUxX4
Error message: #!ERROR [LDAP: error code 32 - NO_SUCH_OBJECT: failed for MessageType : ADD_REQUEST Message ID : 81 Add Request : Entry dn[n]: dc=example,dc=zzz objectClass: dcObject objectClass: organization description: My wonderful company as much text as you want to place in this line up to 32K continuation data for the line above must have <CR> or <CR><LF> i.e. ENTER works on both Windows and *nix system - new line MUST begin with ONE SPACE dc: example o: Example, Inc. : ERR_268 Cannot find a partition for dc=example,dc=zzz]
The difference between the one that works and the one that doesn't work is - I replaced "com" with "zzz"
Note: I did delete the previous entry before importing the new LDIF
What am I missing?
The server should have a partition dc=example,dc=zzz configured first, otherwise server will reject any entry with the above suffix.

Unable to use user-defined object class in Apache DS Studio

I defined an object class and want to use it in my organizationalUnit. But as I attached the screenshot, I can't see my object class(aibu-staff) in the entry list.
When I try to import LDIF file into DIT, getting an error like this:
Error while importing LDIF
- [LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for Add Request
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for Add Request :
ClientEntry
dn: cn=aibu, ou=schema
objectclass: metaSchema
objectclass: top
cn: aibu
m-dependencies: system
m-dependencies: cosine
m-dependencies: nis
m-dependencies: inetorgperson
m-dependencies: core
: Unwilling to perform operation on enabled schema with disabled or missing dependencies: nis]; remaining name 'cn=aibu, ou=schema'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3160)
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.ImportLdifJob.importLdifRecord(ImportLdifJob.java:457)
at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifJob.importLdif(ImportLdifJob.java:267)
at org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifJob.executeNotificationJob(ImportLdifJob.java:204)
at org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob.executeAsyncJob(AbstractNotificationJob.java:43)
at org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob.run(AbstractEclipseJob.java:101)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for Add Request :
ClientEntry
dn: cn=aibu, ou=schema
objectclass: metaSchema
objectclass: top
cn: aibu
m-dependencies: system
m-dependencies: cosine
m-dependencies: nis
m-dependencies: inetorgperson
m-dependencies: core
: Unwilling to perform operation on enabled schema with disabled or missing dependencies: nis]
Windows has a poss-Superiors attribute that defines what kind of objects that can be the parent of an object. You might need to add organizational unit.
You need to refresh the schema object before you can see the user defined object. I was always able to do this without any problems. (Programmatically using JNDI as well).