OpenLDAP error ldapadd: Undefined attribute type (17)

How  to  Solve  this  error :

[root@localhost openldap]# /usr/bin/ldapadd -a -x -D ‘cn=Manager,dc=ldap-kike,dc=com,dc=uy’ -W -f ldap-init.ldif
Enter LDAP Password:
ldapadd: attributeDescription “dn”: (possible missing newline after line 5 of entry “dc=ldap-kike,dc=com,dc=uy”?)
adding new entry “dc=ldap-kike,dc=com,dc=uy”
ldapadd: Undefined attribute type (17)
additional info: dn: attribute type undefined

 

Solution  :

You need an empty line before each line starting with “dn:”
LDIF separates entries by blank lines.
dn: denotes the distinguished name of an entry and
needs to be the first line of each entry.
example :

 

###EMPTY line
dn: dc=ldap-kike,dc=com,dc=uy
objectclass: dcObject
objectclass: organization
o: Servidor LDAP ldap-kike
dc: ldap-kike
###EMPTY line
dn: cn=Manager,dc=ldap-kike,dc=com,dc=uy
objectclass: organizationalRole
cn: Manager

 

save  and  exit , restart  ldap      and  try  again

 

 

[root@localhost openldap]# /etc/init.d/ldap start
Checking configuration files for slapd:  config file testing succeeded[  OK  ]
Starting slapd:                                                                          [  OK  ]

 

[root@localhost openldap]# /usr/bin/ldapadd -a -x -D ‘cn=Manager,dc=ldap-kike,dc=com,dc=uy’ -W -f ldap-init.ldif
Enter LDAP Password:
adding new entry “dc=ldap-kike,dc=com,dc=uy”

adding new entry “cn=Manager,dc=ldap-kike,dc=com,dc=uy”

[root@localhost openldap]#