cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about LDAP: Answered

Can't use string (Domain) as an ARRAY ref while "strict refs" in use

Hello All,

First off, thanks for your help. I am not EXACTLY sure that LdapContrib is the problem, however, it may point to the issue due to the logs I'm getting.

Here's what happened. I was running LdapContrib 4.2x with templatelogin with no issues this morning, and noticed there was an upgrade to 5, so I dove in head first. I've always had good luck with Mr. Daum's software, so what the hell.

After all the patches were complete and up and running, I logged out of the website I get this error on front webpage:
Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.

Can't use string ("dc=(domain name),dc=local") as an ARRAY ref while "strict refs" in use

I enabled LDAP debug and tried the front page again:
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] Can't use string ("dc=(domain name),dc=local") as an ARRAY ref while "strict refs" in use at C:/wwwroot/foswiki/lib/Foswiki/Contrib/LdapContrib.pm line 233,  line 581.
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12]  at C:/wwwroot/foswiki/lib/Foswiki/Contrib/LdapContrib.pm line 233,  line 581.
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Contrib::LdapContrib::new('Foswiki::Contrib::LdapContrib', 'Foswiki=HASH(0x163a344)') called at C:/wwwroot/foswiki/lib/Foswiki/Contrib/LdapContrib.pm line 313
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Contrib::LdapContrib::getLdapContrib('Foswiki=HASH(0x163a344)') called at C:/wwwroot/foswiki/lib/Foswiki/Users/LdapPasswdUser.pm line 60
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Users::LdapPasswdUser::new('Foswiki::Users::LdapPasswdUser', 'Foswiki=HASH(0x163a344)') called at C:/wwwroot/foswiki/lib/Foswiki/Users/TopicUserMapping.pm line 66
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Users::TopicUserMapping::new('Foswiki::Users::LdapUserMapping', 'Foswiki=HASH(0x163a344)') called at C:/wwwroot/foswiki/lib/Foswiki/Users/LdapUserMapping.pm line 52
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Users::LdapUserMapping::new('Foswiki::Users::LdapUserMapping', 'Foswiki=HASH(0x163a344)') called at C:/wwwroot/foswiki/lib/Foswiki/Users.pm line 104
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Users::new('Foswiki::Users', 'Foswiki=HASH(0x163a344)') called at C:/wwwroot/foswiki/lib/Foswiki.pm line 1729
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::new('Foswiki', undef, 'Foswiki::Request=HASH(0x1632d84)', 'HASH(0x163123c)') called at C:/wwwroot/foswiki/lib/Foswiki/UI.pm line 306
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::UI::__ANON__() called at C:/Perl/perl/site/lib/Error.pm line 419
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \teval {...} called at C:/Perl/perl/site/lib/Error.pm line 411
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tError::subs::try('CODE(0x947b3c)', 'HASH(0x163a074)') called at C:/wwwroot/foswiki/lib/Foswiki/UI.pm line 435
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::UI::_execute('Foswiki::Request=HASH(0x1632d84)', 'CODE(0x1015964)', 'view', 1) called at C:/wwwroot/foswiki/lib/Foswiki/UI.pm line 274
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::UI::handleRequest('Foswiki::Request=HASH(0x1632d84)') called at C:/wwwroot/foswiki/lib/Foswiki/Engine/CGI.pm line 41
[Thu Dec 06 09:40:07 2012] [error] [client 10.100.213.12] \tFoswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0x1011424)') called at C:/wwwroot/foswiki/bin/view line 24.

So, it seems there's a larger problem at hand here, and I've googled this one to death and can't find anything related to strict refs anywhere. I just keep coming back up with the LdapContrib.Pm file, however I'm not prepared to edit that, because I don't have any perl skills.

