Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
krainboltgreene opened this issue Sep 19, 2014 · 3 comments

Comments

@krainboltgreene
Copy link

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
@krainboltgreene
Copy link
Author

@body seems to be nil in the Rack::BodyProxy class, which means it's related to #74 and possibly another instance of fcb3fbb.

@krainboltgreene
Copy link
Author

This looks it's fixed, but not released? Why has it taken so long?

@fabn
Copy link

fabn commented Sep 11, 2015

Got the same issue and also found a solution in fcb3fbb

I was then pretty surprised that an issue fixed in 2012 is not released to rubygems yet. I'll point my gemfile to github to fix this, but it would be nice to have some news from @rtomayko about the status of this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants