Undefined subroutine &RT::Authen::ExternalAuth::UserExists

Hello,

I’m sorry I don’t know more about this, but I never will at this rate.
I don’t know where to begin. I still get

Undefined subroutine &RT::Authen::ExternalAuth::UserExists

Despite multiple reinstalls and following various flavors of install
instructions and HOWTOs.

I see the sub UserExists is defined in
/opt/rt3/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth
.pm
Which is readable by the webserver user and group. So:

  • is this a perl problem, it not seeing that sub?
  • is it the webserver, not finding the file?
  • is it something else entirely?

Hours of searching generic ‘undef sub’ perl issues are too varied to be
useful (tho I’ve checked over a few things), and the only results for
this particular issue are my own messages on this list. If you think I
should be bugging someone else about this, that’s fine with me: any idea
who…?

Thanks,

Rob Munsch
IT Administrator
http://www.PhillyCarShare.org
Our wheels. Your freedom.
215-730-0988 x138

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-
bounces@lists.bestpractical.com] On Behalf Of Robert Munsch
Sent: Friday, November 14, 2008 4:50 PM
To: mike.peachey@jennic.com
Cc: RT Users
Subject: Re: [rt-users] Undefined Subroutine (was: CALLING
EXTERNALAUTHTESTERS - v0.07_01 nowavailable.)

I’ve checked and I’m not sure what’s going wrong, still. Basic config
seems OK. ExternalAuth is in place and fully (re-)installed. LDAP.pm
exists and is properly readable by the webserver:

root@data:/opt/rt3/var/log# ls -lah
/opt/rt3/local/plugins/RT-Authen-
ExternalAuth/lib/RT/Authen/ExternalAuth/
total 44K
drwxr-xr-x 2 www-data www-data 4.0K 2008-11-14 16:37 .
drwxr-xr-x 3 www-data www-data 4.0K 2008-11-14 16:37 …
-r–r–r-- 1 www-data www-data 13K 2008-11-06 13:20 DBI.pm
-r–r–r-- 1 www-data www-data 18K 2008-11-06 13:36 LDAP.pm

And yet I still get

Undefined subroutine &RT::Authen::ExternalAuth::UserExists called at

/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAut

h/autohandler/Auth line 39.

When I attempt any kind of login. Line 39 is the last line in this
block:

    # Unless we have loaded a valid user with a UserID
    # check if user exists externally and autocreate if it does
    unless ($session{'CurrentUser'}->Id) {
        if(RT::Authen::ExternalAuth::UserExists($user)){

and my debug-level logs for this show the following (password is bogus
what I actually typed, just not a real password):


[Fri Nov 14 21:37:54 2008] [error]: Working around bug in RT and
reloading RT::User

(/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAu

th/autohandler/Auth:12)
Trace begun at /opt/rt3/bin/…/lib/RT.pm line 289
Log::Dispatch::ANON(‘Log::Dispatch=HASH(0xc010f90)’, ‘Working
around
bug in RT and reloading RT::User’) called at

/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAut

h/autohandler/Auth line 12
HTML::Mason::Commands::ANON(‘pass’, ‘65dfg’, ‘user’, ‘munsch’)
called at /usr/local/share/perl/5.8.8/HTML/Mason/Component.pm line 135

HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xc8

e2c60)', ‘pass’, ‘65dfg’, ‘user’, ‘munsch’) called at
/usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 1279
eval {…} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line
1274
HTML::Mason::Request::comp(undef, undef, ‘pass’, ‘65dfg’, ‘user’,
‘munsch’) called at /opt/rt3/bin/…/lib/RT/Interface/Web/Request.pm
line
176

RT::Interface::Web::Request::callback('RT::Interface::Web::Request=HASH(

0xc9081e0)', ‘pass’, ‘65dfg’, ‘user’, ‘munsch’, ‘CallbackName’,
‘Auth’)
called at /opt/rt3/share/html/autohandler line 253
HTML::Mason::Commands::ANON(‘pass’, ‘65dfg’, ‘user’, ‘munsch’)
called at /usr/local/share/perl/5.8.8/HTML/Mason/Component.pm line 135

HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xc7

