Re: [Catalyst] Catalyst::Controller: find_meta not found
On 15 Feb 2012, at 00:12, Seth Daniel wrote: Array found where operator expected at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 215, at end of line (Missing operator before ?) Undefined subroutine Catalyst::Controller::find_meta called at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 199. Compilation failed in require at /opt/perl/5.10/lib/site_perl/5.10.1/Module/Runtime.pm line 317. at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Script/Server.pm line 239 I'm seeing examples of this coming up from CPAN testers reports for one of my modules. The vast majority of results are passes, but a few get this failure or one of a couple of similarish ones (fails so far are listed below). Fails are over a variety of perl versions across BSD and Solaris platforms. I'm aiming to spend a bit of time chasing this in the next couple of days, although hints would be very welcome... [and I must at this point say a huge thanks to the CPAN testers guys] Nigel. Catalyst-Authentication-Credential-RemoteHTTP-0.04: - x86_64-linux-ld / 5.14.2: - FAIL http://www.cpantesters.org/cpan/report/0bb31504-5176-11e1-9519-d24f9aeef8c6 - x86_64-linux-thread-multi-ld / 5.14.2: - FAIL http://www.cpantesters.org/cpan/report/0cc8b138-5176-11e1-9519-d24f9aeef8c6 Catalyst-Authentication-Credential-RemoteHTTP-0.05: - OpenBSD.amd64-openbsd / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/248b678c-56aa-11e1-9d6f-f6dbfa7543f5 - amd64-freebsd / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/25e0218a-5647-11e1-9d6f-f6dbfa7543f5 - amd64-freebsd-thread-multi / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/c1e01ec6-5662-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris / 5.10.1: - FAIL http://www.cpantesters.org/cpan/report/3b4f6918-56a6-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/db3f32fc-562c-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris-64int / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/391b099c-5659-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris-thread-multi / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/29e700c4-564b-11e1-9d6f-f6dbfa7543f5 - OpenBSD.amd64-openbsd-thread-multi / 5.8.9: - FAIL http://www.cpantesters.org/cpan/report/dd58795e-56bd-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris-64int / 5.10.1: - FAIL http://www.cpantesters.org/cpan/report/2e0c9c76-56d3-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris-thread-multi / 5.10.1: - FAIL http://www.cpantesters.org/cpan/report/ac74c214-56c4-11e1-9d6f-f6dbfa7543f5 - i86pc-solaris-thread-multi-64int / 5.10.1: - FAIL http://www.cpantesters.org/cpan/report/1867ca94-56b5-11e1-9d6f-f6dbfa7543f5 -- [ Nigel Metheringham -- ni...@dotdot.it ] [ Ellipsis Intangible Technologies ] ___ 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] Using Test::WWW::Mechanize::Catalyst on a test database
I would like to use Test::WWW::Mechanize::Catalyst with an alternative database schema (since I want to test reading and writing on a database with the same schema but known data that is not the live database), but it's not clear to me from reading the documentation on how to do this, or even if it's possible. I've found examples using Catalyst::Test with DBICx::TestDatabase, but I cannot get it to work. The line $c-model('DBIC')-schema($schema); fails with Can't call method schema on an undefined value... Worse, the application uses some PostgreSQL extensions, so DBICx::TestDatabase is not appropriate. I am looking into Test::DBIx::Class as an alternative, but again, it's still not clear how to change the database that Test::WWW::Mechanize uses. Regards, Rob ___ 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] Catalyst::Controller: find_meta not found
With a very simple catalyst app this happens: Array found where operator expected at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 215, at end of line (Missing operator before ?) Undefined subroutine Catalyst::Controller::find_meta called at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 199. Compilation failed in require at /opt/perl/5.10/lib/site_perl/5.10.1/Module/Runtime.pm line 317. at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Script/Server.pm line 239 If I comment out the 'use namespace::clean' at the top of Catalyst::Controller everything is fine (or seems fine). If I downgrade Class::Load, Module::Runtime, Module::Implementation, and MooseX::MethodAttributes everything is fine with the app w/o changes to Catalyst code. I'm getting this as well on perlbrew 5.10.1 and it's just started happening. I'm trying to trace back to how/when: [ghenry@dax-xen SureVoIP-API]$ CATALYST_DEBUG=1 DBIC_TRACE=1 script/surevoip_api_server.pl Array found where operator expected at /home/ghenry/perl5/lib/perl5/Catalyst/Controller.pm line 215, at end of line (Missing operator before ?) String found where operator expected at /home/ghenry/surevoip/surevoip-api-git/SureVoIP-API/script/../lib/SureVoIP/API/Controller/SMS.pm line 19, near has 'sms_form' (Do you need to predeclare has?) syntax error at /home/ghenry/surevoip/surevoip-api-git/SureVoIP-API/script/../lib/SureVoIP/API/Controller/SMS.pm line 19, near has 'sms_form' BEGIN not safe after errors--compilation aborted at /home/ghenry/surevoip/surevoip-api-git/SureVoIP-API/script/../lib/SureVoIP/API/Controller/SMS.pm line 44. Compilation failed in require at /home/ghenry/perl5/lib/perl5/Catalyst/Utils.pm line 287. Compilation failed in require at /home/ghenry/perl5/lib/perl5/Module/Runtime.pm line 317. at /home/ghenry/perl5/lib/perl5/Catalyst/Script/Server.pm line 239 I'm on the latest Cat and MooseX::MethodAttributes, but will check for downgrades like you did. If I do: perlbrew switch perl-5.14.2 I get: [ghenry@dax-xen SureVoIP-API]$ CATALYST_DEBUG=1 DBIC_TRACE=1 script/surevoip_api_server.pl Segmentation fault If I do: [ghenry@dax-xen SureVoIP-API]$ perl -Ilib -c lib/SureVoIP/API/Controller/SMS.pm lib/SureVoIP/API/Controller/SMS.pm syntax OK I can at least run perltidy and do a syntax check. -- http://www.suretecsystems.com/services/openldap/ http://www.surevoip.co.uk -- http://www.suretecsystems.com/services/openldap/ http://www.surevoip.co.uk ___ 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] Using Test::WWW::Mechanize::Catalyst on a test database
On Wed, Feb 15, 2012 at 03:25:51PM +, Robert Rothenberg wrote: I would like to use Test::WWW::Mechanize::Catalyst with an alternative database schema (since I want to test reading and writing on a database with the same schema but known data that is not the live database), but it's not clear to me from reading the documentation on how to do this, or even if it's possible. Very much so. Have you looked at http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/08_Testing.pod#SUPPORTING_BOTH_PRODUCTION_AND_TEST_DATABASES ? Jesse Sheidlower ___ 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] Using Test::WWW::Mechanize::Catalyst on a test database
On 15/02/12 16:03 Jesse Sheidlower wrote: On Wed, Feb 15, 2012 at 03:25:51PM +, Robert Rothenberg wrote: I would like to use Test::WWW::Mechanize::Catalyst with an alternative database schema (since I want to test reading and writing on a database with the same schema but known data that is not the live database), but it's not clear to me from reading the documentation on how to do this, or even if it's possible. Very much so. Have you looked at http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/08_Testing.pod#SUPPORTING_BOTH_PRODUCTION_AND_TEST_DATABASES So this requires maintaining two database schemas? (I guess I could have the script deploy to the test schema, though.) Regards, Rob ___ 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] Catalyst::Controller: find_meta not found
On 15 Feb 2012, at 15:55, Gavin Henry wrote: With a very simple catalyst app this happens: Array found where operator expected at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 215, at end of line (Missing operator before ?) Undefined subroutine Catalyst::Controller::find_meta called at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 199. Compilation failed in require at /opt/perl/5.10/lib/site_perl/5.10.1/Module/Runtime.pm line 317. Does it work if you set NAMESPACE_CLEAN_USE_PP=1 in your environment? (As that fixes it for me where I can replicate this). The culprit here appears to be a combination of namespace::clean, B::Hooks::EndOfScope and MooseX::MethodAttributes - but I'm not sure where the problem lies yet, so additional data points would be helpful :) 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/
Re: [Catalyst] Catalyst::Controller: find_meta not found
On Wed, Feb 15, 2012 at 09:48:37PM +, Tomas Doran wrote: On 15 Feb 2012, at 15:55, Gavin Henry wrote: With a very simple catalyst app this happens: Array found where operator expected at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 215, at end of line (Missing operator before ?) Undefined subroutine Catalyst::Controller::find_meta called at /opt/perl/5.10/lib/site_perl/5.10.1/Catalyst/Controller.pm line 199. Compilation failed in require at /opt/perl/5.10/lib/site_perl/5.10.1/Module/Runtime.pm line 317. Does it work if you set NAMESPACE_CLEAN_USE_PP=1 in your environment? (As that fixes it for me where I can replicate this). The culprit here appears to be a combination of namespace::clean, B::Hooks::EndOfScope and MooseX::MethodAttributes - but I'm not sure where the problem lies yet, so additional data points would be helpful :) Cheers t0m It works for me with NAMESPACE_CLEAN_USE_PP=1. If I change it to 0 I get failures again. I'm the one that started this thread so all the details of my setup are in the initial e-mail. A couple of addendums: I am using Centos 5.4 with a custom compiled perl 5.10.1. Please let me know what other details you may need. -- seth /\ sethdaniel.org ___ 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] Using Test::WWW::Mechanize::Catalyst on a test database
On 16/02/2012, at 3:29 AM, Robert Rothenberg wrote: On 15/02/12 16:03 Jesse Sheidlower wrote: On Wed, Feb 15, 2012 at 03:25:51PM +, Robert Rothenberg wrote: I would like to use Test::WWW::Mechanize::Catalyst with an alternative database schema (since I want to test reading and writing on a database with the same schema but known data that is not the live database), but it's not clear to me from reading the documentation on how to do this, or even if it's possible. Very much so. Have you looked at http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/08_Testing.pod#SUPPORTING_BOTH_PRODUCTION_AND_TEST_DATABASES So this requires maintaining two database schemas? (I guess I could have the script deploy to the test schema, though.) I'm planning on writing up a fairly neat solution to this problem shortly (it's supposed to be the first article in the catalyst advent replacement). But I'll note here that you can get DBIC Schema deployments (rather than SQL file deploys) working so long as enough metadata gets shoved into the Result classes. Of course this requires up front effort, and is unlikely to be worthwhile for a brown field project with a complex existing database. ___ 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] Using Test::WWW::Mechanize::Catalyst on a test database
On 16/02/2012, at 9:45 AM, Robert Rothenberg wrote: On 15/02/12 16:03 Jesse Sheidlower wrote: On Wed, Feb 15, 2012 at 03:25:51PM +, Robert Rothenberg wrote: I would like to use Test::WWW::Mechanize::Catalyst with an alternative database schema (since I want to test reading and writing on a database with the same schema but known data that is not the live database), but it's not clear to me from reading the documentation on how to do this, or even if it's possible. Very much so. Have you looked at http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/08_Testing.pod#SUPPORTING_BOTH_PRODUCTION_AND_TEST_DATABASES This isn't working. It's clearly trying to load the myapp_testing.conf file (because it complains if I put in syntax errors), but the database connection info is not being overridden, and it's wiping the production database. Can you produce a minimal test case demonstrating this and put it on the RT queue for Catalyst::Manual please? Meanwhile read the email I sent to you privately for a comprehensive rock solid solution which I will finally write up for public consumption :) ___ 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] Overriding chained methods.
I have an app that is naturally hierarchical, so to make up an example a path might be: /version1/country/12/region/31/state/12/city/45 which I use Chained actions to implement. And the Controllers follow that layout as well: App/Controller/Version1/Country/Region/State/City.pm Here's where I need some ideas: Say at some point I need to change the API for an action in the City.pm controller in a non-compatible way. I woud like to be able to just override that ONE method in a new controller. For example, by adding this (note the version number change) App/Controller/Version2/Country/Region/State/City.pm which contains just the method I want to override, and then inherit from the version 1. Of course, ALL actions in version 1 would be available in version 2. I've have done something similar in the past, but without using Chained actions -- although in that case the need was for a set of /guest/ actions that had a subset of the app's actions, and I just had the /guest/* controllers inherit from the original controllers. Any suggestions? -- Bill Moseley mose...@hank.org ___ 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] Re: Overriding chained methods.
On Thu, Feb 16, 2012 at 7:40 AM, Bill Moseley mose...@hank.org wrote: I have an app that is naturally hierarchical, so to make up an example a path might be: /version1/country/12/region/31/state/12/city/45 which I use Chained actions to implement. BTW -- On a side note (and as a sanity check) here's how I'm implementing this. It's a REST style app, and I need actions: GET /country/123/region -- list all regions in the country POST /country/123/region - add to the list of regions in that country. GET /country/123/region/456 - get the specific item PUT, DELETE as normal. I'm always working with a list or an item in each controller -- so decided to just standardize on that and write less code. Then my controllers mostly look like this: package App::Controller::Country::Region; use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller::REST' } with 'App::ChainedREST'; sub list_GET {} # /country/$id/region sub item_GET {} # /country/$id/region/$id before args = sub { ... ] # or whatever. And so on. My poorly-named ChainedREST' role looks mostly like this: sub base : Chained( '../arg' ) CaptureArgs(0) { } sub list : Chained( 'base' ) PathPart( '' ) : Args(0) ActionClass(REST) { } sub arg : Chained( 'base' ) PathPart( '') CaptureArgs(1) {} sub item : Chained( 'arg' ) PathPart( '' ) : Args(0) ActionClass(REST) { } Means I must add an args action to my Root controller. And I also have a BUILDARGS method to set the PathPart based on the controller's name: before BUILDARGS = sub { my $class = shift; my ( $name ) = $class =~ /::([^:]+)$/; $class-config-{action}{base}{PathPart} ||= lc $name; return; }; -- Bill Moseley mose...@hank.org ___ 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] Fix for content-length issue introduced with Catalyst 5.8.x
On Thu, Feb 16, 2012 at 9:51 AM, Dominic Germain mailingli...@sogetel.comwrote: Hi, We just update from Catalyst 5.7.x to Catalyst 5.90007. All our apps code and our DBs are in ISO-8859-1 encoding. View::TT is configured to output stuff as UTF-8 and everything is working fine until the update. It means that there is some re-encoding occurring somewhere in Catalyst View processing. Are you using Catalyst::Plugin::Unicode::Encoding? Are you decoding all your templates and data on input? The problem is quite simple: Catalyst is unable to figure out the right content-length as soon we have characters that requires two bytes in UTF-8. French accent characters like é, ê, 'è, à, etc. are good examples. Previously, bytes::length was used and it works fine but the code was changed to just length. Which is correct. length() on encoded content is the length in bytes. But, if you are not encoding it will be wrong. -- Bill Moseley mose...@hank.org ___ 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] Fix for content-length issue introduced with Catalyst 5.8.x
No, we are not using Catalyst::Plugin::Unicode::Encoding Dominic Germain - Administrateur réseau / Network administrator Sogetel www.sogetel.net mailingli...@sogetel.com Le 12-02-15 à 22:25, Bill Moseley a écrit : On Thu, Feb 16, 2012 at 9:51 AM, Dominic Germain mailingli...@sogetel.com wrote: Hi, We just update from Catalyst 5.7.x to Catalyst 5.90007. All our apps code and our DBs are in ISO-8859-1 encoding. View::TT is configured to output stuff as UTF-8 and everything is working fine until the update. It means that there is some re-encoding occurring somewhere in Catalyst View processing. Are you using Catalyst::Plugin::Unicode::Encoding? Are you decoding all your templates and data on input? The problem is quite simple: Catalyst is unable to figure out the right content-length as soon we have characters that requires two bytes in UTF-8. French accent characters like é, ê, 'è, à, etc. are good examples. Previously, bytes::length was used and it works fine but the code was changed to just length. Which is correct. length() on encoded content is the length in bytes. But, if you are not encoding it will be wrong. -- Bill Moseley mose...@hank.org ___ 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: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Fix for content-length issue introduced with Catalyst 5.8.x
On Thu, Feb 16, 2012 at 10:56 AM, Dominic Germain mailingli...@sogetel.comwrote: No, we are not using Catalyst::Plugin::Unicode::Encoding Does using it fix your problem? It should. But, you also should decode input data, too. I'm still not sure why that is a separate plugin. When would you not need to encode? Although, seems like should also check for the utf8 flag -- to catch the case where the content has already been encoded. -- Bill Moseley mose...@hank.org ___ 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] nginx/FastCGI configuration issues
On Thu, Feb 16, 2012 at 3:02 AM, Jesse Sheidlower jes...@panix.com wrote: location /incomings { include fastcgi_params; fastcgi_param SCRIPT_NAME /incomings/; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_pass unix:/tmp/incomings.socket; } in those docs they say if your application is rooted at /myapp.. do they mean with this..? http://wiki.nginx.org/HttpCoreModule#root location /incomings/static { alias /usr/local/www/modules/Incomings/root/static; } I tried to follow the docs (at C::M::Deployment::nginx::FastCGI) exactly, and if I'm doing something wrong, I'm not clear what it is. I'd be very grateful for any suggestions for how to solve this, as this is the one thing preventing the server from going live! Thanks. Jesse Sheidlower ___ 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: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/