Priority: Normal
Current State: Closed
Released In: n/a
Target Release:
Applies To: Engine
Component: Configure
Branches: master
See
irc logs
jomo reporting this issue running with tools/lighttpd.pl, on Mac OSx, with perlbrew 5.20.1
I've been unable to recreate the issue, also testing with perlbrew 5.20.1 and lighttpd. Given we don't have a checker called PASSWORD, I can't quite see how this is happening.
Error
Can't locate object method "new" via package "Foswiki::Configure::Checkers::PASSWORD" at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Configure/Checker.pm line 126.
at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Configure/Checker.pm line 126.
Foswiki::Configure::Checker::loadChecker(Foswiki::Configure::Value=HASH(0x7f8a7afdfdf0)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Configure/Query.pm line 445
Foswiki::Configure::Query::check_current_value(HASH(0x7f8a7aa3ddd0), Foswiki::Configure::Reporter=HASH(0x7f8a7a398a58)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Plugins/ConfigurePlugin.pm line 175
Foswiki::Plugins::ConfigurePlugin::__ANON__(Foswiki=HASH(0x7f8a796525f8), Foswiki::Contrib::JsonRpcContrib::Request=HASH(0x7f8a7a392a10), Foswiki::Response=HASH(0x7f8a796a8030), undef) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Contrib/JsonRpcContrib/Server.pm line 175
Foswiki::Contrib::JsonRpcContrib::Server::__ANON__() called at /Users/clt/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Error.pm line 421
eval {...} called at /Users/clt/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Error.pm line 413
Error::subs::try(CODE(0x7f8a7a398890), HASH(0x7f8a7a3988d8)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Contrib/JsonRpcContrib/Server.pm line 189
Foswiki::Contrib::JsonRpcContrib::Server::dispatch(Foswiki::Contrib::JsonRpcContrib::Server=HASH(0x7f8a7aa59498), Foswiki=HASH(0x7f8a796525f8)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Contrib/JsonRpcContrib.pm line 48
Foswiki::Contrib::JsonRpcContrib::dispatch(Foswiki=HASH(0x7f8a796525f8)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/UI.pm line 374
Foswiki::UI::__ANON__() called at /Users/clt/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Error.pm line 421
eval {...} called at /Users/clt/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Error.pm line 413
Error::subs::try(CODE(0x7f8a79016848), HASH(0x7f8a796bd560)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/UI.pm line 500
Foswiki::UI::_execute(Foswiki::Request=HASH(0x7f8a79020138), CODE(0x7f8a78b2eeb8), "jsonrpc", 1) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/UI.pm line 326
Foswiki::UI::handleRequest(Foswiki::Request=HASH(0x7f8a79020138)) called at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/lib/Foswiki/Engine/CGI.pm line 98
Foswiki::Engine::CGI::run(Foswiki::Engine::CGI=HASH(0x7f8a79384ca0)) called
--
GeorgeClark - 27 Jan 2015
Crawford, any ideas? Or suggestions on how jomo can help debug?
--
GeorgeClark - 27 Jan 2015
cd tools; perl -I ../bin configure -check
--
CrawfordCurrie - 27 Jan 2015
The problem is OS X (and maybe Widnows) specific - because of the case-insensitive filesystem.
- Comes from the
{UnitTestContrib}{Configure}{PASSWORD}
.
- It looking for the PASSWORD checker with the
Foswiki::Configure::FileUtil::findFileOnPath
- First try to find
Foswiki/Configure/Checkers/UnitTestContrib/Configure/PASSWORD.pm
- Because not found it, try search by
$item->{typename}
in this case PASSWORD
, so trying to find Foswiki/Configure/Checkers/PASSWORD.pm
- Because of case-insensitive filesystem, it found the "PASSWORD.pm" as
Foswiki/Configure/Checkers/Password.pm
- because found the file, it try require it and try the
Foswiki::Configure::Checkers::PASSWORD->new($item);
, but here isn't method Foswiki::Configure::Checkers::PASSWORD
only Foswiki::Configure::Checkers::Password
, so croaks..
--
JozefMojzis - 27 Jan 2015
The result of the:
cd tools; perl -I ../bin configure -check
is
Subroutine check_current_value redefined at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/tools/../lib/Foswiki/Configure/Checkers/PASSWORD.pm line 10.
Can't locate object method "new" via package "Foswiki::Configure::Checkers::PASSWORD" at /Users/clt/Develop/foswiki/SOURCES/github/foswiki/core/tools/../lib/Foswiki/Configure/Checker.pm line 126.
--
JozefMojzis - 27 Jan 2015
Please test the following fix:
diff --git a/core/lib/Foswiki/Configure/FileUtil.pm b/core/lib/Foswiki/Configure/FileUtil.pm
index 45ecf02..568f57f 100644
--- a/core/lib/Foswiki/Configure/FileUtil.pm
+++ b/core/lib/Foswiki/Configure/FileUtil.pm
@@ -82,7 +82,15 @@ sub findFileOnPath {
$file =~ s(::)(/)g;
foreach my $dir (@INC) {
- if ( -e "$dir/$file" ) {
+
+ my ( $volume, $directories, $filename ) =
+ File::Spec->splitpath("$dir/$file");
+ next unless ( -d $volume . $directories );
+ opendir( my $df, $volume . $directories ) || next;
+ my @files = grep( /^\Q$filename\E$/, readdir($df) );
+ closedir($df);
+
+ if ( scalar @files ) {
return "$dir/$file";
}
}
--
GeorgeClark - 27 Jan 2015
Applied with some suggested changed from
JozefMojzis.
--
GeorgeClark - 27 Jan 2015