manne has asked for the wisdom of the Perl Monks concerning the following question:

Hi perl greats, I am trying to run a catalyst application and i am getting an error like this : Error: Couldn't load class (App::Cinema) because: Create of share file /tmp/app/cinema/session_data failed: Permission denied at /export/home/cpantest/perl5/lib/site_perl/5.10.1/i86pc-solaris-64int/Cache/FastMmap.pm line 629. # Compilation failed in require at /export/home/cpantest/perl5/lib/site_perl/5.10.1/i86pc-solaris-64int/Class/MOP.pm line 101. The debug information has not helped me...i would like to know if anyone developing in catalyst has ever encountered such an error and how one can solve this. Thanking you Best Regards Manne

Replies are listed 'Best First'.
Re: Catalyst error
by Your Mother (Archbishop) on Dec 04, 2010 at 02:01 UTC

    This is an issue which you'll typically hit when you run the test server as one user and then a production server (or the test server for that matter) as another user. You end up with session files owned by you and then production app wants to use www or nobody or whatever to overwrite them and can't.

    The obvious ways to deal with it are to only run the dev server as the production user: sudo -u nobody ./script/*_server.pl -rr -d -p 3000 or to add something like this to your cache/session config:

    __PACKAGE__->config( "Plugin::Session" => { store => "FastMmap", storage => __PACKAGE__->path_to("run/$>/session.dat"), ...

    (Update: corrected sentence conjunction.)

      Infact,there was a change of users when running the test servers which caused this error. Thankyou for the useful suggestion.
Re: Catalyst error
by roboticus (Chancellor) on Dec 04, 2010 at 00:28 UTC

    manne:

    Well, the error clearly tells you that the problem is a permissions problem during file creation. So either you--or the account running your script---doesn't appear to have permissions to the /tmp/app/cinema directory. So I'd suggest:

    1. Getting the permissions set to allow your application to use that directory, or
    2. reconfiguring Catalyst (I don't know how, I don't use it) to use a directory that you do have permissions for.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Hi roboticus, The testing server was running from different users and ther is a permissions problem. Thankyou for the suggestion and as 'your mother' said it was session problem with the users.