1

在过去的几个月里,我们在生产中遇到了这个错误。

我不明白是什么导致了错误,我无法在开发中重现它。我的猜测与会话和 cookie 有关。

大多数错误来自 /cable 但它并不特定于此路径。对于其他路径,我们也有相同的错误和相同的回溯。

提前致谢。

undefined method `[]=' for nil:NilClass

环境

path    /cable
method  GET
Parameters  {}
Session data {}

HTTP_ACCEPT_ENCODING    gzip, deflate, br
HTTP_CACHE_CONTROL  no-cache
HTTP_CONNECTION Upgrade
HTTP_PRAGMA no-cache
PATH_INFO   /cable
REQUEST_METHOD  GET
REQUEST_URI /cable
SERVER_NAME unicorn
SERVER_PORT 80
SERVER_PROTOCOL HTTP/1.1

回溯

    actionpack (5.1.4) lib/action_dispatch/request/session.rb:217:in `load!'
    actionpack (5.1.4) lib/action_dispatch/request/session.rb:212:in `load_for_write!'
    actionpack (5.1.4) lib/action_dispatch/request/session.rb:197:in `merge!'
    actionpack (5.1.4) lib/action_dispatch/request/session.rb:17:in `create'
    actionpack (5.1.4) lib/action_dispatch/middleware/session/abstract_store.rb:70:in `prepare_session'
    rack (2.0.3) lib/rack/session/abstract/id.rb:231:in `context'
    rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
    activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_callbacks'
    actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
    appsignal (2.4.3) lib/appsignal/rack/rails_instrumentation.rb:30:in `call_with_appsignal_monitoring'
    appsignal (2.4.3) lib/appsignal/rack/rails_instrumentation.rb:15:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
    railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
    railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
    activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged'
    activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
    activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged'
    railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call'
    rack (2.0.3) lib/rack/method_override.rb:22:in `call'
    rack (2.0.3) lib/rack/runtime.rb:22:in `call'
    actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
    rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
    rack-mini-profiler (0.10.7) lib/mini_profiler/profiler.rb:171:in `call'
    railties (5.1.4) lib/rails/engine.rb:522:in `call'
    railties (5.1.4) lib/rails/railtie.rb:185:in `public_send'
    railties (5.1.4) lib/rails/railtie.rb:185:in `method_missing'
    unicorn (5.3.1) lib/unicorn/http_server.rb:606:in `process_client'
    unicorn (5.3.1) lib/unicorn/http_server.rb:702:in `worker_loop'
    appsignal (2.4.3) lib/appsignal/hooks/unicorn.rb:25:in `worker_loop'
    unicorn (5.3.1) lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
    unicorn (5.3.1) lib/unicorn/http_server.rb:563:in `maintain_worker_count'
    unicorn (5.3.1) lib/unicorn/http_server.rb:293:in `join'
    unicorn (5.3.1) bin/unicorn:126:in `<top (required)>'
    /home/deploy/apps/my_app/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
    /home/deploy/apps/my_app/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `<top (required)>'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
    /home/deploy/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>'
    /home/deploy/.rvm/gems/ruby-2.3.1/bin/bundle:23:in `load'
    /home/deploy/.rvm/gems/ruby-2.3.1/bin/bundle:23:in `<main>'
    /home/deploy/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    /home/deploy/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
4

0 回答 0