[Catalyst-dev] Tutorial Fails under Apache Mod_Perl

Carl Franks carl at fireartist.com
Thu Dec 5 22:04:09 GMT 2013

It sounds like the app's no longer running in a distribution directory
(containing a Makefile.PL)
see the docs for the "-HOME" switch for how to handle this:

On 5 December 2013 20:11, William Anderson <william_anderson at yahoo.com> wrote:
> Hi all,
> I found the cause of my problems.
> While chasing down the bug into
> Catalyst::Authentication::Credential::Password,
> I find that this creates a user object via
> $realm->find_user($userfindauthinfo, $c);
> this is a Catalyst::Authentication::Realm::SimpleDB, with a hashref appened
> to it. The object is returned if a matching user is found, and undef is
> returned if no matching user is found.
> Note that while doing this, I first logged out of the test site with port
> 3000,
> and logged back in successfully. I then reloaded the root url for the
> "production" site at port 80, and found that I was logged in. I then went to
> the
> /books/list page, and was rewarded with a different crash:
>     DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed:
>     DBI connect('myapp.db','',...) failed: unable to open database file
>     at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1395. at
>     /home/onestopw/lib/MyApp/Controller/Books.pm line 44
> Ah Ha!! The root of my problem is the PWD value, and the location where
> the application will look for the files that it is supposed to use. The
> script myapp_server.pl inherits the PWD from the shell it is run from.
> And its that simple!!! apache mod_perl has a different PWD value, and it was
> not
> finding the database file. Rather then crashing outright when this error
> occurs
> the Catalyst MyApp ran until the model objects tried to access the database
> and, because the file could not be found, crashing in wierd and hard to
> debug ways.
> To fix, simply specify the full file system path to the myapp.db file. This
> is likely to be a problem with ALL filesystem objects that the application
> wants to use.
> This simple, stupid, problem could be avoided if, during startup Catalyst
> checks to see if we can actually see, open, touch the database (file or
> server), and if not, fail in some way that makes it obvious that it can not
> see the database. Actually, I would go so far to say that this is a bug and
> that this should  be fixed it Catalyst.
> Anyway, I love open source sofware because I can dig in and fix problems
> like this without calling the vendor's technical support.
> Thank You,
> William
> ________________________________
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

More information about the Catalyst-dev mailing list