I get apparently random 500 Internal Server Error reactions from Apache on our recently released Rails 3.1 site. The mistake follows:

[ pid=19441 thr=2888301424 file=ext/apache2/Hooks.cpp:822 time=2011-09-15 15:45:07.311 ]: The after sales application (process 19550) didn't send a legitimate HTTP response rather, it sent nothing at all. It's possible it has crashed book whether there are crashes bugs within this application.

Sometimes I am also seeing the next error:

[ pid=5805 thr=75783560 file=utils.rb:176 time=2011-09-15 16:02:19.471 ]: * Exception PGError in application (SSL SYSCALL error: EOF detected ) (process 5805, thread #): from /application/oath/vendor/ruby/1.9.1/gems/activerecord-3.1./lib/active_record/connection_plugs/postgresql_adapter.rb:276:in exec' from /app/oath/vendor/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:276:in block in obvious_cache!' from /application/oath/vendor/ruby/1.9.1/gems/activerecord-3.1./lib/active_record/connection_plugs/postgresql_adapter.rb:275:in each_value' from /app/oath/vendor/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:275:in obvious_cache!' from /application/oath/vendor/ruby/1.9.1/gems/activerecord-3.1./lib/active_record/connection_plugs/postgresql_adapter.rb:303:in disconnect!' from /app/oath/vendor/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:202:in block in disconnect!' from /application/oath/vendor/ruby/1.9.1/gems/activerecord-3.1./lib/active_record/connection_plugs/abstract/connection_pool.rb:201:in each' from /app/oath/vendor/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:201:in disconnect!' from /application/oath/vendor/ruby/1.9.1/gems/activesupport-3.1./lib/active_support/core_ext/module/synchronization.rb:35:in block in disconnect_with_synchronization!' from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' from /application/oath/vendor/ruby/1.9.1/gems/activesupport-3.1./lib/active_support/core_ext/module/synchronization.rb:34:in disconnect_with_synchronization!' from /app/oath/vendor/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:395:in block in obvious_all_connections!' from /application/oath/vendor/ruby/1.9.1/gems/activerecord-3.1./lib/active_record/connection_plugs/abstract/connection_pool.rb:395:in each_value' from /app/oath/vendor/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:395:in obvious_all_connections!' from /application/oath/vendor/ruby/1.9.1/gems/activerecord-3.1./lib/active_record/connection_plugs/abstract/connection_specs.rb:123:in clear_all_connections!' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/utils.rb:398:in before_handling_requests' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/rack/application_spawner.rb:204:in start_request_handler' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb:170:in block in handle_spawn_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/utils.rb:479:in safe_fork' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb:165:in handle_spawn_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/abstract_server.rb:357:in server_main_loop' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:206:in start_synchronously' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/abstract_server.rb:180:in start' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb:128:in start' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/spawn_manager.rb:253:in block (2 levels) in spawn_rack_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb:132:in research_or_add' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/spawn_manager.rb:246:in block in spawn_rack_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb:82:in block in synchronize' from :10:in synchronize' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb:79:in synchronize' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/spawn_manager.rb:244:in spawn_rack_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb:137:in spawn_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/spawn_manager.rb:275:in handle_spawn_application' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:357:in server_primary_loop' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3..9/lib/phusion_passenger/abstract_server.rb:206:in start_synchronously' from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/helper-scripts/passenger-spawn-server:99:in '

This area is running Ubuntu 10.04 LTS and Apache/2.2.14 with Rails 3.1, Passenger 3..9, and Rack 1.3.2.

This can be a relatively easy site and I have exhaust ideas.