eod has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

When I try to Net::LDAP::add() an entry, the $result->error is "Success" but the entry doesn't exist inside the directory... that's an abstract of the code:

use Net::LDAP; #conection to the LDAP my $server = 'ldaps://mterra1'; my $ldap = Net::LDAP->new( $server ) or die "$@"; $ldap->bind('cn=admin,o=telefonica', password => 'password'); my $contacto ="alias1"; my $usuario = 'prueba15@prueba.com'; my $entry_dn = "Alias=$contacto,ou=$usuario,o=agenda"; my $entry = [ 'objectClass' => [ 'top', 'contacto', ], 'Alias' => $contacto, ]; $result = $ldap->add ( $entry_dn, atrr => $entry, ); warn "error?: ", $result->error ; #error?: Success at ./create.pl line 48, <DATA> line 225. $ldap->unbind;
I can create the entry with the same objectclasses, attributes and DN, by the same user using a graphical tool.

What could be wrong, any idea?

Thanks,
--edu

Replies are listed 'Best First'.
Re: Net::LDAP add success but entry doesn't exist
by john_oshea (Priest) on Dec 29, 2005 at 11:10 UTC

    It looks like you have a typo in atrr => $entry, - I think that should be 'attr'.

    If it's not that, do you have access to the LDAP server's logs at all? Every time I've ever done any LDAP-related setup/coding, I always end up with a terminal with tail -f running on the logs.

      that was!

      thanks very much, good sight.
      --edu
Re: Net::LDAP add success but entry doesn't exist
by Anonymous Monk on Dec 29, 2005 at 11:24 UTC
    Turn on debugging