[Catalyst] Catalyst::Plugin::Server::XMLRPC prefix option broken under lighttpd

2006-07-19 Thread Alex Pavlovic
Hi,

Catalyst versions affected: 5.69/5.7
Server: lighttpd 1.4.11_1

For the test case assume the following:

package MyApp;
__PACKAGE__-config(
xmlrpc = {
path = 'xmlrpc',
prefix = 'xmlrpc',
show_errors = 1
}
);
...

package MyApp::Controller::XMLRPC::Session;

sub authenticate : XMLRPC {
...
}

When using myapp_server.pl script, the entry is set to 
http://localhost:3000/xmlrpc, so when call for 'session.authenticate', it 
will dispatch properly to XMLRPC::Session::authenticate sub.

However once the code executes under fastcgi and lighttpd, the dispatch only 
works when call is done with xmlrpc prefix, such 
as 'xmlrpc.session.authenticate', when the call is done 
as 'session.authenticate', it complains about not finding the method that can 
handle the request. This should work however with the correct prefix being 
set.

I noticed in Catalyst::Plugin::Server::XMLRPC::_deserialize_xml that forward 
path is being set correctly at $self-forward_path( $fwd_path ), with the 
specified prefix, so I am wondering if something else outside the plugin is 
causing the problem that's related to fcgi environment.


Thanks.


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Weird variable chop out of manually set response body

2006-07-19 Thread apv
I ran into a weird thing today (coming back to Catalyst after a long  
hiatus so I hope I'm not just being obtuse; I love all the changes  
I've found so far). Catalyst 5.7000, perl 5.8.6. Using test server.

This in MyApp::Controller::Word:

sub single : Path : Args(1) {
 my ( $self, $c, $word ) = @_;
 $c-response-body(Word: $word);
}

Called with http://host.local:3000/word/asdf

Gives: Word:

But modifying this line with a newline:
$c-response-body(Word: $word\n);

Gives the correct response: Word: asdf

So what gives? Expected behavior? If so, why? It didn't matter what  
the variable was either. Things like $c-response-body(Word:  .  
$c) would not make it to output either.


-Ashley


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] strange behaviour when controllers are being inherited

2006-07-19 Thread Alex Pavlovic
Hi,

I just found something odd when trying to inherit from a base controller. I 
attached the complete application and debug output. From the debug output you 
can clearly see that MyApp powered by Catalyst as well as other things 
appear 4 times in the output and are being duplicated. This caused some 
concern.

Please note that this only appears when running under fastcgi environment and 
lighttpd, I haven't tested the apache and standalone server does not seem to 
be affected.

My layout is as follows:

MyApp::Controller::Root
MyApp::Controller::Welcome
MyApp::Controller::Welcome::User ( inherits from MyApp::Controller::Welcome )

Versions of catalyst that I found affected: 5.69/5.7


Thank you.


MyApp.tar.gz
Description: application/tgz
[debug] Debug messages enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  0.11   |
| Catalyst::Plugin::Static::Simple  0.14 |
''

[debug] Loaded dispatcher Catalyst::Dispatcher
[debug] Loaded engine Catalyst::Engine::FastCGI
[debug] Found home /usr/home/alex/svn/node3.grid0/sites/myapp.com/MyApp
[debug] Loaded Config 
/usr/home/alex/svn/node3.grid0/sites/myapp.com/MyApp/myapp.yml
[debug] Loaded components:
.-+--.
| Class   | Type |
+-+--+
| MyApp::Controller::Root | instance |
| MyApp::Controller::Welcome
 | instance |
| MyApp::Controller::Welcome::User| instance |
'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class| Method   |
+--+--+--+
| /default | MyApp::Controller::Root  | default  |
| /end | MyApp::Controller::Root  | end  |
| /welcome/default | MyApp::Controller::Welcome   | default  |
| /welcome/user/defau- | MyApp::Controller::Welcome::User | default  |
| lt   |  |  |
'--+--+--'

[info] MyApp powered by Catalyst 5.7000



[debug] Debug messages enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  0.11   |
| Catalyst::Plugin::Static::Simple  0.14 |
''

