You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by George Stoianov <gs...@gmail.com> on 2007/04/03 22:38:45 UTC

Re: Loading ldif files into apache ds

Hi Emmanuel,

You will notice that I have from this post switched over to the user's
list... I hope I get the same or better responses there  ;).

Thanks for your instructions they were helpful in getting additional
partitions going I am still having an issue though:
root@localhost bin]# ./apacheds-tools.sh import -f <path-to-file>
       _                     _          ____  ____    _____           _
      / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ | |___
     / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \| / __|
    / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \__ \
   /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/ \___/|_|___/
           |_|

log4j:WARN No appenders could be found for logger
(org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication).
log4j:WARN Please initialize the log4j system properly.
Add of entry o=internet failed for the following reasons provided by the server:
failed to add entry o=internet: 2.5.4.10=internet already exists!
Import failed...

It seems like now it is making an attempt to add the internet entry
and failing, and the first problem was that it was not finding it so
it was not making an attempt to add I am really confused ..... :(

I tried adding an "-e" option to the import command above, I saw it
posted on the lists, and that lead to a:

Exception in thread "main" java.lang.NullPointerException
        at org.apache.directory.shared.ldap.codec.add.AddRequest.computeLength(AddRequest.java:281)
        at org.apache.directory.shared.ldap.codec.LdapMessage.computeLength(LdapMessage.java:535)
        at org.apache.directory.shared.ldap.codec.LdapMessage.encode(LdapMessage.java:613)
        at org.apache.directory.server.tools.ImportCommand.addEntry(ImportCommand.java:249)
        at org.apache.directory.server.tools.ImportCommand.execute(ImportCommand.java:666)
        at org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:115)

Is there a way to just load the ldif using the:
<property name="ldifDirectory">

I alsohave some attributes problems (the export is from a Netscape LDAP server).

"... nsuniqueid not found in attribute registry! "
"...  aci not found in attribute registry! "

If I remove these fields from the ldif will the import work?
Thank you.
George





On 3/29/07, Emmanuel Lecharny <el...@gmail.com> wrote:
> George,
>
> is it possible that you post questions about ADS usage to the users
> mailing list ? Not that we are overloaded by mails on the dev list, but
> your mail might be lost into the maelström of very technical mails here.
>
> Users mailing list help us to keep a better track on your problems, and
> eventually give you better answers !
>
> Of course, if your problems are related to things like 'I can't compile
> the server under Mandriva', then the dev list is the place to be :)
>
> Thanks a lot !
>
> Emmanuel
>

Re: Loading ldif files into apache ds

Posted by Alex Karasulu <ak...@apache.org>.
George,

On 4/3/07, George Stoianov <gs...@gmail.com> wrote:
>
> Hi Emmanuel,


SNIP ...

failed to add entry o=internet: 2.5.4.10=internet already exists!
> Import failed...


It sounds like you already have an entry here.  Check to see if it's
present.
If so this is a valid response from the server and the client.

Also if the command line tools may be suspect give LDAP studio a try.

http://directory.apache.org/ldapstudio

It seems like now it is making an attempt to add the internet entry
> and failing, and the first problem was that it was not finding it so
> it was not making an attempt to add I am really confused ..... :(


Again check that you did not add it already.  Browse what you have
with LS and see if it's still there.

I tried adding an "-e" option to the import command above, I saw it
> posted on the lists, and that lead to a:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.directory.shared.ldap.codec.add.AddRequest.computeLength(
> AddRequest.java:281)
>         at
> org.apache.directory.shared.ldap.codec.LdapMessage.computeLength(
> LdapMessage.java:535)
>         at org.apache.directory.shared.ldap.codec.LdapMessage.encode(
> LdapMessage.java:613)
>         at org.apache.directory.server.tools.ImportCommand.addEntry(
> ImportCommand.java:249)
>         at org.apache.directory.server.tools.ImportCommand.execute(
> ImportCommand.java:666)
>         at org.apache.directory.server.tools.ApachedsTools.main(
> ApachedsTools.java:115)
>
> Is there a way to just load the ldif using the:
> <property name="ldifDirectory">

http://directory.apache.org/ldapstudio
You could do this but LS might be easier.

I alsohave some attributes problems (the export is from a Netscape LDAP
> server).
>
> "... nsuniqueid not found in attribute registry! "
> "...  aci not found in attribute registry! "


These are netscape specific attributes.  ApacheDS will not have these ATs
defined.

If I remove these fields from the ldif will the import work?


It might but this all depends on the schema (objectClasses and
attributeTypes used by
the entries in your LDIF) which if not defined will raise schema
violations.  You may need
to install a new schema to support your LDIF or you may need to massage the
LDIF to use
existing schemas.

HTH,
Alex

Re: Loading ldif files into apache ds

Posted by George Stoianov <gs...@gmail.com>.
On 4/5/07, Alex Karasulu <ak...@apache.org> wrote:
> Sorry bad URL ... try this instead :
>
> http://svn.apache.org/repos/asf/directory/apacheds/releases/1.0.1/core/src/main/schema/
>
> Alex
>
> On 4/5/07, Alex Karasulu <ak...@apache.org> wrote:
> >
> > yeah there is an easier way ... take a look here:
> >
> > http://svn.apache.org/repos/asf/directory/apacheds/releases/1.0.1/apacheds/core/src/main/schemas/

Thank you very much, that is great I will have a look.
George

> >
> >
> > In there are the descriptors that are used to generate the sources.  It's
> > all in OpenLDAP format so it should be easier to read than the generated
> > code.
> >
> > Alex
> >
> >
> > On 4/5/07, George Stoianov <gs...@gmail.com> wrote:
> > >
> > > On 4/4/07, Alex Karasulu <ak...@apache.org> wrote:
> > > > On 4/4/07, George Stoianov <gs...@gmail.com> wrote:
> > > >
> > > >
> > > > nsUniqueId: 6a861786-1dd211b2-8094c2e0-bcc15857
> > > >
> > > >
> > > > This here will make the add bomb.  ApacheDS has no nsUniqueId since
> > > this is
> > > > a netscape specific attributeType.
> > >
> > > Hi Alex,
> > >
> > > I am reading this
> > > http://directory.apache.org/apacheds/1.0/custom-schema.html to figure
> > > out how to build the custom schema I obviously need, as massaging what
> > > I have is not working. Can you please tell me where are the
> > > definitions of the attributes that the available schemas have
> > > (Apachedns, Autofs). As far as I understand they are in Java classes
> > > is that correct? Do I need to look at the sourse code to figure that
> > > out or is there an easier way?
> > >
> > > TIA
> > > George
> > >
> > >
> > > >
> > > > Alex
> > > >
> > >
> >
> >
>

Re: Loading ldif files into apache ds

Posted by Alex Karasulu <ak...@apache.org>.
Sorry bad URL ... try this instead :

http://svn.apache.org/repos/asf/directory/apacheds/releases/1.0.1/core/src/main/schema/

Alex

On 4/5/07, Alex Karasulu <ak...@apache.org> wrote:
>
> yeah there is an easier way ... take a look here:
>
> http://svn.apache.org/repos/asf/directory/apacheds/releases/1.0.1/apacheds/core/src/main/schemas/
>
>
> In there are the descriptors that are used to generate the sources.  It's
> all in OpenLDAP format so it should be easier to read than the generated
> code.
>
> Alex
>
>
> On 4/5/07, George Stoianov <gs...@gmail.com> wrote:
> >
> > On 4/4/07, Alex Karasulu <ak...@apache.org> wrote:
> > > On 4/4/07, George Stoianov <gs...@gmail.com> wrote:
> > >
> > >
> > > nsUniqueId: 6a861786-1dd211b2-8094c2e0-bcc15857
> > >
> > >
> > > This here will make the add bomb.  ApacheDS has no nsUniqueId since
> > this is
> > > a netscape specific attributeType.
> >
> > Hi Alex,
> >
> > I am reading this
> > http://directory.apache.org/apacheds/1.0/custom-schema.html to figure
> > out how to build the custom schema I obviously need, as massaging what
> > I have is not working. Can you please tell me where are the
> > definitions of the attributes that the available schemas have
> > (Apachedns, Autofs). As far as I understand they are in Java classes
> > is that correct? Do I need to look at the sourse code to figure that
> > out or is there an easier way?
> >
> > TIA
> > George
> >
> >
> > >
> > > Alex
> > >
> >
>
>

Re: Loading ldif files into apache ds

Posted by Alex Karasulu <ak...@apache.org>.
yeah there is an easier way ... take a look here:

http://svn.apache.org/repos/asf/directory/apacheds/releases/1.0.1/apacheds/core/src/main/schemas/

In there are the descriptors that are used to generate the sources.  It's
all in OpenLDAP format so it should be easier to read than the generated
code.

Alex


On 4/5/07, George Stoianov <gs...@gmail.com> wrote:
>
> On 4/4/07, Alex Karasulu <ak...@apache.org> wrote:
> > On 4/4/07, George Stoianov <gs...@gmail.com> wrote:
> >
> >
> > nsUniqueId: 6a861786-1dd211b2-8094c2e0-bcc15857
> >
> >
> > This here will make the add bomb.  ApacheDS has no nsUniqueId since this
> is
> > a netscape specific attributeType.
>
> Hi Alex,
>
> I am reading this
> http://directory.apache.org/apacheds/1.0/custom-schema.html to figure
> out how to build the custom schema I obviously need, as massaging what
> I have is not working. Can you please tell me where are the
> definitions of the attributes that the available schemas have
> (Apachedns, Autofs). As far as I understand they are in Java classes
> is that correct? Do I need to look at the sourse code to figure that
> out or is there an easier way?
>
> TIA
> George
>
>
> >
> > Alex
> >
>

Re: Loading ldif files into apache ds

Posted by George Stoianov <gs...@gmail.com>.
On 4/4/07, Alex Karasulu <ak...@apache.org> wrote:
> On 4/4/07, George Stoianov <gs...@gmail.com> wrote:
>
>
> nsUniqueId: 6a861786-1dd211b2-8094c2e0-bcc15857
>
>
> This here will make the add bomb.  ApacheDS has no nsUniqueId since this is
> a netscape specific attributeType.

Hi Alex,

I am reading this
http://directory.apache.org/apacheds/1.0/custom-schema.html to figure
out how to build the custom schema I obviously need, as massaging what
I have is not working. Can you please tell me where are the
definitions of the attributes that the available schemas have
(Apachedns, Autofs). As far as I understand they are in Java classes
is that correct? Do I need to look at the sourse code to figure that
out or is there an easier way?

TIA
George


>
> Alex
>

Re: Loading ldif files into apache ds

Posted by Alex Karasulu <ak...@apache.org>.
On 4/4/07, George Stoianov <gs...@gmail.com> wrote:


nsUniqueId: 6a861786-1dd211b2-8094c2e0-bcc15857


This here will make the add bomb.  ApacheDS has no nsUniqueId since this is
a netscape specific attributeType.

Alex

Re: Loading ldif files into apache ds

Posted by George Stoianov <gs...@gmail.com>.
On 4/3/07, Emmanuel Lecharny <el...@gmail.com> wrote:
> George Stoianov a écrit :
>
> > Hi Emmanuel,
>
> Hi George,

Hi Emmanuel,

>
> >
> > You will notice that I have from this post switched over to the user's
> > list... I hope I get the same or better responses there  ;).
>
> Yes, thanks :) We will try to provide much better answer !

Excellent, I love the user's list! :)

>
> >
> > Thanks for your instructions they were helpful in getting additional
> > partitions going I am still having an issue though:
> > root@localhost bin]# ./apacheds-tools.sh import -f <path-to-file>
> >       _                     _          ____  ____    _____           _
> >      / \   _ __   __ _  ___| |__   ___|  _ \/ ___|  |_   _|__   ___ |
> > |___
> >     / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \    | |/ _ \ / _ \|
> > / __|
> >    / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) |
> > \__ \
> >   /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/    |_|\___/
> > \___/|_|___/
> >           |_|
> >
> > log4j:WARN No appenders could be found for logger
> > (org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication).
> > log4j:WARN Please initialize the log4j system properly.
> > Add of entry o=internet failed for the following reasons provided by
> > the server:
> > failed to add entry o=internet: 2.5.4.10=internet already exists!
> > Import failed...
>
> Have you tried with LdapStudio ? (I'm not very confident on apacheds
> tools ...)

It is funny to hear that :), they are made be apacheds, aren't they
;), and yes I did try LdapStudio same error

>
> Can you also post the ldif file or at least the ldif entry you are
> trying to insert ?

Here is the entry that is causing the above error:
-----------------------------------------------------------------------------
version: 1

# entry-id: 1
dn: o=internet
objectClass: top
objectClass: organization
o: internet
creatorsName: cn=directory manager
modifiersName: cn=directory manager
createTimestamp: 20060406132955Z
modifyTimestamp: 20060406132955Z
nsUniqueId: 6a861786-1dd211b2-8094c2e0-bcc15857
-----------------------------------------------------------------------------


