OTRS 4: AgentAuth via LDAP = Internal Server Error while calling index.pl

Moderator: crythias

Post Reply
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

OTRS 4: AgentAuth via LDAP = Internal Server Error while calling index.pl

Post by DaSto »

Hello,

finally we are upgrading our systems from otrs 3 to otrs 4.0.11. otrs 3 was running on windows. otrs 4 will be on ubuntu. because of different customers i had to set up 2 different systems. Installation and DB Migration was easy and the first system (without ldap) is live now and running perfect.
The second system is killing me. I'm trying to set up LDAP Auth for Agents. I've installed net::ldap and asn1 via cpan. Config.pm settings for LDAP are the same as in the old (still live) windows system. CheckModules also tells me everything's ok and every required module is installed.

Here's my actual Config.pm - LDAP Part:

Code: Select all

   $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
   $Self->{'AuthModule::LDAP::Host'} = 'host.local'; 
   $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=dcexample, dc=dcexample';
   $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
   #$Self->{'AuthModule::LDAP::GroupDN'} ='cn=example, ou=groupexample, ou=ouexample, dc=dcexample, dc=dcexample';
   $Self->{UserSyncLDAPMap} = {
   # DB -> LDAP
      UserFirstname => 'givenName',
      UserLastname => 'sn',
      UserEmail => 'mail',
    };
   $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=cnexample, ou=ouexample, dc=dcexample, dc=dcexample';
   $Self->{'AuthModule::LDAP::SearchUserPw'} = 'password';
This Code (with valid data) works perfect on the old windows system. I've also tried a few different sync and ldap auth settings but always got the same error.

Now on the Ubuntu Server i can't load index.pl (Internal Server Error) and got this error in Apache2 Error.log:
[Thu Feb 11 10:01:39.651457 2016] [:error] [pid 11887] -e: No LogObject! at /opt/otrs//Kernel/System/Auth/LDAP.pm line 25.\n
This would be this Code in my LDAP.pm:

Code: Select all

for (qw(LogObject ConfigObject DBObject UserObject GroupObject EncodeObject)) {
        $Self->{$_} = $Param{$_} || die "No $_!";
}
    
When i comment the LDAP Code out in config.pm i can easily load index.pl and login via DBAuth.

I've compared Config.pm Settings for LDAP with the OTRS Manual, Default.pm and other customized config.pms. Even the LDAP.pm seems to be ok. I've emptied the cache, rebuilded the config, reinstalled net::ldap, user is in DB and AD etc. etc. etc......

Do i have to set something for this logobject (like Log::File etc.?)? What does this Error mean? Are there differences between Windows LDAP and Ubuntu LDAP settings i haven't seen right now? Did i forget something completely trivial?

I'm really stuck with this and happy about any information. Thank you.
pab
Znuny advanced
Posts: 138
Joined: 20 Jan 2011, 11:21
Znuny Version: [...],6.x, Znuny 7
Real Name: Peter
Company: maxence business consulting GmbH
Location: Dormagen

Re: OTRS 4: AgentAuth via LDAP = Internal Server Error while calling index.pl

Post by pab »

Hi,


OBject-Handling works differently from OTRS 4 on. The code in your LDAP.pm doesn't look like the code from 4.x, rather like from 3.x. Does this LDAP.pm start with something like

Code: Select all

[...]
package Kernel::System::Auth::LDAP;

use strict;
use warnings;

use Net::LDAP;

our @ObjectDependencies = (
    'Kernel::Config',
    'Kernel::System::Encode',
    'Kernel::System::Log',
);
[...]
?
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

Re: OTRS 4: AgentAuth via LDAP = Internal Server Error while calling index.pl

Post by DaSto »

Ok - lets have a look....this is my original LDAP.pm:

Code: Select all

package Kernel::System::Auth::LDAP;
[....]

use strict;
use warnings;
use Net::LDAP;

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {};
    bless( $Self, $Type );

    # check needed objects
    for (qw(LogObject ConfigObject DBObject UserObject GroupObject EncodeObject)) {
        $Self->{$_} = $Param{$_} || die "No $_!";
    }

    # Debug 0=off 1=on
    $Self->{Debug} = 0;
    [.....]
so - no it looks different. I'm gonna try to compare it to the other otrs4 system.

ok there it looks like this:

Code: Select all

package Kernel::System::Auth::LDAP;
[.....]
use strict;
use warnings;

use Net::LDAP;

our @ObjectDependencies = (
    'Kernel::Config',
    'Kernel::System::Encode',
    'Kernel::System::Log',
);

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {};
    bless( $Self, $Type );
    
    [.....]

should i take the ldap.pm from my other system? I don't know what happened to the current ldap.pm but it doesn't look ok.
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

Re: OTRS 4: AgentAuth via LDAP = Internal Server Error while calling index.pl

Post by DaSto »

thank you @pab - that was the issue. never changed the ldap.pm and if i did i kept a backup. thats strange.

but now it works perfectly! Thank you very much!
Post Reply