Re: [Catalyst] Re: Warnings when upgrading Catalyst

2009-07-02 Thread George Nistorica
Hello,

Tomas Doran wrote:
 
 On 29 Jun 2009, at 11:40, George Nistorica wrote:
 
 Tomas Doran wrote:
 Hmm, I can't replicate this in a simple case, from that description..

 Here: http://www.depechemode.ro/MyApp-0.1.tar.gz
 a simple TestApp using Catalyst::Controller::REST to replicate the
 problem, having Catalyst 5.80005 installed.
 
 Aha, this was very helpful, thank you.
 
 The issue is inside Action::REST. Specifically, you could only trigger
 it inside the 'action_GET' type methods.
 
 I've had a fiddle with it so that the REST actions come up in stats, and
 fixed the warning on the way:
 
 http://github.com/bobtfish/catalyst-action-rest/commit/679978b1f8a1f309ff7c11ea0a744f8b1fe22d5a
 
 
 This isn't ready to integrate yet, I think I probably need to rewrite it
 all to be less fugly when I've got a clear head, but it does the job.
 
 Can you check it out and confirm that this fixes the warnings for you?

I've checked it out and indeed using the version of Controller::REST you
provided fixes the warning.

Not only that, but it seems it doesn't break the functionality for both
the test application I provided and another more complex one I'm using.


 
 I guess I should also go fix the warning in Catalyst, and get the stats
 to display properly without this patch - but that is at best papering
 over the cracks :)

:)

 
 From your original mail, you said:
 that worked for me, and now the debug output shows the profiling for the
 methods I -forward() to as well:

 the methods from another Controller to which I forward to, where missing
 from the profiling output, getting that warning instead.
 
 I can't see any methods missing from the stats table with / without this
 patch when using your supplied testapp however.

Indeed, the test application provided didn't show the behaviour I was
talking about. my bad :)

 
 Can you retry with the latest version of Catalyst so see if you can
 replicate this behavior once again, before we kill the warning and
 forget about this?

this replicates with Catalyst: 5.80005 Catalyst 5.80007
without the REST patch
the REST patch fixes the warning with both versions of Catalyst

Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.10.0/Catalyst.pm line 1573.


 
 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/


-- 
#!/usr/bin/perl -w ###
use strict;###

( $_ = qq{0912 3c1217 709073043p2it//,
'70kc1H 270P 70htonA t3uJ tni7p'8;})
=~tr/42179038/(larves)/;eval#uate;

##

___
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] Re: Warnings when upgrading Catalyst

2009-07-02 Thread Tomas Doran

George Nistorica wrote:

I've checked it out and indeed using the version of Controller::REST you
provided fixes the warning.

Not only that, but it seems it doesn't break the functionality for both
the test application I provided and another more complex one I'm using.


Great, thanks for testing.

I'll see if I can make the code any less gross and/or come up with a 
neater way of doing it, then get it integrated and shipped.



I guess I should also go fix the warning in Catalyst, and get the stats
to display properly without this patch - but that is at best papering
over the cracks :)


:)


From your original mail, you said:

that worked for me, and now the debug output shows the profiling for the
methods I -forward() to as well:

the methods from another Controller to which I forward to, where missing
from the profiling output, getting that warning instead.

I can't see any methods missing from the stats table with / without this
patch when using your supplied testapp however.


Indeed, the test application provided didn't show the behaviour I was
talking about. my bad :)


heh, no worries.


Can you retry with the latest version of Catalyst so see if you can
replicate this behavior once again, before we kill the warning and
forget about this?


this replicates with Catalyst: 5.80005 Catalyst 5.80007
without the REST patch
the REST patch fixes the warning with both versions of Catalyst

Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.10.0/Catalyst.pm line 1573.


Nono - I was _specifically_ talking about the lines missing from the 
stats table behavior.


I'm still concerned about working out the root cause of that, before I 
do something to 'just shut the warning up', as it were :)


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] adding my_app_name to action paths

2009-07-02 Thread Mike Glen

J. Shirley wrote:
It should happen automatically, provided you have set the 
using_frontend_proxy option.  Are you setting that correctly?


-J

I have tried putting using_frontend_proxy 1 in myapp.conf and also 
__PACKAGE__-config( name = 'MyApp', 'using_frontend_proxy' = 1 ) in 
MyApp.pm

Neither of those seem to work. Are these the wrong way to set it?
I haven't been able to find the documentation for this

this is what i have in my nginx.conf
   location /my_app/ {
   proxy_set_header Host $http_host;
   proxy_set_header X-Forwarded-Host $http_host;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

   proxy_pass  http://localhost:3000/;
   }

thanks


___
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] Re: Warnings when upgrading Catalyst

2009-07-02 Thread George Nistorica
Tomas Doran wrote:

[...]

 Can you retry with the latest version of Catalyst so see if you can
 replicate this behavior once again, before we kill the warning and
 forget about this?

 this replicates with Catalyst: 5.80005 Catalyst 5.80007
 without the REST patch
 the REST patch fixes the warning with both versions of Catalyst

 Use of uninitialized value in concatenation (.) or string at
 /usr/lib/perl5/site_perl/5.10.0/Catalyst.pm line 1573.
 
 Nono - I was _specifically_ talking about the lines missing from the
 stats table behavior.
 
 I'm still concerned about working out the root cause of that, before I
 do something to 'just shut the warning up', as it were :)

Running $ perl script/myapp_test.pl /rest/test
in several scenarios:

* Catalyst 5.80007 from CPAN, Catalyst::Controller::REST 0.73 from CPAN

.+---.
| Action | Time  |
++---+
| /rest/begin| 0.000156s |
| /rest/test | 0.000118s |
| - /test/private_forwarded_action  | 0.000239s |
| /rest/end  | 0.002551s |
'+---'

* Catalyst 5.80007, with warning supressed, Catalyst::Controller::REST
0.73 from CPAN

.+---.
| Action | Time  |
++---+
| /rest/begin| 0.000176s |
| /rest/test | 0.000131s |
| - /test/private_forwarded_action  | 0.000236s |
| /rest/end  | 0.002756s |
'+---'

* Catalyst 5.80007 from CPAN, Catalyst::Controller::REST 0.73 you provided

.+---.
| Action | Time  |
++---+
| /rest/begin| 0.000165s |
| /rest/test | 0.000140s |
| /rest/test_GET | 0.001048s |
|  - /test/private_forwarded_action | 0.000259s |
| /rest/end  | 0.004020s |
'+---'

* Catalyst 5.80007, with warning supressed, Catalyst::Controller::REST
0.73 you provided

.+---.
| Action | Time  |
++---+
| /rest/begin| 0.000202s |
| /rest/test | 0.000128s |
| /rest/test_GET | 0.000937s |
|  - /test/private_forwarded_action | 0.000260s |
| /rest/end  | 0.003944s |
'+---'

It looks like I was mistaken when talking about missing actions in the
stats output, in the sense that supressing the Catalyst warning didn't
automagically make more actions to be displayed in the stats.

However I see that using the REST controller you provided, test_GET pops up.



 
 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/


-- 
#!/usr/bin/perl -w ###
use strict;###

( $_ = qq{0912 3c1217 709073043p2it//,
'70kc1H 270P 70htonA t3uJ tni7p'8;})
=~tr/42179038/(larves)/;eval#uate;

##

___
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] Re: Warnings when upgrading Catalyst

2009-07-02 Thread Ovid

- Original Message 
 From: Tomas Doran bobtf...@bobtfish.net
 
 George Nistorica wrote:
  I've checked it out and indeed using the version of Controller::REST you
  provided fixes the warning.
  
  Not only that, but it seems it doesn't break the functionality for both
  the test application I provided and another more complex one I'm using.
 
 Great, thanks for testing.

Thanks from me, too.  This will make our test suite much quieter.

 
Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog- http://use.perl.org/~Ovid/journal/
Twitter  - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

___
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] Configuration process

2009-07-02 Thread Alejandro Imass
Why don't you just use the standard yml config file?

On Thu, Jul 2, 2009 at 1:00 PM, Frederic Demiansfrede...@demians.fr wrote:
 Hello,

 It must be a newbie question...

 I have a simple application, let say MyApp. In lib/MyApp.pm, I ask for
 standard config loading with:

  Catalyst qw/  ConfigLoader /

 I want to add config variables from another source than myapp.conf. But in
 order to construct those variables I need to access configuration variables
 loaded by ConfigLoader. But those variables are not yet loaded when I access
 them:

 myapp.conf contains:

  filepath /path/to/config.xml

 And in MyApp.pm, I have:

 __PACKAGE__-config(
speciolconf = XMLin( __PACKAGE-config-{filepath}
 );

 This issue is that __PACKAGE-config-{filepath} is not initialized.

 How can I do?

 Thanks.
 --
 Frédéric

 ___
 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] Configuration process

2009-07-02 Thread Octavian Râsnita

From: Alejandro Imass alejandro.im...@gmail.com

Why don't you just use the standard yml config file?


If I remember well, the recommended configuration file type is .conf 
(Config::General) and not .yaml. Isn't it true?


Octavian


___
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] Configuration process

2009-07-02 Thread Alejandro Imass
You are right and this is something new. I've only ported my apps to
new cat releases but haven't started one from scratch in a while.

I just tested, and sure enough, it creates a .conf file instead of the
traditional yaml file, although it says:

# rename this file to test.yml and put a : in front of name if
# you want to use yaml like in old versions of Catalyst

Guess I have to catchup to all these changes... :(


On Fri, Jul 3, 2009 at 2:47 PM, Octavian Râsnitaorasn...@gmail.com wrote:
 From: Alejandro Imass alejandro.im...@gmail.com

 Why don't you just use the standard yml config file?

 If I remember well, the recommended configuration file type is .conf
 (Config::General) and not .yaml. Isn't it true?

 Octavian


 ___
 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] Hangs in RenderView in end

2009-07-02 Thread Gunnar Strand
I found the problem. Turning on debugging for TT (DEBUG = DEBUG_ALL) in TT.pm 
showed that it hangs on the [% USE CGI %] directive. Apparently

[% USE CGI('-no_debug') %]

is needed. Got it from here:

https://bugzilla.mozilla.org/show_bug.cgi?id=137589

Seems CGI thinks that it is begin run from command line and prompts for data.


KR,
Gunnar



From: Gunnar Strand gunnarstr...@yahoo.com
To: The elegant MVC web framework catalyst@lists.scsys.co.uk
Sent: Monday, June 29, 2009 6:39:41 AM
Subject: Re: [Catalyst] Hangs in RenderView in end


 Is there any way of running the server in a debugger or to turn tracing on? 
 Can I send a signal to it to get it to dump a stack trace somehow? Any 
 attempt I've made so far just results in nothing or segmentation faults.

[...]

I don't understand why you're seeing segfaults. What version of Catalyst are 
you using, what is your perl -V, and do you have the latest version of 
Variable::Magic installed? Also, if you could attach gdb and get the catalyst 
process to segfault, then a backtrace from c land could be useful.

The debugger works now(!). I've always had problems with it but hadn't tried it 
for a while. Maybe a library got updated.

Thanks for the tips!

KR,
Gunnar

___
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/


[Catalyst] Catalyst::View::Mason and Exception objects

2009-07-02 Thread Stephen Clouse
The following Mason template:

%init
die;
/%init

results in a typical Catalyst error response.

This, on the other hand:

%init
DBIx::Class::Exception-throw('Foo');
/%init

just gives a plain-text output, and the request is recorded as a success
($c-error is not set, finalize_error is not called, plugins like
ErrorCatcher are never triggered).

The issue seems to lie here:

174if (blessed($output)  $output-isa('HTML::Mason::Exception')) {
175chomp $output;
176my $error = qq/Couldn't render component $component_path -
error was $output/;
177$c-log-error($error);
178$c-error($error);
179return 0;
180}

Since Mason does not wrap exception objects but simply re-throws them, the
exception object gets here and bypasses this.

More interesting is that this actually appears to be intentional behavior --
the View::Mason distro actually tests for it in t/exception.t.  Any ideas on
why it's handled this way and how to make it DWIM?

-- 
Stephen Clouse stephenclo...@gmail.com
___
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] Re: Warnings when upgrading Catalyst

