Re: [Catalyst] Configuration of $c->log with Catalyst::Log::Log4perl
On Fri, 2008-05-09 at 10:04 +0930, Jon Schutz wrote: > On Thu, 2008-05-08 at 16:42 +0200, Jochen Luig wrote: > > > So, can anyone tell me where I should continue looking for the error? > > Can anyone think of a scenario where the logger config gets messed up > > after initial configuration? > > > > If any part of your app invokes Log::Log4perl->easy_init(), that will > break it. There was such a line of code in a SQL::Translator file at > one stage, but it has been fixed in more recent versions. > I take that back - the file in question is SQL::Translator::Schema::Graph.pm and the call to easy_init() is still there. There's a good chance this module is loaded if you are using DBIx::Class and calling deploy() from your app. Details in: http://www.mail-archive.com/[EMAIL PROTECTED]/msg03436.html -- Jon SchutzMy tech notes http://notes.jschutz.net Chief Technology Officerhttp://www.youramigo.com YourAmigo ___ 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 of $c->log with Catalyst::Log::Log4perl
On Thu, 2008-05-08 at 16:42 +0200, Jochen Luig wrote: > So, can anyone tell me where I should continue looking for the error? > Can anyone think of a scenario where the logger config gets messed up > after initial configuration? > If any part of your app invokes Log::Log4perl->easy_init(), that will break it. There was such a line of code in a SQL::Translator file at one stage, but it has been fixed in more recent versions. -- Jon SchutzMy tech notes http://notes.jschutz.net Chief Technology Officerhttp://www.youramigo.com YourAmigo ___ 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] Invalid session ids being generated
I was able to fix it by downgrading Catalyst::Plugin::Session. We were on 0.13 until I upgraded to .19 (latest) along with a bunch of other Catalyst modules. Just as a last resort before I downgraded everything back to the way it was I tried just downgrading Catalyst::Plugin::Session and it worked! Woohoo! Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 -Original Message- From: Daniel Westermann-Clark [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 2:00 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Invalid session ids being generated On 2008-05-07 17:38:12 -0500, Ryan Pack wrote: > My Catalyst app is using Session::State::Cookie, > Session::State::URI, and Session::Store::DBIC. We recently started > using the param option in Session::State::URI. We were tacking the > session id onto the base URL but now it is being included as a > parameter. Anyways, when you first make a request, a cookie is set > with a valid session_id but uri_for returns the url with a totally > different session id which doesn't even exist in the database. Please send the output of a full request cycle using the debug flag. For example, with the built-in server: DBIC_TRACE=1 ./script/*server.pl -r -d I'm not sure that using two Session::State plugins is recommended. At the very least, have you set the no_rewrite_if_cookie flag for Session::State::URI? -- Daniel Westermann-Clark ___ 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] Catalyst / dbix-class / mysql / REST job
A great idea however it's not that simple unfortunately - a lot of code has already been written - we need someone to join the team to help maintain and extend & help out on other similar projects. Mark Zbigniew Lukasiak wrote: There were a few long threads on the subject of REST CRUD in Catalyst here. Maybe you would like to crowd source a bit - and make a competition for the code pieced that you need? Inspiration: http://www.ddj.com/architect/207404123?pgno=1 Cheers, Zbigniew On Wed, May 7, 2008 at 6:52 PM, Mark Trostler <[EMAIL PROTECTED]> wrote: The job description is kinda crapy: http://jobs.perl.org/job/8624 But you can work in Sunnyvale, CA or Carslbad, CA. The backend in Catalyst/REST/DBIx::Class/MySQL. Frontends are currently command line/library using Moose and lots of AJAXy Javascript (using ExtJS - yah should be YUI ideally...). Join the team! Mark ___ 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] Invalid session ids being generated
On 2008-05-07 17:38:12 -0500, Ryan Pack wrote: > My Catalyst app is using Session::State::Cookie, > Session::State::URI, and Session::Store::DBIC. We recently started > using the param option in Session::State::URI. We were tacking the > session id onto the base URL but now it is being included as a > parameter. Anyways, when you first make a request, a cookie is set > with a valid session_id but uri_for returns the url with a totally > different session id which doesn't even exist in the database. Please send the output of a full request cycle using the debug flag. For example, with the built-in server: DBIC_TRACE=1 ./script/*server.pl -r -d I'm not sure that using two Session::State plugins is recommended. At the very least, have you set the no_rewrite_if_cookie flag for Session::State::URI? -- Daniel Westermann-Clark ___ 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] Multiple Submit Button
OK I did something like this for previous problem solution...But If anyone comes up with better solution..Please let me know overview.fb file fields: enroll: value: Enroll type: button size: 5 curriculum: value: Curriculum type: button size: 9 Overview.tt2 file [% FOREACH field IN formbuilder.fields %] [% IF field.label == 'Enroll' %] [% field.field %] [% END %] [% IF field.label == 'Curriculum' %] [% field.field %] [% END %] [% END %] -- View this message in context: http://www.nabble.com/Multiple-Submit-Button-tp17130149p17132091.html Sent from the Catalyst Web Framework mailing list archive at Nabble.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/
[Catalyst] Multiple Submit Button
Hello Gurus, So far I learnt Catalyst + FormBuilder + TT2 all by myself... When I realize use of *.fb fileIts so amazing Ok coming to the point...I have web page which contain 2 Submit Button I use overview.fb file like this submit: Enroll, Curriculum When I press Enroll Button...it should call 1 JavaScript function and For Curriculum Button ... there is another Javascript function So I defined overview.tt2 file like this == [% META title = "Overview" %] [% FOREACH field IN formbuilder.submit %] [% field %] [% END %] = I got both buttons on page...but [% field %] prints both buttons at same time..so doesn't matter i press "Enroll" or "Curriculum"Both redirects to same page... So i Need VALUE of Submit Buttonsomething like this . [% formbuilder.submit.value %] or I have to define overview.fb file like this. fields: enroll: value: Enroll type: button curriculum: value: Curriculum type: button Any IDEA..How can I get value of both buttons so i can redirect to different page Thanks in Advance -- View this message in context: http://www.nabble.com/Multiple-Submit-Button-tp17130149p17130149.html Sent from the Catalyst Web Framework mailing list archive at Nabble.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] Invalid session ids being generated
Ok, I think I have enough information to explain the problem better. When a request is made to the app a session id is created in the db but there is no session data and the expires field is null. The cookie is set with that session id. When you make a subsequent request, the error below is logged and the first session id is deleted automatically. A new session id is created and this time session data is populated as well as expires. A new cookie is set with the good session id and all is well. I am going to dig into why the first session created is invalid, but I'm rather new to Catalyst and I can use any suggestions you can offer. Thanks! Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 From: Ryan Pack [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 9:25 PM To: The elegant MVC web framework Subject: RE: [Catalyst] Invalid session ids being generated I forgot to include the error in the log: FastCGI: server "/u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl" stderr: [error] Caught exception in engine "DBIx::Class::Relationship::CascadeActions::update(): Can't update BookingEngine::Model::DBIC::BE::Session=HASH(0xd3f2620): row not found at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Plugin/Session/Store/DBIC/Delega te.pm line 85" Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 From: Ryan Pack [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 5:38 PM To: catalyst@lists.scsys.co.uk Subject: [Catalyst] Invalid session ids being generated My Catalyst app is using Session::State::Cookie, Session::State::URI, and Session::Store::DBIC. We recently started using the param option in Session::State::URI. We were tacking the session id onto the base URL but now it is being included as a parameter. Anyways, when you first make a request, a cookie is set with a valid session_id but uri_for returns the url with a totally different session id which doesn't even exist in the database. We are including the uri_for generated url for form actions and links, etc. in our templates in case cookies are disabled. Has anyone seen this before? Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 ___ 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 of $c->log with Catalyst::Log::Log4perl
Jochen Luig wrote: log4perl.appender.SCREEN.layout=PatternLayout How about changing PatternLayout to Log::Log4perl::Layout::PatternLayout? (sorry, I have no real knowledge about these modules, I only compare with what I have working at my end). Marius K. ___ 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 of $c->log with Catalyst::Log::Log4perl
Marius Kjeldahl schrieb: Not sure if it changes anything, but does changing rootLogger to logger help? No, it neither changes the behaviour of the App's logger, nor did it break the Test App's logger. In fact, I'd be surprised if it had to do with the config as it already works as expected in the Test App. Jochen ___ 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 of $c->log with Catalyst::Log::Log4perl
Jochen Luig wrote: This is myapp_logger.conf: log4perl.rootLogger=DEBUG, SCREEN Not sure if it changes anything, but does changing rootLogger to logger help? Sincerely, Marius K. ___ 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] Configuration of $c->log with Catalyst::Log::Log4perl
Hi, I'm trying to replace Catalyst's default logger with Catalyst::Log::Log4perl. Here's the relevant part of MyApp.pm: package MyApp; use strict; use warnings; use Catalyst::Runtime '5.70'; use Catalyst::Log::Log4perl; use Catalyst qw/ -Debug ConfigLoader Static::Simple StackTrace Authentication Authentication::Store::DBIC Authentication::Credential::Password Authorization::Roles Authorization::ACL Session Session::Store::FastMmap Session::State::Cookie FormValidator FillInForm I18N Unicode Email /; use Sys::Hostname; our $VERSION = '0.01'; __PACKAGE__->config( name => 'MyApp' ); __PACKAGE__->log( Catalyst::Log::Log4perl->new('myapp_logger.conf')); __PACKAGE__->setup; This is myapp_logger.conf: log4perl.rootLogger=DEBUG, SCREEN log4perl.appender.SCREEN=Log::Log4perl::Appender::Screen log4perl.appender.SCREEN.mode=append log4perl.appender.SCREEN.layout=PatternLayout log4perl.appender.SCREEN.layout.ConversionPattern=[%d] %C <%p> - %m%n After starting, the Conversion Pattern the logger actually uses looks like: %d Trying to find a minimal App producing the problem, I set up a Test Application and provided the same config file. There the logger works as expected. Next I went through the logger configuration in the debugger with both Apps up to: Log::Log4perl::Config::BaseConfigurator::text(/usr/lib/perl5/vendor_perl/5.8.8/Log/Log4perl/Config/BaseConfigurator.pm:29): 29: $self->{text} = $text; there I dumped $text which contained an array ref containing the lines of the above cited config file (I saved both dumps to files, and diff told me they were the same except for the numeric parts of the array refs). Thus I think I can be quite sure that the logger is initialized with the same config in both Apps. Still, my original App comes up with the "%d" ConversionPattern. So, can anyone tell me where I should continue looking for the error? Can anyone think of a scenario where the logger config gets messed up after initial configuration? Thanks, Jochen ___ 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: $row->copy causing exit from controller(!)
On Thu, May 1, 2008 at 11:31 AM, Paul Makepeace <[EMAIL PROTECTED]> wrote: > I'm seeing something exceedingly odd: copying data causing a premature > return from the controller, like a detach(), > > foreach my $table (@chart_related_tables) { > my $rs = $ds->resultset($table); > warn "copying $table for ", $new_chart->uid; > for my $row ($rs->search({web_chart_spec_uid => $chart->uid})) { > warn "..row ", $row->web_chart_spec_uid, $row; > $row->copy({web_chart_spec_uid => $new_chart->uid}); # XXX > } > #$_->copy({web_chart_spec_uid => $new_chart->uid}) > #for $rs->search({web_chart_spec_uid => $chart->uid}); > die "cloned", $new_chart->uid; > } > > There's no further execution past the line marked XXX: the template is > rendered from that point on. The die is never called. > > I have a feeling it's something to do with has_many > > Chart: > __PACKAGE__->has_many(chartview_company => 'IDL::Schema::ChartCompany' > => 'web_chart_spec_uid', {cascade_delete => 0}); > > If I exclude from @chart_related_tables ChartCompany it works. I had the stroke of intuition to wrap the call to copy() in an "eval {}; warn @$ if $@;" and saw what is going on. It seems like the copy() is not just copying the row but other rows as well, which is in turn causing duplicate key errors, in particular the rels mentioned above that have has_many. The controller at least completes now. (Why an error like this would bypass the exception handler is a mystery and presumably a bug.) There's a series of BEGIN/COMMIT/ROLLBACK lines coming out of somewhere in the FastCGI screen too, FWIW. http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Row.pm#copy doesn't give any hint that multiple rows would be inserted. Does this sound plausible? Sorry I haven't got more debug, I'm squeezing this into occasional spare minutes here and there. If there's something specific I can try or provide, let me know. Unfortunately getting the fastcgi working with perl -d isn't likely any time soon. I don't think it's there in any case; it feels more DBIx::Class related. P > > ** > > I realize there's scads of debug I could provide but wanted to check > first this wasn't something someone had run into before. If not, what > kind of debug can I provide? > > DBIC $VERSION = '0.08009'; > Catalyst 5.7012 > > Paul > ___ 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/