[debug] Loaded dispatcher Catalyst::Dispatcher
[debug] Loaded engine Catalyst::Engine::FastCGI
[debug] Found home /usr/home/alex/svn/node3.grid0/sites/myapp.com/MyApp
[debug] Loaded Config 
/usr/home/alex/svn/node3.grid0/sites/myapp.com/MyApp/myapp.yml
[debug] Loaded components:
.-+--.
| Class   | Type |
+-+--+
| MyApp::Controller::Root | instance |
| MyApp::Controller::Welcome  | instance |
| MyApp::Controller::Welcome::User| instance |
'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class| Method   |
+--+--+--+
| /default | MyApp::Controller::Root  | default  |
| /end | MyApp::Controller::Root  | end  |
| /welcome/default | MyApp::Controller::Welcome   | default  |
| /welcome/user/defau- | MyApp::Controller::Welcome::User | default  |
| lt   |  |  |
'--+--+--'

[info] MyApp powered by Catalyst 5.7000
[debug] Debug messages enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  0.11   |
| Catalyst::Plugin::Static::Simple  0.14  

Re: [Catalyst] strange behaviour when controllers are being inherited

2006-07-19 Thread Alex Pavlovic
No,

Just FCGI-0.67

Thanks.

On Wednesday 19 July 2006 17:04, Matt S Trout wrote:
 Alex Pavlovic wrote:
  Hi,
 
  I just found something odd when trying to inherit from a base controller.
  I attached the complete application and debug output. From the debug
  output you can clearly see that MyApp powered by Catalyst as well as
  other things appear 4 times in the output and are being duplicated. This
  caused some concern.
 
  Please note that this only appears when running under fastcgi environment
  and lighttpd, I haven't tested the apache and standalone server does not
  seem to be affected.

 Are you using the FGCI process manager?

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] strange behaviour when controllers are being inherited

2006-07-19 Thread Matt S Trout
Alex Pavlovic wrote:
 No,

 Just FCGI-0.67

 Thanks.

 On Wednesday 19 July 2006 17:04, Matt S Trout wrote:
   
 Alex Pavlovic wrote:
 
 Hi,

 I just found something odd when trying to inherit from a base controller.
 I attached the complete application and debug output. From the debug
 output you can clearly see that MyApp powered by Catalyst as well as
 other things appear 4 times in the output and are being duplicated. This
 caused some concern.

 Please note that this only appears when running under fastcgi environment
 and lighttpd, I haven't tested the apache and standalone server does not
 seem to be affected.
   
 Are you using the FGCI process manager?
 
Try adding warn 'Starting up process id '.$$; immediately before 
__PACKAGE__-setup and see if it's getting loaded multiple times in 
different processes

-- 
 Matt S Trout   Offering custom development, consultancy and support
  Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] strange behaviour when controllers are being inherited

2006-07-19 Thread Alex Pavlovic
Hi,

Just tried it with FCGI::ProcManager 0.17 in standalone server mode. The 
problem goes away. Debug screen looks normal.

I guess for some reason this only happens when running in static mode with
builtin lighttpd proc manager. 


Thanks.

On Wednesday 19 July 2006 17:04, Matt S Trout wrote:
 Alex Pavlovic wrote:
  Hi,
 
  I just found something odd when trying to inherit from a base controller.
  I attached the complete application and debug output. From the debug
  output you can clearly see that MyApp powered by Catalyst as well as
  other things appear 4 times in the output and are being duplicated. This
  caused some concern.
 
  Please note that this only appears when running under fastcgi environment
  and lighttpd, I haven't tested the apache and standalone server does not
  seem to be affected.

 Are you using the FGCI process manager?

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] strange behaviour when controllers are being inherited

2006-07-19 Thread Alex Pavlovic
Starting up process id:23065 at lib/MyApp.pm line 33.
Starting up process id:23063 at lib/MyApp.pm line 33.
Starting up process id:23066 at lib/MyApp.pm line 33.
Starting up process id:23064 at lib/MyApp.pm line 33.


