Forum: Ruby on Rails File upload doesn't work in production mode

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.
24b05e200310d4673bf93e9349067887?d=identicon&s=25 Paul Sturgess (Guest)
on 2006-04-12 14:03
(Received via mailing list)
Can anyone understand what the production.log file is telling me. I've
tried playing with the permissions for the folders and it makes no
difference. Every time I submit the form to upload the file I get
"Application error (Rails)" which doesn't really help.

Processing DocsController#create (for 82.152.151.194 at 2006-04-12
12:44:13) [POST]
  Session ID: b27441574a2e76188be2b59b3572affb
  Parameters: {"commit"=>"Save and continue",
"doc"=>{"filename_temp"=>"", "filename"=>#<StringIO:0xb70d8118>,
"label"=>"test"}, "action"=>"create", "controller"=>"admin/docs"}


Errno::EACCES (Permission denied -
/var/www/html/hjplaw.co.uk/current/public/../config/../public/doc/filename/tmp/1144842253.766011.302):
    /usr/local/lib/ruby/1.8/fileutils.rb:243:in `mkdir'
    /usr/local/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
    /usr/local/lib/ruby/1.8/fileutils.rb:172:in `mkdir'
    /usr/local/lib/ruby/1.8/fileutils.rb:171:in `mkdir'
    /vendor/plugins/file_column/lib/file_column.rb:216:in `store_upload'
    /vendor/plugins/file_column/lib/file_column.rb:150:in `upload'
    /vendor/plugins/file_column/lib/file_column.rb:70:in `assign'
    /vendor/plugins/file_column/lib/file_column.rb:652:in `filename='
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1506:in
`attributes='
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1505:in
`attributes='
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1350:in
`initialize_without_callbacks'
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/callbacks.rb:236:in
`initialize'
    /app/controllers/admin/docs_controller.rb:20:in `create'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in
`perform_action_without_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:355:in
`perform_action_without_benchmark'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/rescue.rb:82:in
`perform_action'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in
`process_without_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in
`process_without_session_management_support'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in
`process'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in
`dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:150:in
`process_request'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:54:in
`process!'
    /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:600:in
`each_cgi'
    /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in
`each_cgi'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:53:in
`process!'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:23:in
`process!'
    /var/www/html/hjplaw.co.uk/current/public/dispatch.fcgi:24


--
87e41d0d468ad56a3b07d9a6482fd6d5?d=identicon&s=25 Hemant Kumar (gnufied)
on 2006-04-12 14:22
(Received via mailing list)
From the tmp/sessions directory you can try deleting the files created
there.
24b05e200310d4673bf93e9349067887?d=identicon&s=25 Paul Sturgess (Guest)
on 2006-04-12 14:47
(Received via mailing list)
I deleted the tmp/sessions files and restarted the server and
unfortunately it's still doing the same as before.
87e41d0d468ad56a3b07d9a6482fd6d5?d=identicon&s=25 Hemant Kumar (gnufied)
on 2006-04-12 14:53
(Received via mailing list)
Its really strange then...whats your OS? What permissions you are using?
Just
make sure that  tmp and log directory are writable. Also, where exactly
you
are saving files uploaded with file_column plugin? Do, you have write
permissions there?



Looks like, you are having problems with file_column plugin?

You will  have to post full stacktrace...only then we can help!!.
24b05e200310d4673bf93e9349067887?d=identicon&s=25 Paul Sturgess (Guest)
on 2006-04-12 16:10
(Received via mailing list)
it is the file_column plugin you are right and it works fine in other
areas of my application. the file upload works fine locally on my
windows machine in development mode. it's just the move to production
onto the linux server when it breaks.

permissions are set at 775 for all folders i can see are involved in
the upload process. the file gets saved to /public/doc/filename/ID
24b05e200310d4673bf93e9349067887?d=identicon&s=25 Paul Sturgess (Guest)
on 2006-04-12 16:25
(Received via mailing list)
ok i figured it out. basically i had uploaded my local /public/doc
folder to the production server. so file_column was throwing up the
errors because it didn't like that the folders it was going to create
already existed.

hopefully posting this up will help save time for anyone else who gets
baffled by this error.
This topic is locked and can not be replied to.