gpt4 book ai didi

ruby - 乘客死于 UnknownHttpMethod 异常

转载 作者:数据小太阳 更新时间:2023-10-29 07:08:34 25 4
gpt4 key购买 nike

更新 我尝试在我的应用程序 Controller 中捕获此异常,但无济于事。我还将 Passenger 更新到 3.0.7 并向他们的跟踪器提交了一个问题。


我有一个 Rails 3.0.4 应用程序在 FreeBSD 8.2 上运行,Apache 2.2.17、Passenger 3.0.2 和 Ruby 1.9.2-p180 每隔一天就会死机。这是错误日志的回溯:

    [ 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...

一旦发生这种情况,应用程序就会崩溃。 Apache 仍然在公共(public)目录中提供静态文件,但不提供应用程序。当然,http 动词应该出现的官方文章让我担心(并且无法通过谷歌进行追踪),但是在 application_controller 中拯救这个异常实际上会阻止乘客死亡吗?有人以前见过这个吗?

最佳答案

老实说,您的应用程序服务器(fastcgi 或 apache 模块?)在收到非法 HTTP 动词时看起来很不正常地死掉了。

我完全希望您可以在站点的 apache 配置中过滤它(无论是/etc/apache2/site-available/... 还是虚拟文件夹 (mod_access) 中的 .htaccess

但是,我认为将跟踪作为错误报告给 Passenger 开发人员是明智的。信息就在跟踪中

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

不是有效的动词。在您的网络服务器的端口 80 上使用 netcat 进行复制可能很简单(记住主机 header )

关于ruby - 乘客死于 UnknownHttpMethod 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5890684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com