Skip to content

undefined method `each' for nil:NilClass - lib/rack/body_proxy.rb:31 #100

@krainboltgreene

Description

@krainboltgreene

I've narrowed it down to rack-cache being involved. It only happens on rather large responses. This could also be a combination of rack-cache and moneta or even moneta, rack-cache, and the LRUHash storage. I'm experimenting now.

Here's my implementation:

rack.use(Rack::Cache, verbose: true, metastore: "moneta://LRUHash?expires=true", entitystore: "moneta://LRUHash?expires=true")

Here's the full request log:

source=rack-timeout id=65fd8ba3f3ae8c5573a131d6aac3fd21 timeout=15000ms state=ready at=info
source=rack-timeout id=65fd8ba3f3ae8c5573a131d6aac3fd21 timeout=15000ms duration=0ms state=active at=debug
D, [2014-09-19T13:08:02.584573 #55149] DEBUG -- :   Blankcrepe::Account::Abstract Load (42.9ms)  SELECT "accounts".* FROM "accounts"
source=rack-timeout id=65fd8ba3f3ae8c5573a131d6aac3fd21 timeout=15000ms duration=1002ms state=active at=debug
cache: [GET /accounts] miss, store
source=rack-timeout id=65fd8ba3f3ae8c5573a131d6aac3fd21 timeout=15000ms duration=1526ms state=completed at=info
::1 - - [19/Sep/2014:13:08:03 -0500] "GET /accounts HTTP/1.1" 200 3085574 1.5280
2014-09-19 13:08:03 -0500: Read error: #<NoMethodError: undefined method `each' for nil:NilClass>
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/rack-1.6.0.beta/lib/rack/body_proxy.rb:31:in `each'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/rack-1.6.0.beta/lib/rack/body_proxy.rb:31:in `each'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/rack-1.6.0.beta/lib/rack/body_proxy.rb:31:in `each'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/rack-1.6.0.beta/lib/rack/lint.rb:695:in `each'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/puma-2.9.1/lib/puma/server.rb:615:in `handle_request'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/puma-2.9.1/lib/puma/server.rb:361:in `process_client'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/puma-2.9.1/lib/puma/server.rb:254:in `block in run'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `call'
/Users/krainboltgreene/.rvm/gems/ruby-2.1.2@blankcrepe-api/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `block in spawn_thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions