[turba] ldap gives error 17 when trying to edit entry

Ard Kuijpers kuijpers@db.mp.nl
Thu Oct 31 17:55:46 2002


Hi,

I am trying to setup and LDAP address book in Turba. I've come a long 
way and am almost ready. But one final thing is still missing: I cannot 
edit entries. I added the following in .../horde/turba/config/sources.php
-------------------------------------------------------------
$cfgSources['contacts'] = array(
     'title' => 'Contacts',
     'type' => 'ldap',
     'params' => array(
         'server' => 'localhost',
         'port' => 389,
         'root' => 'o=contacts.vvv.mp.nl',
         'bind_dn' => 'cn=Manager,o=contacts.vvv.mp.nl',
         'bind_password' => 'secret',
         'dn' => array('cn'),
         'objectclass' => array('person'),
         'filter' => '',
         'encoding' => 'utf8',
         'version' => 2
     ),
     'map' => array(
         '__key' => 'dn',
         'name' => 'cn',
         'email' => 'mail',
         'sirname' => 'sn'
     ),
     'search' => array(
         'name',
         'email'
     ),
     'strict' => array(
         'dn'
     ),
     'public' => true,
     'readonly' => false,
     'admin' => array('Manager'),
     'export' => false
);
-------------------------------------------------------------

The corresponding definition in /etc/openldap/slapd.conf is:
-------------------------------------------------------------
# ldbm definition for contacts database
database        ldbm
suffix          "o=contacts.vvv.mp.nl"
directory       /var/lib/ldap-contacts
rootdn          "cn=Manager,o=contacts.vvv.mp.nl"
rootpw          secret
-------------------------------------------------------------

Then in Turba I want can add persons in the address book 'Contacts'.
For instance when I add
name: Bart Simpson
e-mail: bart@simpson.org
I get the following syslog:
-------------------------------------------------------------
slapd[19902]: slapd starting
slapd[19907]: daemon: conn=0 fd=9 connection from IP=127.0.0.1:1483 
(IP=0.0.0.0:34049) accepted.
slapd[19909]: conn=0 op=0 BIND dn="CN=MANAGER,O=CONTACTS.VVV.MP.NL" 
method=128
slapd[19909]: conn=0 op=0 RESULT tag=97 err=0 text=
slapd[19909]: conn=0 op=1 UNBIND
slapd[19909]: conn=-1 fd=9 closed
slapd[19907]: daemon: conn=1 fd=9 connection from IP=127.0.0.1:1484 
(IP=0.0.0.0:34049) accepted.
slapd[19909]: conn=1 op=0 BIND dn="CN=MANAGER,O=CONTACTS.VVV.MP.NL" 
method=128
slapd[19909]: conn=1 op=0 RESULT tag=97 err=0 text=
slapd[19909]: conn=1 op=1 ADD dn="CN=BART SIMPSON,O=CONTACTS.VVV.MP.NL"
slapd[19909]: conn=1 op=1 RESULT tag=105 err=0 text=
slapd[19909]: conn=1 op=2 UNBIND
slapd[19909]: conn=-1 fd=9 closed
slapd[19907]: daemon: conn=2 fd=9 connection from IP=127.0.0.1:1485 
(IP=0.0.0.0:34049) accepted.
slapd[19909]: conn=2 op=0 BIND dn="CN=MANAGER,O=CONTACTS.VVV.MP.NL" 
method=128
slapd[19909]: conn=2 op=0 RESULT tag=97 err=0 text=
slapd[19909]: conn=2 op=1 SRCH base="cn=Bart 
Simpson,o=contacts.vvv.mp.nl" scope=0 filter="(objectClass=*)"
slapd[19909]: conn=2 op=1 SEARCH RESULT tag=101 err=0 text=
slapd[19909]: conn=2 op=2 UNBIND
slapd[19909]: conn=-1 fd=9 closed
-------------------------------------------------------------
So no problems there. But when I try to edit an entry, nothing happens. 
For instance I try to use the edit function to change the e-mail address 
from 'bart@simpson.org' to 'bart@simpson.com'. But this fails without 
giving a clear error message in Turba. The syslog shows the following:
-------------------------------------------------------------
slapd[19907]: daemon: conn=3 fd=9 connection from IP=127.0.0.1:1486 
(IP=0.0.0.0:34049) accepted.
slapd[19909]: conn=3 op=0 BIND dn="CN=MANAGER,O=CONTACTS.VVV.MP.NL" 
method=128
slapd[19909]: conn=3 op=0 RESULT tag=97 err=0 text=
slapd[19909]: conn=3 op=1 SRCH base="cn=Bart 
Simpson,o=contacts.vvv.mp.nl" scope=0 filter="(objectClass=*)"
slapd[19909]: conn=3 op=1 SEARCH RESULT tag=101 err=0 text=
slapd[19909]: conn=3 op=2 UNBIND
slapd[19909]: conn=-1 fd=9 closed
slapd[19907]: daemon: conn=4 fd=9 connection from IP=127.0.0.1:1487 
(IP=0.0.0.0:34049) accepted.
slapd[19909]: conn=4 op=0 BIND dn="CN=MANAGER,O=CONTACTS.VVV.MP.NL" 
method=128
slapd[19909]: conn=4 op=0 RESULT tag=97 err=0 text=
slapd[19909]: conn=4 op=1 SRCH base="cn=Bart 
Simpson,o=contacts.vvv.mp.nl" scope=0 filter="(objectClass=*)"
slapd[19909]: conn=4 op=1 SEARCH RESULT tag=101 err=0 text=
slapd[19909]: conn=4 op=2 MOD dn="cn=Bart Simpson,o=contacts.vvv.mp.nl"
slapd[19909]: conn=4 op=2 RESULT tag=103 err=17 text=dn: attribute type 
undefined
slapd[19909]: conn=4 op=3 UNBIND
slapd[19909]: conn=-1 fd=9 closed
slapd[19907]: daemon: conn=5 fd=9 connection from IP=127.0.0.1:1488 
(IP=0.0.0.0:34049) accepted.
slapd[19909]: conn=5 op=0 BIND dn="CN=MANAGER,O=CONTACTS.VVV.MP.NL" 
method=128
slapd[19909]: conn=5 op=0 RESULT tag=97 err=0 text=
slapd[19909]: conn=5 op=1 SRCH base="cn=Bart 
Simpson,o=contacts.vvv.mp.nl" scope=0 filter="(objectClass=*)"
slapd[19909]: conn=5 op=1 SEARCH RESULT tag=101 err=0 text=
slapd[19909]: conn=5 op=2 UNBIND
slapd[19909]: conn=-1 fd=9 closed
-------------------------------------------------------------
So the modification (look near MOD in the syslog) fails with error 17: 
"dn: attribute type undefined". I don't understand what is happening. Is 
Turba trying to change the 'dn' attribute (which it cannot find)?

When I try to change something manually, e.g. with:
ldapmodify -x  -D "cn=Manager,o=contacts.vvv.mp.nl" -W -f change.ldap
and file change.ldap:
-------------------------------------------------------------
dn: cn=Bart Simpson,o=contacts.vvv.mp.nl
changetype: modify
replace: mail
mail: bart@simpson.com
-------------------------------------------------------------
Then there is no problem.

I've been looking for two days now in newsgroups and on the internet, 
but I haven't found a solution. Is it a configuration or a Turba or 
openLDAP problem?

Sysinfo:
OpenLDAP 2.0.21
Horde 2.0
Turba 1.0
PHP 4.1.2

Regards, Ard