Re: [Catalyst] Session unexpectedly expiring
Hi, Jeff Chimene wrote: More breadcrumbs. The directory is getting created, but session_data isn't getting created. I have similar problem... The symptom is that the directory is created with the wrong user (root). Each time I reboot the server I have to manually « chown www-data:www-data » the directory (don't remember its name). As you may have guessed, for the moment the directory is in /tmp (which content is deleted at each reboot). I don't care I am not in prod but I think if you specially create a dir somewhere else in your FS with good owner and configure Session to use it, everything should be OK. Maybe it's not the same bug (is it a bug?). My 2p. Regards, -- -- \^/-- ---/ O \----- -- | |/ \| Alexandre (Midnite) Jousset | -- ---|___|----- ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl The desired cycle is to login then redirect to another controller. When I run the standalone server, the session state is recovered, and control resumes with the next controller. When I run using Apache the script/xxx_cgi.pl, the session state is marked expired and control returns to the login controller. I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. Thanks for your support! Cheers, jec More breadcrumbs. The directory is getting created, but session_data isn't getting created. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl The desired cycle is to login then redirect to another controller. When I run the standalone server, the session state is recovered, and control resumes with the next controller. When I run using Apache the script/xxx_cgi.pl, the session state is marked expired and control returns to the login controller. I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. Thanks for your support! Cheers, jec The issue was that I had removed 'libcache-fastmmap-perl' (Debian Etch) and installed the version from CPAN. The pure CPAN version doesn't play well on Debian. I removed the CPAN version of File::CacheMmap, installed the Debian Etch version, and Apache created the session_data file. I'll contact the Debian maintainer and see if there's any interest in explaining the discrepancy. FWIW, I'm not thrilled w/ Debianized Perl modules; I've been attempting to migrate away from Debianized Perl to CPAN only. There may be some inherent limitations in that approach. Cheers, jec ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl The desired cycle is to login then redirect to another controller. When I run the standalone server, the session state is recovered, and control resumes with the next controller. When I run using Apache the script/xxx_cgi.pl, the session state is marked expired and control returns to the login controller. I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. Thanks for your support! Cheers, jec This has something to do w/ the implementation of the auto method in Root.pm There's some extra stuff I added to support returning to the requested URI after login. Nevertheless, it works from script/aic_server.pl, but not from Apache. Anyway, I disabled the routine and received goodness from Apache. sub auto : Private { my ($self, $c) = @_; if ($c-controller eq $c-controller('Login')) { return 1; } # If a user doesn't exist, force login $c-session-{after_login} = ''; if (!$c-user_exists) { $c-log-debug('***Root::auto User not found, forwarding to /login') if $c-debug; # make sure we return here after a successful login $c-session-{after_login} = $c-request-uri() unless ($c-request-uri() eq $c-request-base()); $c-detach('aic::Controller::Login', 'index'); } # User found, so return 1 to continue with processing after this 'auto' return 1; } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
Jeff Chimene [EMAIL PROTECTED] wrote on 05/20/2007 10:13:33 PM: Thomas L. Shinnick wrote: At 08:20 PM 5/20/2007, Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl [snip] I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. I've not used it, I'm guessing, and I'm an idiot, but isn't this likely permissions problems, between running standalone vs. running under Apache? Any chance the backing storage file is not available to Apache processes? Peeking at the docs: storage Specifies the file to be used for the sharing of session data. ... Note that the file will be created with mode 0640, which means that it will only be writeable by processes running with the same uid as the process that creates the file. Try deleting the backing file before re-running under Apache? Good catch. Apache (or script/aic_server.pl) refuses to honor a request if the working storage file created by the other HTTP server exists. I couldn't even get started w/o a preliminary sudo rm -r /tmp/aic So, although that's /a/ problem, it's not /the/ problem. Without more info (you will post the info Matt asked for?) this still seems like the best candidate for the issue. If you are running on Linux and have selinux turned on, another common issue is that your policy does not allow promiscuous writes from apache. You may verify this is or is not the issue by running audit2why /var/log/audit/audit.log (or wherever your se auditlog is located) and noting any blocks that are happening via your web server process. Also you may want to force the directory for the session stuffs to a sane location ( don't know if you are or not -- you will post the info that Matt asked for?). -Wade ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
Not really related to your issue specifically, but I have seen issues with using Session::Store::FastMmap and perl ithreads resulting in unrelated sessions appearing to terminate when a thread 'joins' back to the parent. I think is has something to do with ithreads interaction with shared memory. My fix was to not use shared memory :-) On Mon, May 21, 2007 at 08:52:16AM -0700, Jeff Chimene wrote: Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl The desired cycle is to login then redirect to another controller. When I run the standalone server, the session state is recovered, and control resumes with the next controller. When I run using Apache the script/xxx_cgi.pl, the session state is marked expired and control returns to the login controller. I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. Thanks for your support! Cheers, jec This has something to do w/ the implementation of the auto method in Root.pm There's some extra stuff I added to support returning to the requested URI after login. Nevertheless, it works from script/aic_server.pl, but not from Apache. Anyway, I disabled the routine and received goodness from Apache. sub auto : Private { my ($self, $c) = @_; if ($c-controller eq $c-controller('Login')) { return 1; } # If a user doesn't exist, force login $c-session-{after_login} = ''; if (!$c-user_exists) { $c-log-debug('***Root::auto User not found, forwarding to /login') if $c-debug; # make sure we return here after a successful login $c-session-{after_login} = $c-request-uri() unless ($c-request-uri() eq $c-request-base()); $c-detach('aic::Controller::Login', 'index'); } # User found, so return 1 to continue with processing after this 'auto' return 1; } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- James R. Leu [EMAIL PROTECTED] pgptV89UZLfiG.pgp Description: PGP signature ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
[EMAIL PROTECTED] wrote: Jeff Chimene [EMAIL PROTECTED] wrote on 05/20/2007 10:13:33 PM: Thomas L. Shinnick wrote: At 08:20 PM 5/20/2007, Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl [snip] I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. I've not used it, I'm guessing, and I'm an idiot, but isn't this likely permissions problems, between running standalone vs. running under Apache? Any chance the backing storage file is not available to Apache processes? Peeking at the docs: storage Specifies the file to be used for the sharing of session data. ... Note that the file will be created with mode 0640, which means that it will only be writeable by processes running with the same uid as the process that creates the file. Try deleting the backing file before re-running under Apache? Good catch. Apache (or script/aic_server.pl) refuses to honor a request if the working storage file created by the other HTTP server exists. I couldn't even get started w/o a preliminary sudo rm -r /tmp/aic So, although that's /a/ problem, it's not /the/ problem. Without more info (you will post the info Matt asked for?) Posted yesterday: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05448.html this still seems like the best candidate for the issue. Ibid. This isn't the problem If you are running on Linux and have selinux turned on, another common issue is that your policy does not allow promiscuous writes from apache. Debian Etch You may verify this is or is not the issue by running audit2why /var/log/audit/audit.log (or wherever your se auditlog is located) and noting any blocks that are happening via yourweb server process. Also you may want to force the directory for the session stuffs to a sane location ( don't know if you are or not -- you will post the info that Matt asked for?). Ibid. I've posted this A.M. w/r/t disabling auto() in Root.pm: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html Cheers,. jec ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
James R. Leu wrote: Not really related to your issue specifically, but I have seen issues with using Session::Store::FastMmap and perl ithreads resulting in unrelated sessions appearing to terminate when a thread 'joins' back to the parent. I think is has something to do with ithreads interaction with shared memory. My fix was to not use shared memory :-) OK, but this is a development machine, and I'm the only user. AFAIK, I'm not using ithreads. As I mentioned, disabling the auto() method in Root.pm seems to have solved the issue: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html Cheers, jec On Mon, May 21, 2007 at 08:52:16AM -0700, Jeff Chimene wrote: Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl The desired cycle is to login then redirect to another controller. When I run the standalone server, the session state is recovered, and control resumes with the next controller. When I run using Apache the script/xxx_cgi.pl, the session state is marked expired and control returns to the login controller. I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. Thanks for your support! Cheers, jec This has something to do w/ the implementation of the auto method in Root.pm There's some extra stuff I added to support returning to the requested URI after login. Nevertheless, it works from script/aic_server.pl, but not from Apache. Anyway, I disabled the routine and received goodness from Apache. sub auto : Private { my ($self, $c) = @_; if ($c-controller eq $c-controller('Login')) { return 1; } # If a user doesn't exist, force login $c-session-{after_login} = ''; if (!$c-user_exists) { $c-log-debug('***Root::auto User not found, forwarding to /login') if $c-debug; # make sure we return here after a successful login $c-session-{after_login} = $c-request-uri() unless ($c-request-uri() eq $c-request-base()); $c-detach('aic::Controller::Login', 'index'); } # User found, so return 1 to continue with processing after this 'auto' return 1; } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Session unexpectedly expiring
Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl The desired cycle is to login then redirect to another controller. When I run the standalone server, the session state is recovered, and control resumes with the next controller. When I run using Apache the script/xxx_cgi.pl, the session state is marked expired and control returns to the login controller. I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. Thanks for your support! Cheers, jec ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
On Sun, May 20, 2007 at 06:20:23PM -0700, Jeff Chimene wrote: Thanks for your support! This isn't support, this is heckling with the occasional suggestion. Support is what your management pays us for if the heckling gets too much :) But anyway, could you show your configs, tell us whether it's the same machine and provide fragments of your debug logs please? -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
At 08:20 PM 5/20/2007, Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl [snip] I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. I've not used it, I'm guessing, and I'm an idiot, but isn't this likely permissions problems, between running standalone vs. running under Apache? Any chance the backing storage file is not available to Apache processes? Peeking at the docs: storage Specifies the file to be used for the sharing of session data. ... Note that the file will be created with mode 0640, which means that it will only be writeable by processes running with the same uid as the process that creates the file. Try deleting the backing file before re-running under Apache? ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Session unexpectedly expiring
Matt S Trout wrote: On Sun, May 20, 2007 at 06:20:23PM -0700, Jeff Chimene wrote: Thanks for your support! This isn't support, this is heckling with the occasional suggestion. Support is what your management pays us for if the heckling gets too much :) /me tries to avoid athletic supporter analogies ;-} But anyway, could you show your configs, tell us whether it's the same machine and provide fragments of your debug logs please? Same machine. I don't know what the attachment or HTML rules are for this list. I'm guessing the following logs will wrap... I'm not sure what the configs can provide, but from the lib/aic.pm: __PACKAGE__-config( name = 'aic' , static = { include_path = [ '/usr/local' , __PACKAGE__-config-{root} ] , ignore_extensions = [ qw/tmpl tt tt2/ ); I couldn't figure out how to put the __PACKAGE__ reference into YAML syntax. There is also a YAML file: --- name: aic static: no_logs: 0 imgdir: /var/www/httpdocs/images Model::inspect: schema_class: aic::inspect connect_info: - dbi:mysql:database - theUsername - thePassword authentication: rdbo: user_class: aicDB::Access user_field: username password_field: password authorization: rdbo: role_rel: roles role_field: role - Same machine. Here is the log when using script/aic_server.pl: $ script/aic_server.pl [debug] Debug messages enabled [debug] Loaded plugins: .. | Catalyst::Plugin::Authentication 0.09 | | Catalyst::Plugin::Authentication::Credential::Password | | Catalyst::Plugin::Authentication::Store::RDBO 0.002 | | Catalyst::Plugin::Authorization::ACL 0.08 | | Catalyst::Plugin::Authorization::Roles 0.05 | | Catalyst::Plugin::ConfigLoader 0.14 | | Catalyst::Plugin::Session 0.14| | Catalyst::Plugin::Session::State::Cookie 0.07 | | Catalyst::Plugin::Session::Store::FastMmap 0.02 | | Catalyst::Plugin::StackTrace 0.06 | | Catalyst::Plugin::Static::Simple 0.17 | '' [debug] Loaded dispatcher Catalyst::Dispatcher [debug] Loaded engine Catalyst::Engine::HTTP [debug] Found home /home/jchimene/aic [debug] Loaded Config /home/jchimene/aic/aic.yml [debug] Loaded components: .-+--. | Class | Type | +-+--+ | aic::Controller::Editor | instance | | aic::Controller::Login | instance | | aic::Controller::Root | instance | | aic::Model::Access | instance | | aic::Model::Editor | instance | | aic::Model::inspectDB | class| | aic::Model::inspectDB::__RoseDBPrivate__::Rose::DB::MySQL | class| | aic::View::Editor | instance | | aic::View::Login| instance | '-+--' [debug] Loaded Private actions: .--+--+--. | Private | Class| Method | +--+--+--+ | /default | aic::Controller::Root| default | | /end | aic::Controller::Root| end | | /acl_access_denied | aic | acl_access_- | | | | denied | | /auto| aic::Controller::Root| auto | | /editor/postCaption- | aic::Controller::Editor | postCaption- | | Handler | | Handler | | /editor/postFileHan- | aic::Controller::Editor | postFileHan- | | dler | | dler | | /editor/default | aic::Controller::Editor | default | | /editor/access_deni- | aic::Controller::Editor | access_deni- | | ed | | ed | | /editor/index|
Re: [Catalyst] Session unexpectedly expiring
Thomas L. Shinnick wrote: At 08:20 PM 5/20/2007, Jeff Chimene wrote: Hi, I'm trying to figure out why my sessions are expiring in script/xxx_cgi.pl but not script/xxx_server.pl [snip] I'm using the Session, Session::Store::FastMmap, Session::State::Cookie plugins. I've not used it, I'm guessing, and I'm an idiot, but isn't this likely permissions problems, between running standalone vs. running under Apache? Any chance the backing storage file is not available to Apache processes? Peeking at the docs: storage Specifies the file to be used for the sharing of session data. ... Note that the file will be created with mode 0640, which means that it will only be writeable by processes running with the same uid as the process that creates the file. Try deleting the backing file before re-running under Apache? Good catch. Apache (or script/aic_server.pl) refuses to honor a request if the working storage file created by the other HTTP server exists. I couldn't even get started w/o a preliminary sudo rm -r /tmp/aic So, although that's /a/ problem, it's not /the/ problem. Cheers, jec ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/