2009-07-02 Thread Tomas Doran


On 2 Jul 2009, at 12:55, George Nistorica wrote:


It looks like I was mistaken when talking about missing actions in the
stats output, in the sense that supressing the Catalyst warning didn't
automagically make more actions to be displayed in the stats.


Righto, glad that's cleared up.

However I see that using the REST controller you provided, test_GET  
pops up.


Yup. Getting that  stuff in stats is also one of the benefits of that  
patch :)


Thanks very much for all the effort testing various things out for me.

I'll have a poke with Catalyst 5.71 some time over the weekend, work  
out why it didn't ever emit a warning, and work out the best way to  
get this fixed in core.


I _MAY_ get time to get the patch on Action-REST into a shippable  
state, but that is I'm afraid less likely - it will happen, but  
probably not for a week or so.


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] Re: Warnings when upgrading Catalyst

2009-07-02 Thread Tomas Doran


On 2 Jul 2009, at 14:03, Ovid wrote:


Thanks from me, too.  This will make our test suite much quieter.


I guess this means that was also your issue, and I can stop worrying  
about that also then? ;_)


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] Hangs in RenderView in end

2009-07-02 Thread Tomas Doran


On 2 Jul 2009, at 21:33, Gunnar Strand wrote:

I found the problem. Turning on debugging for TT (DEBUG =  
DEBUG_ALL) in TT.pm showed that it hangs on the [% USE CGI %]  
directive. Apparently


[% USE CGI('-no_debug') %]

is needed. Got it from here:

https://bugzilla.mozilla.org/show_bug.cgi?id=137589

Seems CGI thinks that it is begin run from command line and prompts  
for data.




Wow, that's a fairly unexpected gotcha.

Any chance of a doc patch to make it easier for the next poor soul  
who gets stuck on this?


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] Configuration process

2009-07-02 Thread Tomas Doran


On 3 Jul 2009, at 15:36, Alejandro Imass wrote:


You are right and this is something new. I've only ported my apps to
new cat releases but haven't started one from scratch in a while.

I just tested, and sure enough, it creates a .conf file instead of the
traditional yaml file, although it says:

# rename this file to test.yml and put a : in front of name if
# you want to use yaml like in old versions of Catalyst

Guess I have to catchup to all these changes... :(


Don't worry. A lot of people still use YAML in preference to  
Config::General style .conf.


Both are still fully supported.

The main reason that the default for generated apps was changed is  
that it's _FAR TOO EAY_ for a newbie to mess up the whitespace in  
YAML (especially when copying it out of POD sections).


This caused a large amount of confusion for people new to the  
framework, therefore we changed to Config::General as it doesn't have  
those drawbacks.


I still exclusively use YAML in my apps (as it's what I'm used to,  
and what all of work's none Catalyst stuff already used).


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] Configuration process

2009-07-02 Thread Alejandro Imass
Ok! Good to hear, I honestly prefer YAML/JSON for human-readable
serialization any day.

I just skipped through the Config::General POD and I think I'd rather
write my configs in terse Dumper than learn this yaml (pun intended)
lol


On Fri, Jul 3, 2009 at 5:33 PM, Tomas Doranbobtf...@bobtfish.net wrote:

 On 3 Jul 2009, at 15:36, Alejandro Imass wrote:

 You are right and this is something new. I've only ported my apps to
 new cat releases but haven't started one from scratch in a while.

 I just tested, and sure enough, it creates a .conf file instead of the
 traditional yaml file, although it says:

 # rename this file to test.yml and put a : in front of name if
 # you want to use yaml like in old versions of Catalyst

 Guess I have to catchup to all these changes... :(

 Don't worry. A lot of people still use YAML in preference to Config::General
 style .conf.

 Both are still fully supported.

 The main reason that the default for generated apps was changed is that it's
 _FAR TOO EAY_ for a newbie to mess up the whitespace in YAML (especially
 when copying it out of POD sections).

 This caused a large amount of confusion for people new to the framework,
 therefore we changed to Config::General as it doesn't have those drawbacks.

 I still exclusively use YAML in my apps (as it's what I'm used to, and what
 all of work's none Catalyst stuff already used).

 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/


___
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/