奇怪的路由请求抛出NoMethodError“未定义的方法`merge”为nil:NilClass“

时间:2013-12-06 16:15:17

标签: ruby-on-rails nginx passenger ubuntu-10.04 vps

您好我使用nginx,capistrano,varnish,Phusion Passenger和Rails进行VPS Ubuntu 10.04设置。有一段时间我得到一个奇怪的路由请求,寻找路由:

http://localhost/cgi-bin/php/cgin/php?%2D%64+%61%6C%75%6F%6E+%2D%64+%6D%6F%64+%2D%64+%73%75%68%6F%6E%3D%6F%6E+%2D%64+%75%6E%63%74%73%3D%22%22+%2D%64+%64%6E%65+%2D%64+%61%75%74%6F%5F%70%72%%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%74%5F%3D%30+%2D%64+%75%74+%2D%6E

这会导致Rails抛出NoMethodError异常。什么可能导致此请求在服务器上发生?

以下是我从服务器获取的堆栈跟踪:

A NoMethodError occurred in errors#routing:

  undefined method `merge' for nil:NilClass
  rack (1.3.10) lib/rack/request.rb:202:in `params'


-------------------------------
Request:
-------------------------------

  * URL       : http://localhost/cgi-bin/php/cgin/php?%2D%64+%61%6C%75%6F%6E+%2D%64+%6D%6F%64+%2D%64+%73%75%68%6F%6E%3D%6F%6E+%2D%64+%75%6E%63%74%73%3D%22%22+%2D%64+%64%6E%65+%2D%64+%61%75%74%6F%5F%70%72%%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%74%5F%3D%30+%2D%64+%75%74+%2D%6E
  * IP address: 127.0.0.1
  * Parameters: {"controller"=>"errors", "action"=>"routing", "a"=>"cgi-bin/php/cgin/php"}
  * Rails root: /home/deploy/application.com/releases/20131117065231
  * Timestamp : 2013-12-06 06:19:02 UTC

-------------------------------
Session:
-------------------------------

  * session id: nil
  * data: {}

-------------------------------
Environment:
-------------------------------

  * CONTENT_LENGTH                                 : 1
  * CONTENT_TYPE                                   : text/html
  * DOCUMENT_ROOT                                  : /home/deploy/application.com/current/public
  * HTTPS                                          : off
  * HTTP_HOST                                      : localhost
  * HTTP_X_FORWARDED_PROTO                         : http
  * HTTP_X_VARNISH                                 : 340799594
  * ORIGINAL_FULLPATH                              : /cgi-bin/php/cgin/php?%2D%64+%61%6C%75%6F%6E+%2D%64+%6D%6F%64+%2D%64+%73%75%68%6F%6E%3D%6F%6E+%2D%64+%75%6E%63%74%73%3D%22%22+%2D%64+%64%6E%65+%2D%64+%61%75%74%6F%5F%70%72%%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%74%5F%3D%30+%2D%64+%75%74+%2D%6E
  * PASSENGER_APP_TYPE                             : rack
  * PASSENGER_CONNECT_PASSWORD                     : [FILTERED]
  * PASSENGER_ENV                                  : production
  * PASSENGER_MIN_INSTANCES                        : 1
  * PATH_INFO                                      : /cgi-bin/php/cgin/php
  * QUERY_STRING                                   : %2D%64+%61%6C%75%6F%6E+%2D%64+%6D%6F%64+%2D%64+%73%75%68%6F%6E%3D%6F%6E+%2D%64+%75%6E%63%74%73%3D%22%22+%2D%64+%64%6E%65+%2D%64+%61%75%74%6F%5F%70%72%%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%74%5F%3D%30+%2D%64+%75%74+%2D%6E
  * REMOTE_ADDR                                    : 127.0.0.1
  * REMOTE_PORT                                    : 34005
  * REQUEST_METHOD                                 : POST
  * REQUEST_URI                                    : /cgi-bin/php/cgin/php?%2D%64+%61%6C%75%6F%6E+%2D%64+%6D%6F%64+%2D%64+%73%75%68%6F%6E%3D%6F%6E+%2D%64+%75%6E%63%74%73%3D%22%22+%2D%64+%64%6E%65+%2D%64+%61%75%74%6F%5F%70%72%%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%74%5F%3D%30+%2D%64+%75%74+%2D%6E
  * SCGI                                           : 1
  * SCRIPT_NAME                                    :
  * SERVER_ADDR                                    : 127.0.0.1
  * SERVER_NAME                                    : localhost
  * SERVER_PORT                                    : 8080
  * SERVER_PROTOCOL                                : HTTP/1.1
  * SERVER_SOFTWARE                                : nginx/1.4.3
  * action_controller.instance                     : errors#routing
  * action_dispatch.cookies                        : #<ActionDispatch::Cookies::CookieJar:0xe348290>
  * action_dispatch.parameter_filter               : [:password, /RAW_POST_DATA/]
  * action_dispatch.remote_ip                      : 127.0.0.1
  * action_dispatch.request.content_type           : text/html
  * action_dispatch.request.parameters             : {"controller"=>"errors", "action"=>"routing", "a"=>"cgi-bin/php/cgin/php"}
  * action_dispatch.request.path_parameters        : {:controller=>"errors", :action=>"routing", :a=>"cgi-bin/php/cgin/php"}
  * action_dispatch.request.query_parameters       : {}
  * action_dispatch.request.request_parameters     : {}
  * action_dispatch.request.unsigned_session_cookie: {}
  * action_dispatch.routes                         : #<ActionDispatch::Routing::RouteSet:0xa0b7d40>
  * action_dispatch.secret_token                   : 17975cc9cf1bfec1badfa83becc730a52221e2f5fe23cc8cec56361d311069f25e7daee6e842e1f149a4e29b0014127cc0efb675173ed2c828c8a0846b1eaf4b
  * action_dispatch.show_exceptions                : true
  * exception_notifier.options                     : {:sender_address=>"\"exception notifier\" <info@application.com>", :exception_recipients=>["admin@application.com"], :email_prefix=>"[Exception] ", :email_format=>:text, :sections=>["request", "session", "environment", "backtrace"], :background_sections=>["backtrace", "data"], :verbose_subject=>true, :normalize_subject=>false, :template_path=>"exception_notifier", :smtp_settings=>nil, :ignore_exceptions=>["ActiveRecord::RecordNotFound", "AbstractController::ActionNotFound", "ActionController::RoutingError"], :ignore_crawlers=>[], :ignore_if=>#<Proc:0xba1781c@/usr/local/lib/ruby/gems/1.9.1/gems/exception_notification-3.0.0/lib/exception_notifier.rb:36 (lambda)>}
  * rack-cache.allow_reload                        : false
  * rack-cache.allow_revalidate                    : false
  * rack-cache.cache_key                           : Rack::Cache::Key
  * rack-cache.default_ttl                         : 0
  * rack-cache.entitystore                         : rails:/
  * rack-cache.ignore_headers                      : ["Set-Cookie"]
  * rack-cache.metastore                           : rails:/
  * rack-cache.private_headers                     : ["Authorization", "Cookie"]
  * rack-cache.storage                             : #<Rack::Cache::Storage:0xac65cb4>
  * rack-cache.use_native_ttl                      : false
  * rack-cache.verbose                             : true
  * rack.errors                                    : #<IO:0x9949ce8>
  * rack.hijack                                    : #<Proc:0xef66c48@/usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.23/lib/phusion_passenger/rack/thread_handler_extension.rb:69 (lambda)>
  * rack.hijack?                                   : true
  * rack.input                                     : #<PhusionPassenger::Utils::TeeInput:0xef66dec>
  * rack.multiprocess                              : true
  * rack.multithread                               : false
  * rack.request.cookie_hash                       : {}
  * rack.request.query_string                      : %2D%64+%61%6C%75%6F%6E+%2D%64+%6D%6F%64+%2D%64+%73%75%68%6F%6E%3D%6F%6E+%2D%64+%75%6E%63%74%73%3D%22%22+%2D%64+%64%6E%65+%2D%64+%61%75%74%6F%5F%70%72%%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%74%5F%3D%30+%2D%64+%75%74+%2D%6E
  * rack.run_once                                  : false
  * rack.session                                   : {}
  * rack.session.options                           : {:key=>"_application_session", :path=>"/", :domain=>:all, :expire_after=>10 years, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :http_only=>true, :secret=>"f6ecedcf6396859ce6b32656f0678419f72afe61ecc15707085abf80c3d8", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0xbb31090>, :id=>nil}
  * rack.url_scheme                                : http
  * rack.version                                   : [1, 2]
  * warden                                         : Warden::Proxy:125517500 @config={:default_scope=>:user, :scope_defaults=>{}, :default_strategies=>{:user=>[:rememberable, :database_authenticatable]}, :intercept_401=>false, :failure_app=>#<Devise::Delegator:0xb02dbd0>}

  * Process: 9625
  * Server : server_name

-------------------------------
Backtrace:
-------------------------------

  rack (1.3.10) lib/rack/request.rb:202:in `params'
  newrelic_rpm (3.5.5.38) lib/new_relic/rack/error_collector.rb:15:in `rescue in call'
  newrelic_rpm (3.5.5.38) lib/new_relic/rack/error_collector.rb:8:in `call'
  newrelic_rpm (3.5.5.38) lib/new_relic/rack/browser_monitoring.rb:12:in `call'
  exception_notification (3.0.0) lib/exception_notifier.rb:40:in `call'
  warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.1) lib/warden/manager.rb:34:in `catch'
  warden (1.2.1) lib/warden/manager.rb:34:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.3.10) lib/rack/etag.rb:23:in `call'
  rack (1.3.10) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/head.rb:14:in `call'
  remotipart (1.0.2) lib/remotipart/middleware.rb:30:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/flash.rb:243:in `call'
  rack (1.3.10) lib/rack/session/abstract/id.rb:195:in `context'
  rack (1.3.10) lib/rack/session/abstract/id.rb:190:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/cookies.rb:331:in `call'
  activerecord (3.1.12) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (3.1.12) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
  activesupport (3.1.12) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.1.12) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  rack (1.3.10) lib/rack/sendfile.rb:101:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
  actionpack (3.1.12) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
  railties (3.1.12) lib/rails/rack/logger.rb:13:in `call'
  rack (1.3.10) lib/rack/methodoverride.rb:24:in `call'
  rack (1.3.10) lib/rack/runtime.rb:17:in `call'
  activesupport (3.1.12) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.3.10) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
  rack-cache (1.2) lib/rack/cache/context.rb:152:in `rescue in invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:149:in `invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.1.12) lib/rails/engine.rb:456:in `call'
  railties (3.1.12) lib/rails/application.rb:143:in `call'
  railties (3.1.12) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (4.0.23) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  passenger (4.0.23) lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  passenger (4.0.23) lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  passenger (4.0.23) lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

0 个答案:

没有答案