[Dancer-users] Strange errors while running multiple dancer apps with mount

Gurunandan Bhat gbhat at pobox.com
Thu May 31 23:17:14 CEST 2012


I have 2 applications that work fine when run individually. One uses
sessions (Storable) and the other does not use sessions at all.

When mounted as recommended in
Dancer::Deployment<https://metacpan.org/module/Dancer::Deployment#Running-multiple-apps-with-Plack::Builder>
however,
I get strange errors depending on the sequence that I visit the two
applications. app1 does not use sessions and app2 uses sessions (Storable)

My app.psgi can be viewed here: http://pastie.org/4004017

Here is what I find:


   1. When I visit http://localhost:5000/app1 first and then
   http://localhost:5000/app2. app2 dies with an error: "core - Must
   specify session engine in settings prior to using 'session' keyword at...".
   The Settings section in the Debug panel shows no session related settings
   even though they are present in config.yml
   2. When I visit http://localhost:5000/app2 and then
   http://localhost:5000/app1, app2 dies again but with a different error:
   "core - template - file error - signin_header.tt: not found at...".
   signin_header.tt is used in the index template using [% INCLUDE....%]
   directive of TT. This time, the session related settings are correctly
   displayed in the debug panel
   3. When I visit app2, then app1, then back to app2, I get the session
   error described in item 1.
   4. Sometimes, and this is random, app2 (the one that uses sessions) also
   loses the value of the database configuration parameters (I use
   Dancer::Plugin::Database) giving me a "...database not defined..." error.
   But this is once in about 8-10 visits. Situations 1, 2 and 3 however play
   out each time.


It appears to me that if two apps one using sessions and the other not,
then visiting the application that does not use sessions somehow deletes
the session settings of the other application.

I can easily fix the error in item 2 (template not found..) by giving the
full path of the template, but I would lose the very advantage that makes
hosting multiple apps *without making any change* to their configuration so
attractive.

I have tried to debug this for a few days and am unable to figure this.
Would really appreciate some help/pointers here.


Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20120531/6394375d/attachment.htm>


More information about the Dancer-users mailing list