>
> >
> > It seems like now it is making an attempt to add the internet entry
> > and failing, and the first problem was that it was not finding it so
> > it was not making an attempt to add I am really confused ..... :(
>
> The message says that the entry already exist... Strange. Can you see it
> with LdapStudio ?

Yes I can. It is there because I added it using the server.xml file.
The reason I did this is because when I attempted imports before
without having it in I got an error saying it was not found so I could
not import....

>
> >
> > I tried adding an "-e" option to the import command above, I saw it
> > posted on the lists, and that lead to a:
> >
> > Exception in thread "main" java.lang.NullPointerException
> >        at
> > org.apache.directory.shared.ldap.codec.add.AddRequest.computeLength(AddRequest.java:281)
> >
> >        at
> > org.apache.directory.shared.ldap.codec.LdapMessage.computeLength(LdapMessage.java:535)
> >
> >        at
> > org.apache.directory.shared.ldap.codec.LdapMessage.encode(LdapMessage.java:613)
> >
> >        at
> > org.apache.directory.server.tools.ImportCommand.addEntry(ImportCommand.java:249)
> >
> >        at
> > org.apache.directory.server.tools.ImportCommand.execute(ImportCommand.java:666)
> >
> >        at
> > org.apache.directory.server.tools.ApachedsTools.main(ApachedsTools.java:115)
> >
>
> Ohhh... That's a damn bug ! Can you post the ldif which generate this
> stack ? Is it possible that you have an empty value in the ldif file ?

The ldif has some sensitive data and is approx. 280 MB so I cannot
realy post it but if you do not mind working with me to find the entry
I will attempt to post that.

These are the lines just before the NullPointerException (as displayed
by the logging when starting the server in debug mode):

Add of entry cn=util.logservice.log4j.MyTool.configFile,ou=default,o=Pumis
Configuration failed for the following
failed to add entry
cn=util.logservice.log4j.MyTool.configFile,ou=default,o=Pumis
Configuration: Parent ou=default
.Add of entry cn=data.integration.destination.MainDispatch.name,ou=default,o=Pumis
Configuration failed for the fo
failed to add entry
cn=data.integration.destination.MainDispatch.name,ou=default,o=Pumis
Configuration: Parent ou=
Exception in thread "main" java.lang.NullPointerException
        at org.apache.directory.shared.ldap.codec.add.AddRequest.computeLength(AddRequest.java:281)
        at

the entry from the ldif reads:

 # entry-id: 260
   3249 dn: cn=data.integration.destination.MainDispatch.name,ou=default,o=Pumis
Con
   3250  figuration
   3251 objectClass: top
   3252 objectClass: pdsconfigoc
   3253 cn: data.integration.destination.MainDispatch.name
   3254 creatorsName: uid=configmaster,ou=people,o=pumis configuration
   3255 createTimestamp: 20060406133825Z
   3256 nsUniqueId: 7cb485fb-1dd211b2-8095c2e0-bcc15857
   3257 pdsConfigValue: topic$com_my_integ_sis_Sync
   3258 modifiersName: uid=configmaster,ou=people,o=pumis configuration
   3259 modifyTimestamp: 20070319163759Z
   3260
   3261 # entry-id: 261
   3262 dn: cn=content.path.ta.url,ou=default,o=Pumis Configuration
   3263 objectClass: top
   3264 objectClass: pdsconfigoc
   3265 cn: content.path.ta.url
   3266 creatorsName: uid=configmaster,ou=people,o=pumis configuration
   3267 createTimestamp: 20060406133825Z
   3268 nsUniqueId: 7cb485fc-1dd211b2-8095c2e0-bcc15857
   3269 pdsConfigValue:
   3270 modifiersName: uid=configmaster,ou=people,o=pumis configuration
   3271 modifyTimestamp: 20070319163759Z

The entry 261 is probably the one being processed when the exception
is thrown. The numbers are line numbers.

>
> >
> > Is there a way to just load the ldif using the:
> > <property name="ldifDirectory">
>
> You can tell the server to load a ldif file on startup, by modifying the
> server.xml file, yes.

I did so but I am not seeing anything in LDAPStudio where can I see
error messages or status etc.?? I am runnig the server in debug mode
nothing shows up. I am trying to load the same ldif I am attempting to
import, and if that causes problems then loading it should too right??

>
> >
> > I alsohave some attributes problems (the export is from a Netscape
> > LDAP server).
> >
> > "... nsuniqueid not found in attribute registry! "
> > "...  aci not found in attribute registry! "
> >
> > If I remove these fields from the ldif will the import work?
>
> Well, I don't know without looking at the file ... What I can say is
> that all the attributeTypes must be declared in the server if you want
> to be able to load them. For instance, the 'aci' attribute is likely to
> be Netscape specific, so is nsuniqueid (we don't have such attribute).
> You will have to declare them in the schema in order to be able to load
> a ldif file with such attributes.

OK how do I do that is it on the site? I will check...I am new to all
of this so any pointers are more than welcome.
Thanks again.

>
> > Thank you.
>
> My pleasure !
>
> Emmanuel
>