On Wednesday 19 July 2006 17:37, Matt S Trout wrote:
 warn 'Starting up process id '.$$;

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Weird variable chop out of manually set response body

2006-07-19 Thread John Napiorkowski
I tried this on my setup but didn't get the chop you've reported.  I've 
attached my controller for you to look at and see if there are any other 
differences.

I'm running this on a unix box that is fairly up to date, Cat 5.7 etc.  What's 
your underlying OS?

If you recently upgraded an application you might need to rebuild the stuff in 
scripts with 'catalyst.pl -force -scripts [your app]'

I'd try updating your local perl a bit with install Task::Catalyst and so forth 
to make sure you have all the newer versions.  Or you can run a script to force 
CPAN to update everything out of date on your local box, which has solved 
problems for me in the past (although could introduce other problems).

Try the attached controller and see if it still have the mentioned trouble.  If 
we can ID your exact setup maybe we can find someone on the list that matches 
it to try the controller as well.

let me know what you find out!  --john

- Original Message 
From: apv [EMAIL PROTECTED]
To: The framework catalyst@lists.rawmode.org
Sent: Thursday, July 20, 2006 3:52:20 AM
Subject: [Catalyst] Weird variable chop out of manually set response body

I ran into a weird thing today (coming back to Catalyst after a long  
hiatus so I hope I'm not just being obtuse; I love all the changes  
I've found so far). Catalyst 5.7000, perl 5.8.6. Using test server.

This in MyApp::Controller::Word:

sub single : Path : Args(1) {
 my ( $self, $c, $word ) = @_;
 $c-response-body(Word: $word);
}

Called with http://host.local:3000/word/asdf

Gives: Word:

But modifying this line with a newline:
$c-response-body(Word: $word\n);

Gives the correct response: Word: asdf

So what gives? Expected behavior? If so, why? It didn't matter what  
the variable was either. Things like $c-response-body(Word:  .  
$c) would not make it to output either.


-Ashley


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/




Word.pm
Description: Binary data
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst::Plugin::Server::XMLRPC prefix option broken under lighttpd

2006-07-19 Thread Alex Pavlovic
Hi,

Just an update on the situation. The prefix is broken only when your entry 
point ( path ) and prefix are the same. As shown in example sent earlier. 

This works under standalone myapp_server.pl but not under fastcgi because CGI 
engine sets the base path to $ENV{SCRIPT_NAME} in prepare_path, this in 
turn causes $location in Catalyst::Request::path to be set to this, well 
you guess what happens afterwards $path =~ s/^(\Q$location\E)?//;, a little 
bit of substitution which takes the prefix out, and causes xmlrpc method not 
to be found. 

So to cut the story short, don't use the same prefix and entry point name like 
I did and you will save yourself time debugging.


Thanks.

On Wednesday 19 July 2006 00:12, Alex Pavlovic wrote:
 Hi,

 Catalyst versions affected: 5.69/5.7
 Server: lighttpd 1.4.11_1

 For the test case assume the following:

 package MyApp;
 __PACKAGE__-config(
   xmlrpc = {
   path = 'xmlrpc',
   prefix = 'xmlrpc',
   show_errors = 1
   }
 );
 ...

 package MyApp::Controller::XMLRPC::Session;
 
 sub authenticate : XMLRPC {
   ...
 }

 When using myapp_server.pl script, the entry is set to
 http://localhost:3000/xmlrpc, so when call for 'session.authenticate', it
 will dispatch properly to XMLRPC::Session::authenticate sub.

 However once the code executes under fastcgi and lighttpd, the dispatch
 only works when call is done with xmlrpc prefix, such
 as 'xmlrpc.session.authenticate', when the call is done
 as 'session.authenticate', it complains about not finding the method that
 can handle the request. This should work however with the correct prefix
 being set.

 I noticed in Catalyst::Plugin::Server::XMLRPC::_deserialize_xml that
 forward path is being set correctly at $self-forward_path( $fwd_path ),
 with the specified prefix, so I am wondering if something else outside the
 plugin is causing the problem that's related to fcgi environment.


 Thanks.


 ___
 List: Catalyst@lists.rawmode.org
 Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
 Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/