dc4d0)', ‘pass’, ‘65dfg’, ‘user’, ‘munsch’) called at
/usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 1279
eval {…} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line
1274
HTML::Mason::Request::comp(undef, undef, undef, ‘pass’, ‘65dfg’,
‘user’,
‘munsch’) called at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm
line 473
eval {…} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line
473
eval {…} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line
425

HTML::Mason::Request::exec(‘RT::Interface::Web::Request=HASH(0xc9081e0)’

) called at /usr/local/share/perl/5.8.8/HTML/Mason/ApacheHandler.pm
line
168

HTML::Mason::Request::ApacheHandler::exec('RT::Interface::Web::Request=H

ASH(0xc9081e0)') called at
/usr/local/share/perl/5.8.8/HTML/Mason/ApacheHandler.pm line 825

HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=H

ASH(0x1171890)', ‘Apache2::RequestRec=SCALAR(0xc923dd0)’) called at
/opt/rt3/bin/webmux.pl line 148
eval {…} at /opt/rt3/bin/webmux.pl line 148
RT::Mason::handler(‘Apache2::RequestRec=SCALAR(0xc923dd0)’) called at
-e
line 0
eval {…} at -e line 0


Any help or pointing in any kind of direction at all would be
appreciated. I don’t understand what the logs are trying to tell me.
LDAP.pm is there, ::UserExists is called by the code, but it complains
there’s no such animal. This is a 5-minute-old fresh install of 7_01.

Clearly it’s working for most people - what’s so special about my
::UserExists call…?

Halp!,

Rob

-----Original Message-----
From: mpeac@jennic.com [mailto:mpeac@jennic.com] On Behalf Of Mike
Peachey
Sent: Thursday, November 13, 2008 4:39 AM
To: Robert Munsch
Cc: RT Users
Subject: Re: [rt-users] CALLING EXTERNALAUTH TESTERS - v0.07_01
nowavailable.

Robert Munsch wrote:

Still experiencing this. Not sure what’s going on. Any attempt at
login for any user - root or otherwise - gets this:

Undefined subroutine &RT::Authen::ExternalAuth::UserExists called at

/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAut

h/autohandler/Auth line 39.

The difference being only that if I tried logging in as a user that
doesn’t exist yet and should be looked up in AD, refreshing the page
gives me the login screen again: and if I tried logging in as root,
it
says line 89 instead of 39 and refreshing the page gives me RT at a
glance successfully.

Very confused.

I would really like to help, but I’m having difficulty seeing where
the

Robert Munsch.vcf (141 Bytes)

Hi, I’m trying to install RT (with Postgres and LDAP backends). I
have gotten it working with Postgres so far, but I’m now quite stuck
on the LDAP integration. Here is the snippet from RT_SiteConfig.pm
for LDAP:

Set($WebExternalAuth , ‘1’);
Set($WebFallbackToInternalAuth , ‘1’);
#Set(@Plugins,(qw(Extension::QuickDelete)));
#Set(@Plugins,(qw(RT::FM)));
Set(@Plugins, qw(RT::Authen::ExternalAuth));
#Set($LogToFileNamed , “rt.log”);
#Set($LogToFile , ‘debug’);

The order in which the services defined in ExternalSettings

should be used to get information about users. This includes

RealName, Tel numbers etc, but also whether or not the user

should be considered disabled.

Once user info is found, no more services are checked.

Set($ExternalInfoPriority, [ ‘My_LDAP’ ]);

If this is set to true, then the relevant packages will

be loaded to use SSL/TLS connections. At the moment,

this just means “use Net::SSLeay;”

Set($ExternalServiceUsesSSLorTLS, 0);

If this is set to 1, then users should be autocreated by RT

as internal users if they fail to authenticate from an

external service.

Set($AutoCreateNonExternalUsers, 0);

These are the full settings for each external service as a HashOfHashes

Note that you may have as many external services as you wish. They will

be checked in the order specified in the Priority directives above.

e.g.

Set($ExternalAuthPriority,[‘My_LDAP’]);
Set($ExternalSettings, {

AN EXAMPLE LDAP SERVICE

‘My_LDAP’ => { ## GENERIC SECTION
# The type of service (db/ldap/cookie)
‘type’ => ‘ldap’,
# Should the service be used for authentication?
‘auth’ => 1,
# Should the service be used for information?
‘info’ => 1,
# The server hosting the service
’server’ => ‘redacted’,
## SERVICE-SPECIFIC SECTION
# If you can bind to your LDAP server anonymously youshould
# remove the user and pass config lines, otherwisespecify them here:
# The username RT should use to connect to the LDAP server
’user’ => ‘redacted’,
# The password RT should use to connect to the LDAP server
’pass’ => ‘redacted’,
# The LDAP search base
’base’ => ‘redacted’,
# The filter to use to match RT-Users
’filter’ => ‘(objectclass=inetOrgPerson)’,
# The filter that will only match disabled users
’d_filter’ => ‘(employeeType=inactive)’,
# Should we try to use TLS to encrypt connections?
‘tls’ => 0,
# What other args should I pass to Net::LDAP->new($host,@args)?
‘net_ldap_args’ => [ version => 3 ],
# Does authentication depend on group membership? What group name?
#‘group’ => ‘’,
# What is the attribute for the group object thatdetermines membership?
#‘group_attr’ => ‘’,
## RT ATTRIBUTE MATCHING SECTION
# The list of RT attributes that uniquely identify a user
’attr_match_list’ => [ ‘Name’,
‘EmailAddress’,
‘RealName’,
#‘WorkPhone’,
#‘Address2’
],
# The mapping of RT attributes on to LDAP attributes
’attr_map’ => { ‘Name’ => ‘displayName’,
‘EmailAddress’ => ‘mail’,
#‘Organization’ => ‘physicalDeliveryOfficeName’,
‘RealName’ => ‘cn’
#‘ExternalAuthId’ => ‘sAMAccountName’,
#‘Gecos’ => ‘sAMAccountName’,
#‘WorkPhone’ => ‘telephoneNumber’,
#‘Address1’ => ‘streetAddress’,
#‘City’ => ‘l’,
#‘State’ => ‘st’,
#‘Zip’ => ‘postalCode’,
#‘Country’ => ‘co’
}
}
}
);

When I try to log into RT, I get the following error in the browser:

Undefined subroutine &RT::Authen::ExternalAuth::UserExists called at
/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAuth/autohandler/Auth
line 39, line 323.

And the only thing in the logs is as follows:

Dec 3 16:13:08 meatwad RT: Working around bug in RT and reloading
RT::User (/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAuth/autohandler/Auth:12)

Can anyone help me with this? I am banging my head against a wall at
this point.

Gwendolyn R. Schmidt

gwen wrote:

Hi, I’m trying to install RT (with Postgres and LDAP backends). I
have gotten it working with Postgres so far, but I’m now quite stuck
on the LDAP integration. Here is the snippet from RT_SiteConfig.pm
for LDAP:

Set($WebExternalAuth , ‘1’);
Set($WebFallbackToInternalAuth , ‘1’);
#Set(@Plugins,(qw(Extension::QuickDelete)));
#Set(@Plugins,(qw(RT::FM)));
Set(@Plugins, qw(RT::Authen::ExternalAuth));
#Set($LogToFileNamed , “rt.log”);
#Set($LogToFile , ‘debug’);

Unless you are also using an apache authentication method, you shouldnt
have WebExternalAuth on.

When I try to log into RT, I get the following error in the browser:

Undefined subroutine &RT::Authen::ExternalAuth::UserExists called at
/opt/rt3/local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAuth/autohandler/Auth
line 39, line 323.

Last time someone came across this (iirc) we never got to the bottom of
it, but starting from scratch the problem went away :confused:
Kind Regards,

Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England

Unless you are also using an apache authentication method, you shouldnt
have WebExternalAuth on.

That made that error go away, thanks! Now to actually get this to
query the LDAP backend right…

(It’s always something stupid, like changing your mind about how to
set things up midstream.)

Gwendolyn R. Schmidt

gwen wrote:> On Thu, Dec 4, 2008 at 9:41 AM, Mike Peachey mike.peachey@jennic.com wrote:

Unless you are also using an apache authentication method, you shouldnt
have WebExternalAuth on.

That made that error go away, thanks!

I will add that to the wiki page.

Kind Regards,

Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England