From: Bing D. <Bi...@ci...> - 2001-02-23 15:15:34
|
I have the following two lines in the ldif. Ldapmodify command can modify the first entry without any problem. But gives 'constraint violation' on the second one. Do I have to split them into two ldif's? ==== dn: uid=111,ou=dept-1,dc=tamu,dc=edu changetype: modrdn newrdn: uid=222 deleteoldrdn: 1 dn: uid=111,ou=dept-2,dc=tamu,dc=edu changetype: modrdn newrdn: uid=222 deleteoldrdn: 1 ===== Any ideas? Thanks, Bing Bing Du <bi...@ta..., 979-845-9577> Texas A&M University, CIS, Operating Systems, Unix >>> Andrew Tristan <atr...@ac...> 02/22/01 10:36PM >>> Actually I solved the problem just as I was getting ready to send this. On the off chance that this will help someone else, here it is. > I *know* I had this working at some point (at least, I thought I had). > I'm getting "LDAP_NO_SUCH_ATTRIBUTE" when I call moddn() like so, > my $moddnResult = $ldap->moddn( > $ldapDN, > newrdn => "cid=$ldifCID", > deleteoldrdn => '1', > newsuperior => "$personDN", > ); > > I get the same result whether the first arg is a dn or an entry > object. This is with v0.22, perl 5.005something, and openldap > 1.2.something. There were problems with moddn a while ago, I know, > but I'm almost positive that I had this working at some point after > that. I'm sure I'm doing something obviously wrong, any takers? > It's always so obvious in retrospect (though I didn't provide enough info above to solve it): I was calling modify() to manually set the cid attribute (our rdn) before I called moddn(). And then it all makes sense... A -- and...@uc... Unix Systems Group, UC Riverside |
From: Bing D. <Bi...@ci...> - 2001-02-23 17:23:00
|
I checked both online ducumentation about ldapmodify and RFC. Did not see anything wrong with my ldif. Ok, here is how the entries looked like before ldapmodify was executed. Name part was omitted. ========================= uid=c24b18d4bb4afdf052330678af9a601d, ou=Mailusers, dc=tamu, dc=edu objectClass=top objectClass=person objectClass=organizationalPerson objectClass=inetOrgPerson objectClass=tamuPerson objectClass=tamuEmployee cn=<omitted> sn=<omitted> uid=c24b18d4bb4afdf052330678af9a601d uid=c24b18d4bb4afdf052330678af9a601d, ou=People, dc=tamu, dc=edu objectClass=top objectClass=person objectClass=organizationalPerson objectClass=inetOrgPerson objectClass=tamuPerson objectClass=tamuEmployee cn=<omitted> sn=<omitted> uid=c24b18d4bb4afdf052330678af9a601d ========================= Ldif: ================== dn:uid=c24b18d4bb4afdf052330678af9a601d,ou=People,dc=tamu,dc=edu changetype: modrdn newrdn: uid=20f5a60eacf9ce9e0c3eff5489c5f975 deleteoldrdn: 1 dn:uid=c24b18d4bb4afdf052330678af9a601d,ou=Mailusers,dc=tamu,dc=edu changetype: modrdn newrdn: uid=20f5a60eacf9ce9e0c3eff5489c5f975 deleteoldrdn: 1 =================== Command executed: ============ % /opt/Isode/bin/ldapmodify -h morpheus -D "cn=dsa manager,cn=dsa,dc=tamu,dc=edu" -w "<omitted>" -f modrdn.input -v -d 15 1>modrdn.output 2>&1 ============= Ldapmodify output: =============== ldap_init ldap_bind_s ldap_simple_bind_s ldap_simple_bind ldap_send_initial_request open_ldap_connection ldap_connect_to_host: morpheus:389 sd 4 connected to: 255.255.255.255 ldap_delayed_open successful, ld_host is (null) ldap_send_server_request ber_flush: 58 bytes to sd 4 0 8 02 01 01 ` 3 02 01 02 04 $ c n = d s a 20 m a n a g e r , c n = d s a , d c = t a m u , d c = e d u 80 08 <password omitted> ldap_result wait4msg (infinite timeout) ** Connections: * host: morpheus port: 389 (default) refcnt: 2 status: Connected last used: Fri Feb 23 10:47:32 2001 ** Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ** Response Queue: Empty do_ldap_select read1msg ber_get_next ber_get_next: tag 0x30 len 12 contents: ber_dump: buf 0x1002a0b8, ptr 0x1002a0b8, end 0x1002a0c4 current len 12, contents: 02 01 01 a 07 0a 01 00 04 00 04 00 got result msgid 1, original id 1 new result: res_errno: 0, res_error: <>, res_matched: <> read1msg: 0 new referrals request 1 done res_errno: 0, res_error: <>, res_matched: <> ldap_free_request (origid 1, msgid 1) ldap_free_connection ldap_free_connection: refcnt 1 ldap_result2error ldap_msgfree ldap_modrdn ldap_send_initial_request ldap_send_server_request ber_flush: 111 bytes to sd 4 0 m 02 01 02 l h 04 = u i d = c 2 4 b 1 8 d 4 b b 4 a f d f 0 5 2 3 3 0 6 7 8 a f 9 a 6 0 1 d , o u = P e o p l e , d c = t a m u , d c = e d u 04 $ u i d = 2 0 f 5 a 6 0 e a c f 9 c e 9 e 0 c 3 e f f 5 4 8 9 c 5 f 9 7 5 01 01 ff ldap_result wait4msg (infinite timeout) ** Connections: * host: morpheus port: 389 (default) refcnt: 2 status: Connected last used: Fri Feb 23 10:47:32 2001 ** Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** Response Queue: Empty do_ldap_select read1msg ber_get_next ber_get_next: tag 0x30 len 12 contents: ber_dump: buf 0x1002a0b8, ptr 0x1002a0b8, end 0x1002a0c4 current len 12, contents: 02 01 02 m 07 0a 01 00 04 00 04 00 got result msgid 2, original id 2 new result: res_errno: 0, res_error: <>, res_matched: <> read1msg: 0 new referrals request 2 done res_errno: 0, res_error: <>, res_matched: <> ldap_free_request (origid 2, msgid 2) ldap_free_connection ldap_free_connection: refcnt 1 ldap_result2error ldap_msgfree new RDN: uid=20f5a60eacf9ce9e0c3eff5489c5f975 (do not keep existing values) modifying rdn of entry uid=c24b18d4bb4afdf052330678af9a601d,ou=People,dc=tamu,dc =edu modrdn completed ldap_modrdn ldap_send_initial_request ldap_send_server_request ber_flush: 114 bytes to sd 4 0 p 02 01 03 l k 04 @ u i d = c 2 4 b 1 8 d 4 b b 4 a f d f 0 5 2 3 3 0 6 7 8 a f 9 a 6 0 1 d , o u = M a i l u s e r s , d c = t a m u , d c = e d u 04 $ u i d = 2 0 f 5 a 6 0 e a c f 9 c e 9 e 0 c 3 e f f 5 4 8 9 c 5 f 9 7 5 01 01 ff ldap_result wait4msg (infinite timeout) ** Connections: * host: morpheus port: 389 (default) refcnt: 2 status: Connected last used: Fri Feb 23 10:47:32 2001 ** Outstanding Requests: * msgid 3, origid 3, status InProgress outstanding referrals 0, parent count 0 ** Response Queue: Empty do_ldap_select read1msg ber_get_next ber_get_next: tag 0x30 len 12 contents: ber_dump: buf 0x1002a0b8, ptr 0x1002a0b8, end 0x1002a0c4 current len 12, contents: 02 01 03 m 07 0a 01 13 04 00 04 00 got result msgid 3, original id 3 ldap_chase_referrals new result: res_errno: 19, res_error: <>, res_matched: <> read1msg: 0 new referrals request 3 done res_errno: 19, res_error: <>, res_matched: <> ldap_free_request (origid 3, msgid 3) ldap_free_connection ldap_free_connection: refcnt 1 ldap_result2error ldap_msgfree ldap_perror ldap_modrdn: Constraint violation ldap_unbind ldap_free_connection ldap_send_unbind ber_flush: 7 bytes to sd 4 0 05 02 01 04 B 00 ldap_free_connection: actually freed new RDN: uid=20f5a60eacf9ce9e0c3eff5489c5f975 (do not keep existing values) modifying rdn of entry uid=c24b18d4bb4afdf052330678af9a601d,ou=Mailusers,dc=tamu ,dc=edu =========== Here is how the entries looked like after ldapmodify was executed: ============ uid=c24b18d4bb4afdf052330678af9a601d, ou=Mailusers, dc=tamu, dc=edu objectClass=top objectClass=person objectClass=organizationalPerson objectClass=inetOrgPerson objectClass=tamuPerson objectClass=tamuEmployee cn=<omitted> sn=<omitted> uid=c24b18d4bb4afdf052330678af9a601d uid=20f5a60eacf9ce9e0c3eff5489c5f975, ou=People, dc=tamu, dc=edu objectClass=top objectClass=person objectClass=organizationalPerson objectClass=inetOrgPerson objectClass=tamuPerson objectClass=tamuEmployee cn=<omitted> sn=<omitted> uid=20f5a60eacf9ce9e0c3eff5489c5f975 ============ Thanks, Bing Bing Du <bi...@ta..., 979-845-9577> Texas A&M University, CIS, Operating Systems, Unix >>> Chris Ridd <chr...@me...> 02/23/01 09:33AM >>> Bing Du <Bi...@ci...> wrote: > have the following two lines in the ldif. Ldapmodify command can > modify the first entry without any problem. But gives 'constraint > violation' on the second one. Do I have to split them into two ldif's? > > ==== > dn: uid=111,ou=dept-1,dc=tamu,dc=edu > changetype: modrdn > newrdn: uid=222 > deleteoldrdn: 1 > > dn: uid=111,ou=dept-2,dc=tamu,dc=edu > changetype: modrdn > newrdn: uid=222 > deleteoldrdn: 1 > ===== > > Any ideas? > > Thanks, > > Bing You shouldn't need two LDIF files, because the two entries have different parents. Can you send us the output of the modify operation after you set debug => 15? Cheers, Chris |
From: Chris R. <chr...@me...> - 2001-02-26 10:34:42
|
Bing Du <Bi...@ci...> wrote: > I checked both online ducumentation about ldapmodify and RFC. Did not > see anything wrong with my ldif. [...] > Ldapmodify output: Ah, you're not debugging the right program here, apologies if I wasn't clear. Change your Net::LDAP program so that it prints debugging output: $ldap = Net::LDAP->new('morpheus', debug => 15); It may be that the LDIF changerecord code in Net::LDAP::LDIF is not issuing the right sort of modify operations to the server, so setting debug => 15 will tell us exactly what's being sent. Cheers, Chris |
From: Bing D. <Bi...@ci...> - 2001-02-26 18:05:58
|
Seems we were not talking about the same problem. I apologize if my question was not closely Net::LDAP related. My ldif containing modrdn entries was not generated by Net::LDAP::LDIF. Given that ldif, the command 'ldapmodify' provided with the MessagingDirect directory server outputs the error 'Constraint Violation' when it processes the second entry in the ldif. Bing Bing Du <bi...@ta..., 979-845-9577> Texas A&M University, CIS, Operating Systems, Unix >>> Chris Ridd <chr...@me...> 02/26/01 04:35AM >>> Bing Du <Bi...@ci...> wrote: > I checked both online ducumentation about ldapmodify and RFC. Did not > see anything wrong with my ldif. [...] > Ldapmodify output: Ah, you're not debugging the right program here, apologies if I wasn't clear. Change your Net::LDAP program so that it prints debugging output: $ldap = Net::LDAP->new('morpheus', debug => 15); It may be that the LDIF changerecord code in Net::LDAP::LDIF is not issuing the right sort of modify operations to the server, so setting debug => 15 will tell us exactly what's being sent. Cheers, Chris |
From: Chris R. <chr...@me...> - 2001-02-23 15:32:08
|
Bing Du <Bi...@ci...> wrote: > have the following two lines in the ldif. Ldapmodify command can > modify the first entry without any problem. But gives 'constraint > violation' on the second one. Do I have to split them into two ldif's? > > ==== > dn: uid=111,ou=dept-1,dc=tamu,dc=edu > changetype: modrdn > newrdn: uid=222 > deleteoldrdn: 1 > > dn: uid=111,ou=dept-2,dc=tamu,dc=edu > changetype: modrdn > newrdn: uid=222 > deleteoldrdn: 1 > ===== > > Any ideas? > > Thanks, > > Bing You shouldn't need two LDIF files, because the two entries have different parents. Can you send us the output of the modify operation after you set debug => 15? Cheers, Chris |