Passenger dies with UnknownHttpMethod exception

Update I tried to catch this exception in my application controller, but to no avail. I also updated Passenger to version 3.0.7 and sent a message to my tracker.


I have a Rails 3.0.4 application running on FreeBSD 8.2 with Apache 2.2.17, Passenger 3.0.2 and Ruby 1.9.2-p180 that die in a day. Here's the backtrace from the error log:

[ pid=85853 thr=17189069660 file=utils.rb:176 time=2011-05-04 12:08:13.022 ]: *** Exception ActionController::UnknownHttpMethod in application (U<F9>i<CA>,fs<C8>6<F6><C0>b<F2><C5>hVj<BE><D9>#<F5><80><99><EA>=n, accepted HTTP methods are OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, VERSION-CONTROL, REPORT, CHECKOUT, CHECKIN, UNCHECKOUT, MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY, ORDERPATCH, ACL, SEARCH, and PATCH) (process 85853, thread #<Thread:0x0000080118c6b8>): from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_dispatch/http/request.rb:76:in `request_method' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/railties-3.0.4/lib/rails/rack/logger.rb:24:in `before_dispatch' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/railties-3.0.4/lib/rails/rack/logger.rb:12:in `call' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/runtime.rb:17:in `call' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/lock.rb:11:in `block in call' from <internal:prelude>:10:in `synchronize' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/railties-3.0.4/lib/rails/application.rb:168:in `call' from /usr/local/docs/arc/shared/bundle/ruby/1.9.1/gems/railties-3.0.4/lib/rails/application.rb:77:in `method_missing' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:170:in `block in handle_spawn_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:479:in `safe_fork' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:180:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:128:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize' from <internal:prelude>:10:in `synchronize' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/helper-scripts/passenger-spawn-server:99:in `<main>' [Wed May 04 12:08:13 2011] [notice] child pid 1567 exit signal Bus error (10) [Wed May 04 12:08:16 2011] [notice] child pid 1195 exit signal Bus error (10) [Wed May 04 12:08:20 2011] [notice] child pid 1600 exit signal Bus error (10) [Wed May 04 12:08:20 2011] [notice] child pid 1590 exit signal Bus error (10) [Wed May 04 12:08:21 2011] [notice] child pid 1199 exit signal Bus error (10) [Wed May 04 12:08:21 2011] [notice] child pid 726 exit signal Bus error (10)...etc... 

As soon as this happens, the application will disappear. Apache still serves static files in the public directory, but not the application. Of course, gobbledygook, where the verb http should take care of me (and makes tracking impossible through google), but will this save the application_controller exception, will it actually prevent the death of the passenger? Has anyone seen this before?

+6
source share
1 answer

Honestly, it looks like your application server (fastcgi or apache moduel?) Is dying pretty unbearably when an invalid HTTP verb is received.

I fully expect that you can filter this out in the apache configuration for the site (be it / etc / apache 2 / site-available / ... or .htaccess in your virtual folder (mod_access)

However, I think it's wise to just report the track to Passenger developers as an error. Information is right on the track.

  U<F9>i<CA>,fs<C8>6<F6><C0>b<F2><C5>hVj<BE><D9>#<F5><80><99><EA>=n 

not a valid verb. This can be trivially played back using netcat on port 80 of your web server (remember the Host header)

0
source

Source: https://habr.com/ru/post/887318/


All Articles