So, I'm sure all of you out in Foswiki support land would love to see my LdapContrib config:
Foswiki::cfg{Ldap}{Host} = 'x.x.x.x';
$Foswiki::cfg{Ldap}{Port} = 389;
$Foswiki::cfg{Ldap}{Version} = '3';
$Foswiki::cfg{Ldap}{Base} = 'dc=my domain,dc=local';
$Foswiki::cfg{Ldap}{BindDN} = 'cn=my ldap user,cn=users,dc=my domain,dc=local';
$Foswiki::cfg{Ldap}{BindPassword} = 'secretpassword';
$Foswiki::cfg{Ldap}{UseSASL} = 0;
$Foswiki::cfg{Ldap}{SASLMechanism} = 'PLAIN CRAM-MD5 EXTERNAL ANONYMOUS';
$Foswiki::cfg{Ldap}{UseTLS} = 0;
$Foswiki::cfg{Ldap}{TLSSSLVersion} = 'tlsv1';
$Foswiki::cfg{Ldap}{TLSVerify} = 'require';
$Foswiki::cfg{Ldap}{TLSCAPath} = '';
$Foswiki::cfg{Ldap}{TLSCAFile} = '';
$Foswiki::cfg{Ldap}{TLSClientCert} = '';
$Foswiki::cfg{Ldap}{TLSClientKey} = '';
$Foswiki::cfg{Ldap}{Debug} = 1;
$Foswiki::cfg{Ldap}{UserBase} = 'dc=my domain,dc=local';
$Foswiki::cfg{Ldap}{LoginFilter} = 'objectClass=User';
$Foswiki::cfg{Ldap}{UserScope} = 'sub';
$Foswiki::cfg{Ldap}{LoginAttribute} = 'sAMAccountName';
$Foswiki::cfg{Ldap}{WikiNameAttribute} = 'displayName';
$Foswiki::cfg{Ldap}{NormalizeWikiNames} = 1;
$Foswiki::cfg{Ldap}{NormalizeLoginNames} = 0;
$Foswiki::cfg{Ldap}{WikiNameAliases} = '';
$Foswiki::cfg{Ldap}{AllowChangePassword} = 0;
$Foswiki::cfg{Ldap}{SecondaryPasswordManager} = 'Foswiki::Users::HtPasswdUser';
$Foswiki::cfg{Ldap}{GroupBase} = 'DC=my domain,DC=local';
$Foswiki::cfg{Ldap}{GroupFilter} = 'objectClass=group';
$Foswiki::cfg{Ldap}{GroupScope} = 'sub';
$Foswiki::cfg{Ldap}{GroupAttribute} = 'cn';
$Foswiki::cfg{Ldap}{PrimaryGroupAttribute} = 'memberOF';
$Foswiki::cfg{Ldap}{MemberAttribute} = 'member';
$Foswiki::cfg{Ldap}{InnerGroupAttribute} = 'member';
$Foswiki::cfg{Ldap}{MemberIndirection} = 0;
$Foswiki::cfg{Ldap}{WikiGroupsBackoff} = 1;
$Foswiki::cfg{Ldap}{NormalizeGroupNames} = 0;
$Foswiki::cfg{Ldap}{MapGroups} = 1;
$Foswiki::cfg{Ldap}{RewriteGroups} = {
          '(my admin group)' => 'AdminGroup',
          '(my admin group)' => 'AdminGroup',
          '(my admin group)' => 'AdminGroup',
          '(my admin group)' => 'AdminGroup'
        };
$Foswiki::cfg{Ldap}{RewriteWikiNames} = {};
$Foswiki::cfg{Ldap}{MergeGroups} = 0;
$Foswiki::cfg{Ldap}{MaxCacheAge} = '86400';
$Foswiki::cfg{Ldap}{Precache} = 1;
$Foswiki::cfg{Ldap}{PageSize} = 500;
$Foswiki::cfg{Ldap}{Exclude} = 'WikiGuest, ProjectContributor, RegistrationAgent, UnknownUser, AdminGroup, NobodyGroup, AdminUser, admin, guest';

If you need any more information from my LocalSite.cfg, just let me know.

Again, thank you for your help.

-- MattWilson - 06 Dec 2012

Apply these changes to your config:
$Foswiki::cfg{Ldap}{UserBase} = ['dc=my domain,dc=local'];
$Foswiki::cfg{Ldap}{GroupBase} = ['DC=my domain,DC=local'];

Note the square brackets.

-- MichaelDaum - 06 Dec 2012

That worked! Thanks for the quick follow up Michael!

-- MattWilson - 06 Dec 2012

-- MattWilson - 06 Dec 2012

Matt, which version of LdapContrib did you use?

-- MichaelDaum - 07 Dec 2012

Michael, I'm currently running the current version of 5.03.

-- MattWilson - 07 Dec 2012
 

QuestionForm edit

Subject LDAP
Extension LdapContrib
Version Foswiki 1.1.5
Status Answered
Related Topics Tasks.Item12283
Topic revision: r5 - 07 Dec 2012, MattWilson - This page was cached on 22 Jun 2018 - 23:25.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy