Paperclip in Rails, can’t upload picture. Previously was ok – Education Career Blog

I got this some kind of permission error in my log. Everything was working fine previously, I have tested the photos controller of mine, and it worked well. So I started working on other controllers. Then somehow I found this error happening. Appreciate if someone could help.

  Processing PhotosController#create (for 115.164.151.52 at 2010-10-21 09:10:50) POST
  Parameters: {"photo"=>{"data"=>#<File:/tmp/RackMultipart20101021-8226-k6whi9-0>, "attachable_type"=>"Spot", "attachable_id"=>"2"}, "action"=>"create", "authenticity_token"=>"K/UoJBS6WDcP86TThn8usTdguOOe6iytt7LVbhA0PbE=", "controller"=>"photos"}
paperclip Saving attachments.
paperclip identify -format %wx%h '/tmp/stream20101021-8226-9mqldj-0.jpg0' 2>/dev/null
paperclip convert '/tmp/stream20101021-8226-9mqldj-0.jpg0' -resize "500x375>" '/tmp/stream20101021-8226-9mqldj-020101021-8226-k0sivd-0' 2>/dev/null
paperclip identify -format %wx%h '/tmp/stream20101021-8226-9mqldj-0.jpg0' 2>/dev/null
paperclip convert '/tmp/stream20101021-8226-9mqldj-0.jpg0' -resize "260x195>" '/tmp/stream20101021-8226-9mqldj-020101021-8226-1w0hb2p-0' 2>/dev/null
paperclip identify -format %wx%h '/tmp/stream20101021-8226-9mqldj-0.jpg0' 2>/dev/null
paperclip convert '/tmp/stream20101021-8226-9mqldj-0.jpg0' -resize "x76" -crop "76x76+38+0" +repage '/tmp/stream20101021-8226-9mqldj-020101021-8226-f6d4cl-0' 2>/dev/null
paperclip identify -format %wx%h '/tmp/stream20101021-8226-9mqldj-0.jpg0' 2>/dev/null
paperclip convert '/tmp/stream20101021-8226-9mqldj-0.jpg0' -resize "44x44>" '/tmp/stream20101021-8226-9mqldj-020101021-8226-16k923w-0' 2>/dev/null
paperclip Saving attachments.

Errno::EACCES (Permission denied - /var/www/abc.com/public/abc/releases/20101008073517/public/system):
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:243:in `mkdir'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:201:in `each'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
  paperclip (2.3.4) lib/paperclip/storage/filesystem.rb:39:in `flush_writes'
  paperclip (2.3.4) lib/paperclip/storage/filesystem.rb:37:in `each'
  paperclip (2.3.4) lib/paperclip/storage/filesystem.rb:37:in `flush_writes'
  paperclip (2.3.4) lib/paperclip/attachment.rb:147:in `save'
  paperclip (2.3.4) lib/paperclip.rb:357:in `send'
  paperclip (2.3.4) lib/paperclip.rb:357:in `save_attached_files'
  paperclip (2.3.4) lib/paperclip.rb:350:in `each_attachment'
  paperclip (2.3.4) lib/paperclip.rb:349:in `each'
  paperclip (2.3.4) lib/paperclip.rb:349:in `each_attachment'
  paperclip (2.3.4) lib/paperclip.rb:356:in `save_attached_files'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/after_commit-1.0.8/lib/after_commit/connection_adapters.rb:12:in `transaction'
  app/controllers/photos_controller.rb:6:in `create'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/authlogic-oauth-1.0.8/lib/oauth_callback_filter.rb:10:in `call'
  /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/authlogic-oauth-1.0.8/lib/oauth_callback_filter.rb:10:in `call'
  passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  passenger (2.2.15) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in `start'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /var/www/abc.com/public/abc/releases/20101008073517/public/500.html (500 Internal Server Error)
** Erubis 2.6.6

,

Never mind, found out that it was referring to the public/system symbolic link which I deleted earlier. Problem solved now. Thanks.

Leave a Comment