Discussion:
[jifty-devel] Mysterious Dispatcher / Jifty::View::Declare vanishing templates
Peter Mottram
2010-06-11 17:31:40 UTC
Permalink
I have an amazing problem with my current app where parts of my app's view
seem to mysteriously disappear. When checking the app all of a sudden some
parts of the view stop being dispatched (dispatcher ends up calling
/errors/404 without noticing the relevant 'on' rule). On restarting jifty
the missing parts reappear but then other parts of the view vanish. The
whole thing appears to be completely random and I am running out of ideas
as to how to debug further.

Could anyone point me to a relevant Jifty->foo piece of magic that I could
examine during dispatching to see what the dispatcher thinks exists within
my view? Any other ideas about bits of Jifty internals I should be hacking
around in to solve this?

I'm using Jifty::Plugin::ViewDeclarePage quite heavily - couldn't face
dropping that but with current issues am seriously considering dropping
back to Mason completely :-(

btw I'm on Jifty version 0.91117 from CPAN.

TIA
PeteM
Thomas Sibley
2010-06-11 18:32:06 UTC
Permalink
Hi Peter,

I'd suggest upgrading to a version of Jifty checked out from Git. We
don't make releases as often as we'd like, and it's been a while since
November 2009. You'll also want to upgrade Template::Declare.

Otherwise, set LogLevel to DEBUG and install and enable the
DumpDispatcher plugin in your app's etc/config.yml. That'll spew more
information about the dispatcher when you run "jifty server".

We use TD very successfully for quite a few apps here, so it's unlikely
to be a fundamental issue with TD.

Cheers,
Thomas
Post by Peter Mottram
I have an amazing problem with my current app where parts of my app's
view seem to mysteriously disappear. When checking the app all of a
sudden some parts of the view stop being dispatched (dispatcher ends up
calling /errors/404 without noticing the relevant 'on' rule). On
restarting jifty the missing parts reappear but then other parts of the
view vanish. The whole thing appears to be completely random and I am
running out of ideas as to how to debug further.
Could anyone point me to a relevant Jifty->foo piece of magic that I
could examine during dispatching to see what the dispatcher thinks
exists within my view? Any other ideas about bits of Jifty internals I
should be hacking around in to solve this?
I'm using Jifty::Plugin::ViewDeclarePage quite heavily - couldn't face
dropping that but with current issues am seriously considering dropping
back to Mason completely :-(
btw I'm on Jifty version 0.91117 from CPAN.
TIA
PeteM
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
Peter Mottram
2010-06-14 12:55:24 UTC
Permalink
Jifty, Jifty::DBI and TD now all as of git on 11/6 and still have my weird
errors. DumpDispatcher shows the dispatch table correctly when called from
a before rule but the rule that should be triggered (which logs as its
first action) is not called. Here is some debug output:

2010/06/14 14:45:47 DEBUG> Dispatcher.pm:873 Jifty::Dispatcher::_do_dispatch - Dispatching request to /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:648 Jifty::Dispatcher::_do_before - Matched 'before' rule (?-xism:(?<=\A/)([^/]*)(?=/|\z)) for /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:648 Jifty::Dispatcher::_do_before - Matched 'before' rule (?-xism:(?<=\A/)([^/]*)(?=/|\z)) for /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> DumpDispatcher.pm:38 Jifty::Plugin::DumpDispatcher::dump_rules - Dispatcher rules in stage SETUP:
<snip/>
2010/06/14 14:45:47 DEBUG> DumpDispatcher.pm:39 Jifty::Plugin::DumpDispatcher::dump_rules - under 'course' on 'tec' run {...} on 'flowchart' run {...} on '*' run {...}
<snip/>
2010/06/14 14:45:47 DEBUG> DumpDispatcher.pm:38 Jifty::Plugin::DumpDispatcher::dump_rules - Dispatcher rules in stage CLEANUP:
2010/06/14 14:45:47 DEBUG> Web.pm:981 Jifty::Web::render_template - Showing path /errors/404 using Jifty::View::Declare::Handler

All looks fine to me but the required rule is not called since its info
log output doesn't appear in the log output above. I can get different
parts of my app to 'disappear' depending on the order that I go through
the site.

Any hints as to whereabouts in Jifty core I should start inserting more
debug logging?

TIA
PeteM
I'd suggest upgrading to a version of Jifty checked out from Git. We don't
make releases as often as we'd like, and it's been a while since November
2009. You'll also want to upgrade Template::Declare.
Otherwise, set LogLevel to DEBUG and install and enable the DumpDispatcher
plugin in your app's etc/config.yml. That'll spew more information about the
dispatcher when you run "jifty server".
We use TD very successfully for quite a few apps here, so it's unlikely to be
a fundamental issue with TD.
Cheers,
Thomas
On 06/11/2010 01:31 PM, Peter Mottram wrote:>> I have an amazing problem with my current app where parts of my app's
Post by Peter Mottram
view seem to mysteriously disappear. When checking the app all of a
sudden some parts of the view stop being dispatched (dispatcher ends up
calling /errors/404 without noticing the relevant 'on' rule). On
restarting jifty the missing parts reappear but then other parts of the
view vanish. The whole thing appears to be completely random and I am
running out of ideas as to how to debug further.
Could anyone point me to a relevant Jifty->foo piece of magic that I
could examine during dispatching to see what the dispatcher thinks
exists within my view? Any other ideas about bits of Jifty internals I
should be hacking around in to solve this?
I'm using Jifty::Plugin::ViewDeclarePage quite heavily - couldn't face
dropping that but with current issues am seriously considering dropping
back to Mason completely :-(
btw I'm on Jifty version 0.91117 from CPAN.
TIA
PeteM
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
Jesse Vincent
2010-06-14 16:38:35 UTC
Permalink
Post by Peter Mottram
Jifty, Jifty::DBI and TD now all as of git on 11/6 and still have my
weird errors. DumpDispatcher shows the dispatch table correctly when
called from a before rule but the rule that should be triggered
(which logs as its first action) is not called. Here is some debug
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:873 Jifty::Dispatcher::_do_dispatch - Dispatching request to /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:648 Jifty::Dispatcher::_do_before - Matched 'before' rule (?-xism:(?<=\A/)([^/]*)(?=/|\z)) for /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:648 Jifty::Dispatcher::_do_before - Matched 'before' rule (?-xism:(?<=\A/)([^/]*)(?=/|\z)) for /course/Emergency_First_Response
<snip/>
2010/06/14 14:45:47 DEBUG> DumpDispatcher.pm:39 Jifty::Plugin::DumpDispatcher::dump_rules - under 'course' on 'tec' run {...} on 'flowchart' run {...} on '*' run {...}
<snip/>
2010/06/14 14:45:47 DEBUG> Web.pm:981 Jifty::Web::render_template - Showing path /errors/404 using Jifty::View::Declare::Handler
All looks fine to me but the required rule is not called since its
info log output doesn't appear in the log output above. I can get
different parts of my app to 'disappear' depending on the order that
I go through the site.
Any hints as to whereabouts in Jifty core I should start inserting
more debug logging?
Are you up for posting your dispatcher somewhere?
Peter Mottram
2010-06-14 17:25:12 UTC
Permalink
Post by Jesse Vincent
Post by Peter Mottram
Jifty, Jifty::DBI and TD now all as of git on 11/6 and still have my
weird errors. DumpDispatcher shows the dispatch table correctly when
called from a before rule but the rule that should be triggered
(which logs as its first action) is not called. Here is some debug
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:873 Jifty::Dispatcher::_do_dispatch - Dispatching request to /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:648 Jifty::Dispatcher::_do_before - Matched 'before' rule (?-xism:(?<=\A/)([^/]*)(?=/|\z)) for /course/Emergency_First_Response
2010/06/14 14:45:47 DEBUG> Dispatcher.pm:648 Jifty::Dispatcher::_do_before - Matched 'before' rule (?-xism:(?<=\A/)([^/]*)(?=/|\z)) for /course/Emergency_First_Response
<snip/>
2010/06/14 14:45:47 DEBUG> DumpDispatcher.pm:39 Jifty::Plugin::DumpDispatcher::dump_rules - under 'course' on 'tec' run {...} on 'flowchart' run {...} on '*' run {...}
<snip/>
2010/06/14 14:45:47 DEBUG> Web.pm:981 Jifty::Web::render_template - Showing path /errors/404 using Jifty::View::Declare::Handler
All looks fine to me but the required rule is not called since its
info log output doesn't appear in the log output above. I can get
different parts of my app to 'disappear' depending on the order that
I go through the site.
Any hints as to whereabouts in Jifty core I should start inserting
more debug logging?
Are you up for posting your dispatcher somewhere?
It's a work in progress (in the middle of transitioning from Mason to TD):

http://www.nl.petescaff.com/Dispatcher.pm

Not a massive beast.

Cheers
PeteM
Alex Vandiver
2010-06-14 17:20:07 UTC
Permalink
Post by Peter Mottram
All looks fine to me but the required rule is not called since its info
log output doesn't appear in the log output above. I can get different
parts of my app to 'disappear' depending on the order that I go through
the site.
Check the "package" declarations at the top of your template files?
This could be consistent with DevelMode reloading your files, and having
a copy-and-paste error in the "package" lines, leading to your templates
getting stuffed into the wrong namespace.
- Alex
Peter Mottram
2010-06-14 17:29:26 UTC
Permalink
I restart the jifty server after every change and my TD packages look
clean (to me anyway) ...

$ grep -H View View.pm
View.pm:DiveMalta::View - TD view declarations
View.pm:package DiveMalta::View;
View.pm:use Jifty::View::Declare -base;
View.pm:require DiveMalta::View::Admin;
View.pm:alias DiveMalta::View::Admin under '/admin/';
View.pm:require DiveMalta::View::Course;
View.pm:alias DiveMalta::View::Course under '/course';
View.pm:require DiveMalta::View::Divesite;
View.pm:alias DiveMalta::View::Divesite under '/divesite';
View.pm:require DiveMalta::View::Gallery;
View.pm:alias DiveMalta::View::Gallery under '/gallery';

$ grep -H View *
Admin.pm:package DiveMalta::View::Admin;
Admin.pm:use Jifty::View::Declare -base;
Course.pm:package DiveMalta::View::Course;
Course.pm:use Jifty::View::Declare -base;
Divesite.pm:package DiveMalta::View::Divesite;
Divesite.pm:use Jifty::View::Declare -base;
Gallery.pm:package DiveMalta::View::Gallery;
Gallery.pm:use Jifty::View::Declare -base;
Page.pm:package DiveMalta::View::Page;
Page.pm:use base qw(Jifty::Plugin::ViewDeclarePage::Page);
Page.pm:use Jifty::View::Declare::Helpers;
Post by Alex Vandiver
Post by Peter Mottram
All looks fine to me but the required rule is not called since its info
log output doesn't appear in the log output above. I can get different
parts of my app to 'disappear' depending on the order that I go through
the site.
Check the "package" declarations at the top of your template files?
This could be consistent with DevelMode reloading your files, and having
a copy-and-paste error in the "package" lines, leading to your templates
getting stuffed into the wrong namespace.
- Alex
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
Loading...