[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldapadd and "Invalid syntax"



> # ldapadd -x -D "cn=Manager,dc=uni-stuttgart,dc=de" -w XXXX -f root.ldif
> adding new entry "dc=uni-stuttgart,dc=de"
> ldap_add: Invalid syntax
>         additional info: value contains invalid data
> ldif_record() = 21

this means you have a schema violation.  you are trying to add an
attribute that you don't have defined in an ojbectclass or are trying to
add an objectclass that isn't defined or you haven't specified it's
parents.

> I run slapd with option -d 256 and it says:

just fyi, i played with all the debug options and i found 384 the most
useful.  it shows acls and binds which is where most of my problems were.

> conn=0 op=1 RESULT tag=105 err=21 text=value contains invalid data

this would seem to be the error here.

> root.ldif contains:
>
> dn: dc=uni-stuttgart,dc=de
> objectclass: dcObject
> objectclass: organization
> o: Universitaet Stuttgart
> dc: Uni-Stuttgart
>
> dn: cn=Manager,dc=uni-stuttgart,dc=de
> objectClass: organizationalRole
> cn: Manager

try adding these one by one.  i suspect that the first block will add just
fine.  and there is a problem with the second block.  you must list the
parents as all object classes.  you can find out what they are (if you
don't know) by looking at the SUP entry in the objectclass
definition in the schema file.

in this case your entry should look like this:

dn: cn=Manager,dc=uni-stuttgart,dc=de
objectClass: organizationalRole
objectClass: top
cn: Manager

adam.