Hi All,
My apologies in advance if this is not the right place to ask this noob question.
I am trying to create an ldap database with base dn: dc=tr,dc=tc. Once created it will be used to store the email accounts like username@tr.tc. When I execute the command to modify the dn entry, I get the following error
root@nizam-desktop:/home/nizam/Desktop# ldapadd -f user2.ldiff -xv -D "cn=admin,dc=tr,dc=tc" -h 127.0.0.1 -w 1234 ldap_initialize( ldap://127.0.0.1 ) add objectClass: top dcObject organization add dc: tr tc add description: top level of the tr.tc hierarchy adding new entry "dc=tr,dc=tc" modify complete ldap_add: Constraint violation (19) additional info: dc: multiple values provided
The user2.ldiff file looks like this: dn: dc=tr,dc=tc objectClass: top objectClass: dcObject objectClass: organization dc: tr dc: tc description: top level of the tr.tc hierarchy
dn: cn=admin,dc=tr,dc=tc objectClass: organizationalRole cn: admin description: LDAP Directory Administrator
dn: cn=user1,dc=tr,dc=tc objectClass: inetOrgPerson objectClass: inetLocalMailRecipient cn: user1 sn: user1lastname mail: user1@tr.tc userPassword: 1234 mailHost: 127.0.0.1
The configuration for the database dc=tr,dc=tc is as follows (part of /etc/ldap/slapd.conf)
database bdb suffix "dc=tr,dc=tc" rootdn "cn=admin,dc=tr,dc=tc" rootpw 1234 directory /var/lib/ldap/trtc defaultaccess read schemacheck on lastmod on index cn,sn,st,o eq,pres,sub
my OS is Ubuntu 7.10 and i am running slapd installed by the synaptic manager. root@nizam-desktop:/home/nizam/Desktop# uname -a Linux nizam-desktop 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux
Can anyone please tell me why I can not add dc=tr,dc=tc?
Kind regards, nizam
Nizameddin Ordulu writes:
ldap_add: Constraint violation (19) additional info: dc: multiple values provided
The 'dc' attribute in schema/core.schema is defined with SINGLE-VALUE, which means one object only can have one 'dc' value. Yours has two, 'tr' and 'tc':
dn: dc=tr,dc=tc objectClass: top objectClass: dcObject objectClass: organization dc: tr dc: tc description: top level of the tr.tc hierarchy
Keep 'dc: tr' matching the entry's RDN (the first component of the DN). Remove 'dc: tc'. That value would belong in an entry named 'dc=tc', but that entry doesn't belong in your server since you are presumably not running a server for the tc domain.
You also need to add an attribute 'o: name of your organization'. The 'organization' object class requires that the 'o' attribute is present.
For efficiency, add 'index objectClass eq' to slapd.conf, then run sbin/slapindex while slapd is down to rebuild indexes of your current database.
Nizameddin Ordulu wrote:
ldap_add: Constraint violation (19) additional info: dc: multiple values provided
Attribute 'dc' is defined as SINGLE-VALUE.
The user2.ldiff file looks like this: dn: dc=tr,dc=tc [..] dc: tr dc: tc
Simply removed the line dc: tc since only the attribute value for forming the RDN is needed in the entry.
Ciao, Michael.
Thanks a lot for the responses, as you both pointed out removing dc:tc solved my problem.
nizam
On Wed, Apr 23, 2008 at 5:43 PM, Michael Ströder michael@stroeder.com wrote:
Nizameddin Ordulu wrote:
ldap_add: Constraint violation (19) additional info: dc: multiple values provided
Attribute 'dc' is defined as SINGLE-VALUE.
The user2.ldiff file looks like this:
dn: dc=tr,dc=tc
[..]
dc: tr dc: tc
Simply removed the line dc: tc since only the attribute value for forming the RDN is needed in the entry.
Ciao, Michael.
openldap-technical@openldap.org