Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
Ah yes, crikey! wrong Makefile.PL! Running Makefile.PL for Catalyst::Runtime griped only that * Test::WWW::Mechanize::Catalyst* was out of date. We updated that via cpanm so now Makefile.PL has no complaints... Still can't use string as a HASH ref tho :( when we try to use the Cache plugin. On Sun, Mar 31, 2013 at 11:55 PM, Tomas Doran bobtf...@bobtfish.net wrote: On 31 Mar 2013, at 19:58, will trillich will.trill...@serensoft.com wrote: Hmm. I don't see anything out of line here...? $ perl Makefile.PL include /home/will/projects/perl-mvc/Waste/inc/Module/Install.pm include inc/Module/Install/Metadata.pm include inc/Module/Install/Base.pm include inc/Module/Install/Makefile.pm Cannot determine perl version info from lib/Waste/Web.pm include inc/Module/Install/Catalyst.pm include inc/Module/Install/Include.pm include inc/File/Copy/Recursive.pm *** Module::Install::Catalyst Please run make catalyst_par to create the PAR package! *** Module::Install::Catalyst finished. include inc/Module/Install/Scripts.pm include inc/Module/Install/AutoInstall.pm include inc/Module/AutoInstall.pm *** Module::AutoInstall version 1.04 *** Checking for Perl dependencies... [Core Features] - Test::More ...loaded. (0.98 = 0.88) - Catalyst::Runtime ...loaded. (5.90020 = 5.80032) - Catalyst::Plugin::ConfigLoader ...loaded. (0.32) - Catalyst::Plugin::Static::Simple ...loaded. (0.29) - Catalyst::Action::RenderView ...loaded. (0.14) - Moose ...loaded. (2.0801) - namespace::autoclean ...loaded. (0.13) - Config::General...loaded. (2.49) - Catalyst::Plugin::Session ...loaded. (0.29) - Catalyst::Plugin::Session::Store::DBIC ...loaded. (0.11) - Catalyst::Plugin::Session::State::Cookie ...loaded. (0.17) - Catalyst::Plugin::Authentication ...loaded. (0.10016) - Catalyst::Plugin::Authentication::Credential::Password ...loaded. (0) - Catalyst::Plugin::Authorization::Roles ...loaded. (0.08) - Catalyst::Plugin::Cache...loaded. (0.09) - DBIx::Class::Cursor::Cached...loaded. (1.01) *** Module::AutoInstall configuration finished. include inc/Module/Install/WriteAll.pm include inc/Module/Install/Win32.pm include inc/Module/Install/Can.pm include inc/Module/Install/Fetch.pm Writing Makefile for Waste::Web Writing MYMETA.yml and MYMETA.json Writing META.yml That's your app's Makefile.PL I asked for the Makefile.PL for Catalyst::Runtime (as that includes the 'you must upgrade this plugin for this version of Catalyst' warnings. And our app class is same as I posted in the original message of this thread -- very standard: package Waste::Web; use Moose; use namespace::autoclean; use Catalyst::Runtime 5.80; use Catalyst qw/ ConfigLoader Static::Simple Session Session::Store::DBIC Session::State::Cookie Authentication Authentication::Credential::Password Authorization::Roles Cache /; use Waste::Lib::CSV; extends 'Catalyst'; our $VERSION = '1.10'; __PACKAGE__-config( name = 'Waste::Web', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback = 1, ); # Start the application __PACKAGE__-setup(); Yeah, I'd strongly guess it's one of the plugins :) Which cpanm module needs an upgrade? And is there a way for me to figure that out for next time so I don't have to bother the list with it? :) Hopefully the one running the -Runtime Makefile.PL will tell you :) Cheers t0m ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ -- Will Trillich :: 812.454.6431 “Grading takes away all the fun from failing. And a huge part of education is about failure.” -- Shimon Schocken ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
$ *perl -wMDevel::SimpleTrace script/waste_web_server.pl * Duplicate specification host|h=s for option h at Catalyst::ScriptRole::_getopt_spec_warnings(unknown source) at MooseX::Getopt::Basic::_parse_argv(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:138) at MooseX::Getopt::Basic::process_argv(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:79) at MooseX::Getopt::Basic::new_with_options(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:105) at Catalyst::ScriptRunner::run(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at main::(script/waste_web_server.pl:8) Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at Carp::croak(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at Class::Load::_croak(/usr/local/share/perl/5.10.1/Class/Load.pm:200) at Class::Load::load_class(/usr/local/share/perl/5.10.1/Class/Load.pm:41) at Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:90) at Catalyst::Script::Server::run(/usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm:240) at Catalyst::ScriptRunner::run(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at main::(script/waste_web_server.pl:8) So maybe there's something pertinent going on at Catalyst::ScriptRole? (Doubtful, but just in case...) MooseX::Getopt::Basic::CODE(0x943d320)(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:134): DB3 *v* 131 my ( $parsed_options, $usage ) = try { 132:b local $SIG{__WARN__} = sub { push @warnings, @_ }; 133 134== return $class-_getopt_get_options(\%params, $opt_spec); 135 } 136 catch { 137:$class-_getopt_spec_exception(\@warnings, $_); 138:}; 139 140:$class-_getopt_spec_warnings(@warnings) if @warnings; DB4 *x $opt_spec* 0 ARRAY(0x9897f38) 0 ARRAY(0x943cfe0) 0 'loader_class=s' 1 'The class to use to detect and load the PSGI engine' 2 HASH(0x942e650) empty hash 1 ARRAY(0x9438a18) 0 'help|usage|?|h!' 1 'Prints this usage information.' 2 HASH(0x94389e8) empty hash 2 ARRAY(0x9438688) 0 'debug|d!' 1 'Force debug mode' 2 HASH(0x9441648) empty hash 3 ARRAY(0x943dcf0) 0 'host|h=s' 1 'Specify a hostname or IP on this host for the server to bind to' 2 HASH(0x942e850) empty hash 4 ARRAY(0x943d420) 0 'fork|f!' 1 'Fork the server to be able to serve multiple requests at once' 2 HASH(0x943d4b0) empty hash 5 ARRAY(0x943d4d0) 0 'port|p=i' 1 'Specify a different listening port (to the default port 3000)' 2 HASH(0x943d4f0) empty hash 6 ARRAY(0x9a03f38) 0 'pidfile|pid=s' 1 'Specify a pidfile' 2 HASH(0x99f8690) empty hash 7 ARRAY(0x99dde10) 0 'keepalive|k!' 1 'Support keepalive' 2 HASH(0x99fdf58) empty hash 8 ARRAY(0x99fe838) 0 'background|bg!' 1 'Run in the background' 2 HASH(0x99f0498) empty hash 9 ARRAY(0x99f8f00) 0 'restart|r!' 1 'use Catalyst::Restarter to detect code changes and restart the application' 2 HASH(0x99f8ac0) empty hash 10 ARRAY(0x99fddc8) 0 'restart_directory|rdir|restartdirectory=s@' 1 'Restarter directory to watch' 2 HASH(0x99f8b40) empty hash 11 ARRAY(0x99fe0b8) 0 'restart_delay|rd=i' 1 'Set a restart delay' 2 HASH(0x99fe1d8) empty hash 12 ARRAY(0x99f92f0) 0 'restart_regex|rr=s' 1 'Restart regex' 2 HASH(0x99fdb18) empty hash 13 ARRAY(0x99f03b8) 0 'follow_symlinks|sym!' 1 'Follow symbolic links' 2 HASH(0x99fe288) empty hash 14 ARRAY(0x9a12cd0) 0 'restarter_class=s' 1 ' ' 2 HASH(0x99f8680) empty hash DB5 *x \%params* 0 HASH(0x98782f0) 'options' = ARRAY(0x8c68400) 0 HASH(0x9441168) 'doc' = 'The class to use to detect and load the PSGI engine' 'init_arg' = 'loader_class' 'name' = 'loader_class' 'opt_string' = 'loader_class=s' 'required' = undef 1 HASH(0x99fdb88) 'doc' = 'Prints this usage information.' 'init_arg' = 'help_flag' 'name' = 'help' 'opt_string' = 'help|usage|?|h!' 'required' = undef 2 HASH(0x935d890) 'doc' = 'Force debug mode' 'init_arg' = 'debug' 'name' = 'debug' 'opt_string' = 'debug|d!' 'required' = undef 3 HASH(0x9441a28) 'doc' = 'Specify a hostname or IP on this host for the server to bind to' 'init_arg' = 'host' 'name' = 'host'
Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
Hmm. Class::Accessor::Fast should not be being used - I'd guess that you might have an outdated plugin? What does your application class look like, and does running the Makefile.PL of Catalyst-Runtime tell you to upgrade any plugins? Cheers t0m On 31 Mar 2013, at 02:21, will trillich will.trill...@serensoft.com wrote: $ perl -wMDevel::SimpleTrace script/waste_web_server.pl Duplicate specification host|h=s for option h at Catalyst::ScriptRole::_getopt_spec_warnings(unknown source) at MooseX::Getopt::Basic::_parse_argv(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:138) at MooseX::Getopt::Basic::process_argv(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:79) at MooseX::Getopt::Basic::new_with_options(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:105) at Catalyst::ScriptRunner::run(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at main::(script/waste_web_server.pl:8) Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at Carp::croak(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at Class::Load::_croak(/usr/local/share/perl/5.10.1/Class/Load.pm:200) at Class::Load::load_class(/usr/local/share/perl/5.10.1/Class/Load.pm:41) at Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:90) at Catalyst::Script::Server::run(/usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm:240) at Catalyst::ScriptRunner::run(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at main::(script/waste_web_server.pl:8) So maybe there's something pertinent going on at Catalyst::ScriptRole? (Doubtful, but just in case...) MooseX::Getopt::Basic::CODE(0x943d320)(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:134): DB3 v 131 my ( $parsed_options, $usage ) = try { 132:b local $SIG{__WARN__} = sub { push @warnings, @_ }; 133 134== return $class-_getopt_get_options(\%params, $opt_spec); 135 } 136 catch { 137:$class-_getopt_spec_exception(\@warnings, $_); 138:}; 139 140:$class-_getopt_spec_warnings(@warnings) if @warnings; DB4 x $opt_spec 0 ARRAY(0x9897f38) 0 ARRAY(0x943cfe0) 0 'loader_class=s' 1 'The class to use to detect and load the PSGI engine' 2 HASH(0x942e650) empty hash 1 ARRAY(0x9438a18) 0 'help|usage|?|h!' 1 'Prints this usage information.' 2 HASH(0x94389e8) empty hash 2 ARRAY(0x9438688) 0 'debug|d!' 1 'Force debug mode' 2 HASH(0x9441648) empty hash 3 ARRAY(0x943dcf0) 0 'host|h=s' 1 'Specify a hostname or IP on this host for the server to bind to' 2 HASH(0x942e850) empty hash 4 ARRAY(0x943d420) 0 'fork|f!' 1 'Fork the server to be able to serve multiple requests at once' 2 HASH(0x943d4b0) empty hash 5 ARRAY(0x943d4d0) 0 'port|p=i' 1 'Specify a different listening port (to the default port 3000)' 2 HASH(0x943d4f0) empty hash 6 ARRAY(0x9a03f38) 0 'pidfile|pid=s' 1 'Specify a pidfile' 2 HASH(0x99f8690) empty hash 7 ARRAY(0x99dde10) 0 'keepalive|k!' 1 'Support keepalive' 2 HASH(0x99fdf58) empty hash 8 ARRAY(0x99fe838) 0 'background|bg!' 1 'Run in the background' 2 HASH(0x99f0498) empty hash 9 ARRAY(0x99f8f00) 0 'restart|r!' 1 'use Catalyst::Restarter to detect code changes and restart the application' 2 HASH(0x99f8ac0) empty hash 10 ARRAY(0x99fddc8) 0 'restart_directory|rdir|restartdirectory=s@' 1 'Restarter directory to watch' 2 HASH(0x99f8b40) empty hash 11 ARRAY(0x99fe0b8) 0 'restart_delay|rd=i' 1 'Set a restart delay' 2 HASH(0x99fe1d8) empty hash 12 ARRAY(0x99f92f0) 0 'restart_regex|rr=s' 1 'Restart regex' 2 HASH(0x99fdb18) empty hash 13 ARRAY(0x99f03b8) 0 'follow_symlinks|sym!' 1 'Follow symbolic links' 2 HASH(0x99fe288) empty hash 14 ARRAY(0x9a12cd0) 0 'restarter_class=s' 1 ' ' 2 HASH(0x99f8680) empty hash DB5 x \%params 0 HASH(0x98782f0) 'options' = ARRAY(0x8c68400) 0 HASH(0x9441168) 'doc' = 'The class to use to detect and load the PSGI engine' 'init_arg' = 'loader_class' 'name' = 'loader_class' 'opt_string' = 'loader_class=s' 'required' = undef 1 HASH(0x99fdb88) 'doc' = 'Prints this usage information.'
Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
Hmm. I don't see anything out of line here...? $ perl Makefile.PL include /home/will/projects/perl-mvc/Waste/inc/Module/Install.pm include inc/Module/Install/Metadata.pm include inc/Module/Install/Base.pm include inc/Module/Install/Makefile.pm Cannot determine perl version info from lib/Waste/Web.pm include inc/Module/Install/Catalyst.pm include inc/Module/Install/Include.pm include inc/File/Copy/Recursive.pm *** Module::Install::Catalyst Please run make catalyst_par to create the PAR package! *** Module::Install::Catalyst finished. include inc/Module/Install/Scripts.pm include inc/Module/Install/AutoInstall.pm include inc/Module/AutoInstall.pm *** Module::AutoInstall version 1.04 *** Checking for Perl dependencies... [Core Features] - Test::More ...loaded. (0.98 = 0.88) - Catalyst::Runtime ...loaded. (5.90020 = 5.80032) - Catalyst::Plugin::ConfigLoader ...loaded. (0.32) - Catalyst::Plugin::Static::Simple ...loaded. (0.29) - Catalyst::Action::RenderView ...loaded. (0.14) - Moose ...loaded. (2.0801) - namespace::autoclean ...loaded. (0.13) - Config::General...loaded. (2.49) - Catalyst::Plugin::Session ...loaded. (0.29) - Catalyst::Plugin::Session::Store::DBIC ...loaded. (0.11) - Catalyst::Plugin::Session::State::Cookie ...loaded. (0.17) - Catalyst::Plugin::Authentication ...loaded. (0.10016) - Catalyst::Plugin::Authentication::Credential::Password ...loaded. (0) - Catalyst::Plugin::Authorization::Roles ...loaded. (0.08) - Catalyst::Plugin::Cache...loaded. (0.09) - DBIx::Class::Cursor::Cached...loaded. (1.01) *** Module::AutoInstall configuration finished. include inc/Module/Install/WriteAll.pm include inc/Module/Install/Win32.pm include inc/Module/Install/Can.pm include inc/Module/Install/Fetch.pm Writing Makefile for Waste::Web Writing MYMETA.yml and MYMETA.json Writing META.yml And our app class is same as I posted in the original message of this thread -- very standard: package Waste::Web; use Moose; use namespace::autoclean; use Catalyst::Runtime 5.80; use Catalyst qw/ ConfigLoader Static::Simple Session Session::Store::DBIC Session::State::Cookie Authentication Authentication::Credential::Password Authorization::Roles Cache /; use Waste::Lib::CSV; extends 'Catalyst'; our $VERSION = '1.10'; __PACKAGE__-config( name = 'Waste::Web', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback = 1, ); # Start the application __PACKAGE__-setup(); Which cpanm module needs an upgrade? And is there a way for me to figure that out for next time so I don't have to bother the list with it? :) On Sun, Mar 31, 2013 at 10:00 AM, Tomas Doran bobtf...@bobtfish.net wrote: Hmm. Class::Accessor::Fast should not be being used - I'd guess that you might have an outdated plugin? What does your application class look like, and does running the Makefile.PL of Catalyst-Runtime tell you to upgrade any plugins? Cheers t0m On 31 Mar 2013, at 02:21, will trillich will.trill...@serensoft.com wrote: $ perl -wMDevel::SimpleTrace script/waste_web_server.pl Duplicate specification host|h=s for option h at Catalyst::ScriptRole::_getopt_spec_warnings(unknown source) at MooseX::Getopt::Basic::_parse_argv(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:138) at MooseX::Getopt::Basic::process_argv(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:79) at MooseX::Getopt::Basic::new_with_options(/usr/local/share/perl/5.10.1/MooseX/Getopt/Basic.pm:105) at Catalyst::ScriptRunner::run(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at main::(script/waste_web_server.pl:8) Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at Carp::croak(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at Class::Load::_croak(/usr/local/share/perl/5.10.1/Class/Load.pm:200) at Class::Load::load_class(/usr/local/share/perl/5.10.1/Class/Load.pm:41) at Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:90) at Catalyst::Script::Server::run(/usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm:240) at Catalyst::ScriptRunner::run(/usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm:50) at main::(script/waste_web_server.pl:8) So maybe there's something pertinent going on at
Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
On 31 Mar 2013, at 19:58, will trillich will.trill...@serensoft.com wrote: Hmm. I don't see anything out of line here...? $ perl Makefile.PL include /home/will/projects/perl-mvc/Waste/inc/Module/Install.pm include inc/Module/Install/Metadata.pm include inc/Module/Install/Base.pm include inc/Module/Install/Makefile.pm Cannot determine perl version info from lib/Waste/Web.pm include inc/Module/Install/Catalyst.pm include inc/Module/Install/Include.pm include inc/File/Copy/Recursive.pm *** Module::Install::Catalyst Please run make catalyst_par to create the PAR package! *** Module::Install::Catalyst finished. include inc/Module/Install/Scripts.pm include inc/Module/Install/AutoInstall.pm include inc/Module/AutoInstall.pm *** Module::AutoInstall version 1.04 *** Checking for Perl dependencies... [Core Features] - Test::More ...loaded. (0.98 = 0.88) - Catalyst::Runtime ...loaded. (5.90020 = 5.80032) - Catalyst::Plugin::ConfigLoader ...loaded. (0.32) - Catalyst::Plugin::Static::Simple ...loaded. (0.29) - Catalyst::Action::RenderView ...loaded. (0.14) - Moose ...loaded. (2.0801) - namespace::autoclean ...loaded. (0.13) - Config::General...loaded. (2.49) - Catalyst::Plugin::Session ...loaded. (0.29) - Catalyst::Plugin::Session::Store::DBIC ...loaded. (0.11) - Catalyst::Plugin::Session::State::Cookie ...loaded. (0.17) - Catalyst::Plugin::Authentication ...loaded. (0.10016) - Catalyst::Plugin::Authentication::Credential::Password ...loaded. (0) - Catalyst::Plugin::Authorization::Roles ...loaded. (0.08) - Catalyst::Plugin::Cache...loaded. (0.09) - DBIx::Class::Cursor::Cached...loaded. (1.01) *** Module::AutoInstall configuration finished. include inc/Module/Install/WriteAll.pm include inc/Module/Install/Win32.pm include inc/Module/Install/Can.pm include inc/Module/Install/Fetch.pm Writing Makefile for Waste::Web Writing MYMETA.yml and MYMETA.json Writing META.yml That's your app's Makefile.PL I asked for the Makefile.PL for Catalyst::Runtime (as that includes the 'you must upgrade this plugin for this version of Catalyst' warnings. And our app class is same as I posted in the original message of this thread -- very standard: package Waste::Web; use Moose; use namespace::autoclean; use Catalyst::Runtime 5.80; use Catalyst qw/ ConfigLoader Static::Simple Session Session::Store::DBIC Session::State::Cookie Authentication Authentication::Credential::Password Authorization::Roles Cache /; use Waste::Lib::CSV; extends 'Catalyst'; our $VERSION = '1.10'; __PACKAGE__-config( name = 'Waste::Web', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback = 1, ); # Start the application __PACKAGE__-setup(); Yeah, I'd strongly guess it's one of the plugins :) Which cpanm module needs an upgrade? And is there a way for me to figure that out for next time so I don't have to bother the list with it? :) Hopefully the one running the -Runtime Makefile.PL will tell you :) Cheers t0m ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
We have a Catalyst app Waste::Web that has been running fine and we are trying to upgrade to a more modern set of libraries via cpanm. (One library was upgraded that caused conflicts, now we're running a sweep to get everything updated...) We have an old app called Spills that still runs fine. The problem is with a different old app called Waste::Web... It won't start, throwing the can't use string as HASH ref error, neither as standalone server for testing nor via apache. Suggestions? At first we thought maybe the script formats had changed. So we ran a quick sample catalyst.pl Catalyst::Upgrade to come up with the latest structure for comparison. This I'll call new script below. Then we looked at the script/*pl files, the lib/* files. None of the structures seem to have changed from what we can tell. That is, the old script/*server.pl script has the same standard structure as the brand new script: #!/usr/bin/env perl BEGIN { $ENV{CATALYST_SCRIPT_GEN} = 40; } use Catalyst::ScriptRunner; Catalyst::ScriptRunner-run('Waste::Web', 'Server'); 1; Comparing lib/Waste/Web.pm (old script) to lib/Catalyst/Upgrade.pm (new script) also looks similar -- commented code redacted for space: package Waste::Web; use Moose; use namespace::autoclean; use Catalyst::Runtime 5.80; use Catalyst qw/ ConfigLoader Static::Simple Session Session::Store::DBIC Session::State::Cookie Authentication Authentication::Credential::Password Authorization::Roles Cache /; use Waste::Lib::CSV; extends 'Catalyst'; our $VERSION = '1.10'; __PACKAGE__-config( name = 'Waste::Web', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback = 1, ); # Start the application __PACKAGE__-setup(); In the new script there *is* a new option to the __PACKAGE__-config call but it's just to instantiate the X-Catalyst http header. All serious structures look the same. But Catalyst::Upgrade runs just fine, and an old app Spill runs just fine, where Waste::Web throws the error: Waste$ *perl script/waste_web_server.pl * Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50. Waste$ *cd ../Catalyst-Upgrade/* Catalyst-Upgrade$ perl script/catalyst_upgrade_server.pl HTTP::Server::PSGI: Accepting connections at http://0:3000/ Any ideas why we'd be getting this error? Here's the single-step debug log: Catalyst::Script::Server::run(/usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm:240): DB1 *v* 237 $self-pidfile-write 238:if $self-_has_pidfile; 239 240== $self-_run_application; 241 } 242 243 244 } 245 246 sub _plack_loader_args { DB1 *s* Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:88): 88: my $self = shift; DB1 *n* Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:89): 89: my $app = $self-application_name; DB1 *n* Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:90): 90: Class::MOP::load_class($app); DB1 *p $app* Waste::Web DB2 *n* Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50. at /usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm line 90. Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0xa5e1660)') called at /usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm line 240 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa5e1660)') called at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Waste::Web', 'Server') called at script/waste_web_server.pl line 8 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...
What's the backtrace look like if you load Devel::SimpleTrace or Carp::Always? Cheers t0m On 30 Mar 2013, at 12:04, will trillich will.trill...@serensoft.com wrote: We have a Catalyst app Waste::Web that has been running fine and we are trying to upgrade to a more modern set of libraries via cpanm. (One library was upgraded that caused conflicts, now we're running a sweep to get everything updated...) We have an old app called Spills that still runs fine. The problem is with a different old app called Waste::Web... It won't start, throwing the can't use string as HASH ref error, neither as standalone server for testing nor via apache. Suggestions? At first we thought maybe the script formats had changed. So we ran a quick sample catalyst.pl Catalyst::Upgrade to come up with the latest structure for comparison. This I'll call new script below. Then we looked at the script/*pl files, the lib/* files. None of the structures seem to have changed from what we can tell. That is, the old script/*server.pl script has the same standard structure as the brand new script: #!/usr/bin/env perl BEGIN { $ENV{CATALYST_SCRIPT_GEN} = 40; } use Catalyst::ScriptRunner; Catalyst::ScriptRunner-run('Waste::Web', 'Server'); 1; Comparing lib/Waste/Web.pm (old script) to lib/Catalyst/Upgrade.pm (new script) also looks similar -- commented code redacted for space: package Waste::Web; use Moose; use namespace::autoclean; use Catalyst::Runtime 5.80; use Catalyst qw/ ConfigLoader Static::Simple Session Session::Store::DBIC Session::State::Cookie Authentication Authentication::Credential::Password Authorization::Roles Cache /; use Waste::Lib::CSV; extends 'Catalyst'; our $VERSION = '1.10'; __PACKAGE__-config( name = 'Waste::Web', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback = 1, ); # Start the application __PACKAGE__-setup(); In the new script there *is* a new option to the __PACKAGE__-config call but it's just to instantiate the X-Catalyst http header. All serious structures look the same. But Catalyst::Upgrade runs just fine, and an old app Spill runs just fine, where Waste::Web throws the error: Waste$ perl script/waste_web_server.pl Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50. Waste$ cd ../Catalyst-Upgrade/ Catalyst-Upgrade$ perl script/catalyst_upgrade_server.pl HTTP::Server::PSGI: Accepting connections at http://0:3000/ Any ideas why we'd be getting this error? Here's the single-step debug log: Catalyst::Script::Server::run(/usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm:240): DB1 v 237 $self-pidfile-write 238:if $self-_has_pidfile; 239 240== $self-_run_application; 241 } 242 243 244 } 245 246 sub _plack_loader_args { DB1 s Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:88): 88: my $self = shift; DB1 n Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:89): 89: my $app = $self-application_name; DB1 n Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:90): 90: Class::MOP::load_class($app); DB1 p $app Waste::Web DB2 n Can't use string (Waste::Web) as a HASH ref while strict refs in use at /usr/share/perl5/Class/Accessor/Fast.pm line 10. Compilation failed in require at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50. at /usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm line 90. Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0xa5e1660)') called at /usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm line 240 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa5e1660)') called at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Waste::Web', 'Server') called at script/waste_web_server.pl line 8 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: