Re: [Catalyst] ConfigLoader trouble
On 17 Jun 2009, at 11:16, Ben Vinnerd wrote: It's like ConfigLoader's setup() isn't being run, or it's choosing to ignore the MYAPP_CONFIG_LOCAL_SUFFIX i'm setting. I'm afraid the best way to debug this is likely to be brute force. Copy your apache config somewhere, mangle it to only run 1 child process, then try to start the app with strace -f, pipe the stdout and stderr to a file. You can then grep through that file for instances of myapp_.*\.(conf| yml|whatever). This should help you build a mental model of how it's going wrong (e.g. looking for the wrong filename, looking in the wrong place, just not looking etc). One you know what it's doing wrong in more detail then it'll be easier to work out how to debug/fix. 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] ConfigLoader trouble
On 18/06/09 08:57, Tomas Doran wrote: On 17 Jun 2009, at 11:16, Ben Vinnerd wrote: It's like ConfigLoader's setup() isn't being run, or it's choosing to ignore the MYAPP_CONFIG_LOCAL_SUFFIX i'm setting. I'm afraid the best way to debug this is likely to be brute force. No need - i tried putting back the Makefile.PL i deleted (as per other thread), and ConfigLoader (as if by magic) started working again. I really should read important notices a bit more :) Ben ___ 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] ConfigLoader trouble
What's the error you're getting? On Wed, Jun 17, 2009 at 3:52 AM, Ben Vinnerd ben-catal...@vinnerd.comwrote: Hi all, Have got a problem with ConfigLoader not reading %ENV. At the top of Myapp.pm i have: use parent qw/Catalyst/; use Catalyst qw/StackTrace ConfigLoader/; ...and i'm setting env var in httpd.conf: PerlSetVar MYAPP_CONFIG_LOCAL_SUFFIX beta ... but ConfigLoader will not load myapp_beta.conf from the application dir. I have output the contents of %ENV to my Apache log, and MYAPP_CONFIG_LOCAL_SUFFIX is there. I'm stumped, as i have this working on another machine. If i manually set ConfigLoader's file option, it loads the config fine: __PACKAGE__-config-{'Plugin::ConfigLoader'} = {file = '/home/ben/Myapp/myapp_beta.conf'}; Any ideas? Ben ___ 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/ -- Devin Austin http://www.codedright.net http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost! ___ 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] ConfigLoader trouble
On 17/06/09 10:57, Devin Austin wrote: What's the error you're getting? The Model::DB config i'm putting in myapp_beta.conf isn't being read by ConfigLoader, so the error i'm getting is from DBIx::Class stating that it needs connect_info. But this error is irrelevant... it's ConfigLoader not reading the file that is the problem. Ben ___ 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] ConfigLoader trouble
Paste your conf, connect_info actually has to be an array(ref?) and it has to be put together kinda funny in myapp.conf. On Wed, Jun 17, 2009 at 4:13 AM, Ben Vinnerd ben-catal...@vinnerd.comwrote: On 17/06/09 10:57, Devin Austin wrote: What's the error you're getting? The Model::DB config i'm putting in myapp_beta.conf isn't being read by ConfigLoader, so the error i'm getting is from DBIx::Class stating that it needs connect_info. But this error is irrelevant... it's ConfigLoader not reading the file that is the problem. Ben ___ 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/ -- Devin Austin http://www.codedright.net http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost! ___ 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] ConfigLoader trouble
On 17/06/09 11:02, Joel Bernstein wrote: On 17 Jun 2009, at 10:52, Ben Vinnerd wrote: Have got a problem with ConfigLoader not reading %ENV. At the top of Myapp.pm i have: use parent qw/Catalyst/; use Catalyst qw/StackTrace ConfigLoader/; ...and i'm setting env var in httpd.conf: PerlSetVar MYAPP_CONFIG_LOCAL_SUFFIX beta ^^^ is this intentional? Should be Env? ... but ConfigLoader will not load myapp_beta.conf from the application dir. I have output the contents of %ENV to my Apache log, and MYAPP_CONFIG_LOCAL_SUFFIX is there. I'm stumped, as i have this working on another machine. If i manually set ConfigLoader's file option, it loads the config fine: __PACKAGE__-config-{'Plugin::ConfigLoader'} = {file = '/home/ben/Myapp/myapp_beta.conf'}; Any ideas? I've not run Catalyst under mod_perl in quite a while, but I would expect PerlSetEnv to definitely DTRT. Are PerlSetVar variables made available in %ENV under C::Engine::Apache? I don't believe so. Does switching to PerlSetEnv fix your issue? Sorry, typo, yes i'm using PerlSetEnv, *not* PerlSetVar. I have PerlOptions +SetupEnv in my apache config, and like i say i output %ENV and it's definately there. It's like ConfigLoader's setup() isn't being run, or it's choosing to ignore the MYAPP_CONFIG_LOCAL_SUFFIX i'm setting. ___ 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] ConfigLoader trouble
On 17/06/09 11:15, Devin Austin wrote: Paste your conf, connect_info actually has to be an array(ref?) and it has to be put together kinda funny in myapp.conf. Model::DB connect_info dbi:mysql:motoring:localhost;mysql_client_found_rows=1 connect_info connect_info connect_info AutoCommit 0 PrintError 1 RaiseError 1 /connect_info connect_info on_connect_do set names utf8 /connect_info /Model::DB ___ 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/