I'm trying to add groups to the my LDAP DB from a ldif file.
But I can not to do it becuase ldapadd returns ldap_add: Type or value exists (20).
$ ldapadd -x -W -v -D "cn=directory manager" -f ldap_groups.ldif
ldap_initialize( <DEFAULT> )
Enter LDAP Password:
add gidNumber:
3582
add objectClass:
top
groupofuniquenames
posixgroup
add cn:
group1
add uniqueMember:
... list of unique members here ...
adding new entry "cn=group1,ou=Groups,dc=mydomain,dc=com"
modify complete
add gidNumber:
4912
add objectClass:
top
groupofuniquenames
posixgroup
add cn:
group3
add uniqueMember:
... list of unique members here ...
adding new entry "cn=group3,ou=Groups,dc=mydomain,dc=com"
ldap_add: Type or value exists (20)
In result I have a successfully added part of groups untill group3
.
ldapsearch has not found the group3
:
$ ldapsearch -x -b "dc=mydomain,dc=com" |grep group3
$
Could you help me?
Best Answer
My ldif file had duplicates uniqueMember lines in those two groups. After deleting duplicates ldapadd groups completed successfully.