Welcome Guest | Login

500 error in production, coding error

in my latest deployment my app broke and i don't know what happened. looks like an error in code, but it works fine in development env.

here is the latest entry in production.log
---------------------------------
Processing WelcomeController#index (for xx.xx.xx.xx at 2008-03-19 03:21:31) [GET]
 Session ID: 53e145edf07b28bcdccbfba69eca5f59
 Parameters: {"action"=>"index", "controller"=>"welcome"}


LoadError (Expected /home/wehasph/apps/WeHasPhotos/releases/20080319081630/app/models/upload.rb to define Upload):
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:249:in `load_missing_constant'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1748:in `compute_type'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/reflection.rb:125:in `send'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/reflection.rb:125:in `klass'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1561:in `initialize'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1459:in `new'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1459:in `build_join_association'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1442:in `build'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1445:in `build'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1444:in `each'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1444:in `build'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1385:in `initialize'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1123:in `new'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1123:in `find_with_associations'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1122:in `catch'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1122:in `find_with_associations'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1232:in `find_every'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:503:in `find'
   /app/controllers/welcome_controller.rb:5:in `index'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68: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-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in `with_signal_handler'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in `process_each_request'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in `process_each_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in `process!'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in `process!'
   dispatch.fcgi:24

Rendering /home/wehasph/apps/WeHasPhotos/releases/20080319081630/public/500.html (500 Internal Server Error)

---------------------------------------------

any ideas?

2008-03-19 03:28 AM

http://www.remixtechnology.com
Hi there - it seems you need to define what exact processor are you using into your upload.rb model file. Please see below how to do that.


explicitly chose RMagick as the processor
has_attachment :content_type => :image,
:processor=> :rmagick

:processor=> can be rmagick, image_science  MiniMagick

Also if you still have this issue, loading up your environment script/console and typing in the name of the model Upload or controller -- that will give a more informative error, in this case with your image processor.

2008-03-19 05:26 AM

i never had to specify the processor before, and it worked fine.

i added that line to has_attachment,
:processor=> :rmagick

but i still have the same error message in production.log

i don't really know how to get an error through console, i did Upload.new and there were no errors, but i don't know how to simulate uploading an attachment.

if i run public/dispatch.fcgi it outputs the page correctly.

i just emptied out my tables and deleted the upload files and directories.

still 500

any other suggestions?

2008-03-19 06:26 AM

http://www.remixtechnology.com
Hello,

The errors that you have mentioned has been discussed earlier in one of our forum threads. Please read the thread pasted below.
http://www.hostingrails.com/forums/deployment_troubleshooting_thread/384

I guess this will help you.If this doesn't do the trick.. then I would recommend you to post a ticket to our support department.

2008-03-19 07:20 AM

Regards,
Rahul
it works.

thanks Rahul!

2008-03-19 01:40 PM

http://www.remixtechnology.com

Hello Guest! In order to post you must be an active client with us, please log in or sign up.