Ruby on Rails error Errno::EPIPE: Broken pipe - ruby-on-rails

I've been seeing this error pop up Errno::EPIPE: Broken pipe every so often in the logs for my rails application. I saw a number of people with the same error, but the issue was either MySQL, Mongo, or Passenger, as evidenced by their stack trace. Mine seems to be having trouble talking to ruby. Can anybody help me decipher this stack trace or help lead me in the right direction?
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:177:in `write'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:177:in `write0'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:153:in `write'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:168:in `writing'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:152:in `write'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1546:in `send_request_with_body'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1531:in `exec'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1049:in `request'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1037:in `request'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:543:in `start'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1035:in `request'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:845:in `post'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:154:in `rescue_action_without_handler'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:74:in `rescue_action'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:162:in `perform_action_without_flash'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
vendor/ruby/1.8/gems/haml-3.0.4/rails/../lib/sass/plugin/rack.rb:41:in `call'
vendor/ruby/1.8/gems/haml-3.0.4/rails/../lib/sass/plugin/rack.rb:41:in `call'
vendor/ruby/1.8/gems/rack-ie-redirect-fix-0.0.1/lib/rack-ie-redirect-fix.rb:11:in `call'
vendor/ruby/1.8/gems/rack-git-version-0.0.2/lib/rack-git-version.rb:14:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
vendor/ruby/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
vendor/ruby/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:in `call'
vendor/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
vendor/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
vendor/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
vendor/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
vendor/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
vendor/ruby/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
vendor/ruby/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
vendor/ruby/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
vendor/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/classic_rails/application_spawner.rb:99:in `spawn_application'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/classic_rails/application_spawner.rb:84:in `spawn_application'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:230:in `spawn_rails_application'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/helper-scripts/passenger-spawn-server:99

I think in your case an external program or server disconnects while your program is trying to write to it. Does that error happen when you're doing something specific?

Related

Ruby crash on server

After 10 years my setup has started crashing every couple of weeks. The error I receive is below. The company that created the system has gone under and I do not have clue where to start getting this fixed. Any ideas would a great help.
The error encountered was: Errno::ECONNREFUSED - Connection refused - connect(2)
Backtrace:
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:560:in `initialize'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:560:in `open'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:560:in `connect'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:53:in `timeout'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:101:in `timeout'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:560:in `connect'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:553:in `do_start'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:542:in `start'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:440:in `start'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/bundler/gems/Show-Control-b7149704e299/lib/show_control/api/client.rb:122:in `request'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/bundler/gems/Show-Control-b7149704e299/lib/show_control/api/client.rb:105:in `get'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/bundler/gems/Show-Control-b7149704e299/lib/show_control/api/client.rb:73:in `find_all'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/bundler/gems/Show-Control-b7149704e299/lib/show_control/api/client.rb:38:in `find_all_templates'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/app/controllers/admin/scheduler/templates_controller.rb:4:in `index'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:150:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rendering.rb:11:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:18:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:436:in `_run__577361292__process_action__199225275__callbacks'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in `send'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `send'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `run_callbacks'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:17:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in `instrument'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in `instrument'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rescue.rb:17:in `process_action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:119:in `process'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:41:in `process'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal.rb:138:in `dispatch'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_controller/metal.rb:178:in `action'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:27:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `recognize'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:82:in `optimized_each'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:493:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/hoptoad_notifier-2.3.12/lib/hoptoad_notifier/rack.rb:27:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/haml-3.0.25/lib/sass/plugin/rack.rb:41:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/warden-1.0.3/lib/warden/manager.rb:35:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/warden-1.0.3/lib/warden/manager.rb:34:in `catch'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/warden-1.0.3/lib/warden/manager.rb:34:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/head.rb:14:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-1.2.4/lib/rack/methodoverride.rb:24:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/flash.rb:182:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/plugins/latitude/lib/latitude/middleware/flash_session_cookie_middleware.rb:18:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:32:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:12:in `cache'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:31:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-contrib-1.1.0/lib/rack/contrib/sendfile.rb:105:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/railties-3.0.7/lib/rails/rack/logger.rb:13:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-contrib-1.1.0/lib/rack/contrib/runtime.rb:18:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-1.2.4/lib/rack/lock.rb:11:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-1.2.4/lib/rack/lock.rb:11:in `synchronize'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/rack-1.2.4/lib/rack/lock.rb:11:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:168:in `call'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
/opt/www/apps/server.XXXXXXX.lan/releases/20111223105109/vendor/bundle/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/rack/application_spawner.rb:170:in `send'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/rack/application_spawner.rb:170:in `handle_spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:180:in `start'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.5/helper-scripts/passenger-spawn-server:99
Back

OpenShift Origin: Failed to execute: 'control start' when creating a Ruby 1.9/1.8 application

When I attempt to create a Ruby application within OpenShift Origin I get the following error:
Starting Ruby cartridge
Failed to execute: 'control start' for /var/lib/openshift/540f759e19c94b7916000064/ruby
Following this up in the logs I can see the following, can anybody point me in the right direction?
Latest version of Origin, installed from oo-installer.
2014-09-09 17:48:14.741 [INFO ] Parameters: {"cartridges"=>["ruby-1.9"], "domain_id"=>"development", "gear_profile"=>"small", "initial_git_branch"=>"", "initial_git_url"=>"", "name"=>"ruby", "scale"=>"false"} (pid:7765)
2014-09-09 17:48:36.486 [ERROR] Failed to execute: 'control start' for /var/lib/openshift/540f759e19c94b7916000064/ruby (pid:7765)
2014-09-09 17:48:36.487 [ERROR] /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.26.1.1/lib/openshift/mcollective_application_container_proxy.rb:2763:in `parse_result'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.26.1.1/lib/openshift/mcollective_application_container_proxy.rb:2944:in `run_cartridge_command'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.26.1.1/lib/openshift/mcollective_application_container_proxy.rb:846:in `post_configure_component'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/gear.rb:196:in `post_configure_component'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/pending_ops_models/post_configure_comp_op.rb:12:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/pending_app_op_group.rb:104:in `block in execute'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/pending_app_op_group.rb:94:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/pending_app_op_group.rb:94:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/application.rb:1719:in `run_jobs'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/application.rb:824:in `block in add_cartridges'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/lock.rb:62:in `run_in_app_lock'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/application.rb:801:in `add_cartridges'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/models/application.rb:654:in `add_initial_cartridges'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/app/controllers/applications_controller.rb:170:in `create'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:481:in `block in _run__4204384996818884849__process_action__2449202845933876977__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_519'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.26.3.1/lib/openshift/controller/action_log.rb:80:in `set_logged_request'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_519'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:403:in `_run__4204384996818884849__process_action__2449202845933876977__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `block in action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/rack/mongoid/middleware/identity_map.rb:34:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/unit_of_work.rb:39:in `unit_of_work'
/opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/rack/mongoid/middleware/identity_map.rb:34:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__2514728056779631320__call__364474079927790510__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/request_handler.rb:97:in `process_request'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_request_handler.rb:521:in `accept_and_process_next_request'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/utils.rb:470:in `safe_fork'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:180:in `start'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/helper-scripts/passenger-spawn-server:102:in `<main>' (pid:7765)
2014-09-09 17:48:36.487 [ERROR] Encountered error during execute 'Failed to execute: 'control start' for /var/lib/openshift/540f759e19c94b7916000064/ruby
' (pid:7765)
2014-09-09 17:48:38.526 [INFO ] Completed 422 Unprocessable Entity in 23785ms (Views: 1.5ms) (pid:7765)

Rails ArgumentError: invalid %-encoding

