Forum: Ruby on Rails permission denied creating ruby sessions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Will (Guest)
on 2006-04-01 22:06
My code was working, and I upgraded to Rails 1.1, and it seemed to be
working after that, but then I suddenly started seeing the following
error:

Permission denied -
/home/will/office/public/../config/../tmp/sessions//ruby_sess.c7da2e7df8df77df
/usr/lib/ruby/1.8/pstore.rb:289:in `initialize'
/usr/lib/ruby/1.8/pstore.rb:289:in `transaction'
/usr/lib/ruby/1.8/cgi/session/pstore.rb:71:in `initialize'
/usr/lib/ruby/1.8/cgi/session.rb:273:in `initialize'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/cgi_process.rb:111:in
`session'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/cgi_process.rb:141:in
`stale_session_check!'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/cgi_process.rb:107:in
`session'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:885:in
`assign_shortcuts_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/flash.rb:141:in
`assign_shortcuts'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:373:in
`process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in
`process_without_session_management_support'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in
`process'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in
`dispatch'
/home/will/office/public/dispatch.cgi:10Loaded suite
/home/will/office/public/dispatch.cgi
Started

Finished in 0.000278 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

----
No session file ever gets created in /tmp, but the permissions should be
fine -- /tmp is writable.

I am running apache2 on gentoo linux and I have the problem whether or
not I use cgi or fast_cgi, but I don't have the problem when I use
webbrick.

Has anyone else seen this?  I am struggling.
Ray B. (Guest)
on 2006-04-02 01:16
(Received via mailing list)
Will wrote:
> My code was working, and I upgraded to Rails 1.1, and it seemed to be
> working after that, but then I suddenly started seeing the following
> error:
>
> Permission denied -
> /home/will/office/public/../config/../tmp/sessions//ruby_sess.c7da2e7df8df77df
   ----
> No session file ever gets created in /tmp, but the permissions should be
> fine -- /tmp is writable.
>
> I am running apache2 on gentoo linux and I have the problem whether or
> not I use cgi or fast_cgi, but I don't have the problem when I use
> webbrick.
>
> Has anyone else seen this?  I am struggling.

Rails 1.1 (by default, maybe this is configurable) is writing sessions
to $RAILS_ROOT/tmp/sessions not /tmp/sessions.  The first time I ran
rails update  this directory was not created, although it was the second
time. Anyway, create /home/will/office/public/../config/../tmp/sessions
with correct permissions and you should be ok.

--

Ray
Anonymous (Guest)
on 2006-04-23 20:48
(Received via mailing list)
it's a hack, but set the permissions on directories within /tmp to be
extremely loose...i.e. chmod 777 *
Anonymous (Guest)
on 2006-05-10 07:35
(Received via mailing list)
home equity line of credit
This topic is locked and can not be replied to.