For the last month, we've had a bot scraping our site regularly, leading to a bunch of ArgumentError: invalid %-encoding errors because the URLs are malformed. I've looked at a bunch of issues in rack here and here and rails here, and looked at this SO thread but there doesn't seem to be a definitive solution. Is there a correct solution for GET errors? Do I have to monkeypatch rack?
edit: And here's a backtrace:
/usr/local/lib/ruby/1.9.1/uri/common.rb:898:in `decode_www_form_component'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/utils.rb:41:in `unescape'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/utils.rb:94:in `block (2 levels) in parse_nested_query'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/utils.rb:94:in `map'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/utils.rb:94:in `block in parse_nested_query'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/utils.rb:93:in `each'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/utils.rb:93:in `parse_nested_query'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/request.rb:332:in `parse_query'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/http/request.rb:269:in `parse_query'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/request.rb:186:in `GET'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/http/request.rb:225:in `GET'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/http/parameters.rb:10:in `parameters'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/http/filter_parameters.rb:33:in `filtered_parameters'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_controller/metal/instrumentation.rb:21:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
[GEM_ROOT]/gems/activerecord-3.2.12/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/abstract_controller/base.rb:121:in `process'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/abstract_controller/rendering.rb:45:in `process'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_controller/metal.rb:203:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_controller/metal.rb:246:in `block in action'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:73:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:36:in `call'
[GEM_ROOT]/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
[GEM_ROOT]/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
[GEM_ROOT]/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:601:in `call'
[GEM_ROOT]/gems/omniauth-1.1.1/lib/omniauth/strategy.rb:177:in `call!'
[GEM_ROOT]/gems/omniauth-1.1.1/lib/omniauth/strategy.rb:157:in `call'
[GEM_ROOT]/gems/sass-3.2.7/lib/sass/plugin/rack.rb:54:in `call'
[GEM_ROOT]/gems/warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
[GEM_ROOT]/gems/warden-1.2.1/lib/warden/manager.rb:34:in `catch'
[GEM_ROOT]/gems/warden-1.2.1/lib/warden/manager.rb:34:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/head.rb:14:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/flash.rb:242:in `call'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/cookies.rb:341:in `call'
[GEM_ROOT]/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:64:in `call'
[GEM_ROOT]/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
[GEM_ROOT]/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `_run__497203393471184793__call__4495106819278994598__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
[GEM_ROOT]/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'
[GEM_ROOT]/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'
[GEM_ROOT]/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'
[GEM_ROOT]/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'
[GEM_ROOT]/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
[GEM_ROOT]/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
[GEM_ROOT]/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:172:in `rescue in lookup'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:168:in `lookup'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
[GEM_ROOT]/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'
[GEM_ROOT]/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'
[GEM_ROOT]/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/helper-scripts/passenger-spawn-server:99:in `<main>'
if you don't mind against monkeypatching Rack then create in config/initializers file (for example rack.rb) with this content:
module Rack
module Utils
if defined?(::Encoding)
def unescape(s, encoding = Encoding::UTF_8)
begin
URI.decode_www_form_component(s, encoding)
rescue ArgumentError
URI.decode_www_form_component(URI.encode(s), encoding)
end
end
else
def unescape(s, encoding = nil)
begin
URI.decode_www_form_component(s, encoding)
rescue ArgumentError
URI.decode_www_form_component(URI.encode(s), encoding)
end
end
end
module_function :unescape
end
end
p.s. it works with passenger, but with Webrick and Thin it doesn't. It looks like both webrick and thin parse a request too, so the failure happens before initializer is loaded. For example with Thin error happens in thin-1.6.2/lib/thin/request.rb:84.
You could inject a middleware designed to detect these and fail gracefully. The basic idea is to just try to parse the query string, and if it fails, bail out with a HTTP 400. Otherwise, just allow the request through.
class RefuseInvalidRequest
def initialize(app)
#app = app
end
def call(env)
query = Rack::Utils.parse_nested_query(env['QUERY_STRING'].to_s) rescue :bad_query
if query == :bad_query
[400, {'Content-Type' => 'text/plain'}, "Bad Request"]
else
#app.call(env)
end
end
end
I haven't tested this, but the concept should work.

cURL SSL Peer Certificate exception on Rails 3.0.6 on Ubuntu 12.10

Using rails 3.0.6, rake 0.8.7 and curb.
I am trying to connect a remote Android client using SSL I get the following exception Curl::Err::SSLPeerCertificateError
The error trace I get is as follows:
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/curb-0.8.3/lib/curl/easy.rb:60:in `perform'
/home/user/releases/20121226212154/webapp/lib/android_push.rb:24:in `http_post'
/home/user/releases/20121226212154/webapp/lib/android_push.rb:24:in `send_command'
/home/user/releases/20121226212154/webapp/lib/device_commands.rb:14:in `command_on_demand'
/home/user/releases/20121226212154/webapp/app/controllers/positions_controller.rb:70:in `on_demand'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/abstract_controller/base.rb:150:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/callbacks.rb:506:in `_run__891378805__process_action__691620700__callbacks'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/callbacks.rb:410:in `send'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/callbacks.rb:94:in `send'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/notifications.rb:52:in `instrument'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/notifications.rb:52:in `instrument'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:in `perform_action_with_newrelic_trace'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in `perform_action_with_newrelic_trace'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/abstract_controller/base.rb:119:in `process'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/abstract_controller/rendering.rb:41:in `process'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal.rb:138:in `dispatch'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_controller/metal.rb:178:in `action'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/routing/route_set.rb:27:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `recognize'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:96:in `optimized_each'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/routing/route_set.rb:493:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/rack/error_collector.rb:8:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/newrelic_rpm-3.5.3.25/lib/new_relic/rack/browser_monitoring.rb:12:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/mongoid-2.2.6/lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/mongoid-2.2.6/lib/mongoid.rb:130:in `unit_of_work'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/mongoid-2.2.6/lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/warden-1.0.6/lib/warden/manager.rb:35:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/warden-1.0.6/lib/warden/manager.rb:34:in `catch'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/warden-1.0.6/lib/warden/manager.rb:34:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/head.rb:14:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-1.2.5/lib/rack/methodoverride.rb:24:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activerecord-3.0.6/lib/active_record/query_cache.rb:32:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activerecord-3.0.6/lib/active_record/query_cache.rb:12:in `cache'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activerecord-3.0.6/lib/active_record/query_cache.rb:31:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/activesupport-3.0.6/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-1.2.5/lib/rack/sendfile.rb:106:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/actionpack-3.0.6/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/railties-3.0.6/lib/rails/rack/logger.rb:13:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-1.2.5/lib/rack/runtime.rb:17:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-1.2.5/lib/rack/lock.rb:1Server version: Apache/2.2.22 (Ubuntu) Server built: Nov 6 2012 20:27:22 3:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-1.2.5/lib/rack/lock.rb:13:in `synchronize'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/rack-1.2.5/lib/rack/lock.rb:13:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/railties-3.0.6/lib/rails/application.rb:168:in `call'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/railties-3.0.6/lib/rails/application.rb:77:in `send'
/home/user/releases/20121226212154/webapp/vendor/ruby/1.8/gems/railties-3.0.6/lib/rails/application.rb:77:in `method_missing'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:171:in `send'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:171:in `handle_spawn_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/utils.rb:470:in `safe_fork'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:180:in `start'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.18/helper-scripts/passenger-spawn-server:99
I am using Ubuntu 12.10, Apache 2.2.22, Phusion Passenger 3.0.18 and Ruby 1.8.7.
How can I fix this cURL exception? Is it a rails problem or is it a apache2, ssl and phusion passenger configuration problem?
I solved this issue using this howto
http://lowtek.ca/roo/2012/ubuntu-apache2-trusted-ssl-certificate-from-startssl/
Using an StartSSL free certificate to have a https connection.

Apache + Passenger + Rails not serving assets after adding SSL certificate

My Rails server has been working fine until adding an SSL certificate and using force_ssl, to the point where it will neither fully validate (says the site is only partially encrypted), nor load any assets. All that loads is a static html page - with working links, but that's just about it.
Has anyone ever run into this problem before?
UPDATE
This is the stack trace I've been getting in production.log (there are several, this is just an example of one for a single request)
Started GET "/internal-nginx-static-locationassets/slide2.png" for 129.21.79.202 at 2012-07-24 10:18:39 -0700
ActionController::RoutingError (No route matches [GET] "/internal-nginx-static-locationassets/slide2.png"):
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/rack/logger.rb:26:in `call_app'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/rack/logger.rb:16:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:479:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:220:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/utils.rb:470:in `safe_fork'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.14/helper-scripts/passenger-spawn-server:99:in `<main>'

Resources