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

IOError not opened for reading #51

Closed
cschramm opened this issue Apr 26, 2013 · 9 comments
Closed

IOError not opened for reading #51

cschramm opened this issue Apr 26, 2013 · 9 comments
Assignees
Labels

Comments

@cschramm
Copy link

Suddenly I get an IOError in my development machine for every request.

It occures in activesupport-4.0.0.beta1/lib/active_support/json/encoding.rb, line 256:

254 module Enumerable
255   def as_json(options = nil) #:nodoc:
256     to_a.as_json(options)
257   end
258 end

which is triggered from meta_request-0.2.3/lib/meta_request/middlewares/app_request_handler.rb, line 21:

Storage.new(app_request.id).write(app_request.events.to_json) unless app_request.events.empty?

It seems to be the exact same issue as rollbar/rollbar-gem#32 and already appeared with meta_request in markevans/dragonfly#18.

@elfassy
Copy link

elfassy commented Apr 29, 2013

+1

@ghost ghost assigned dejan May 8, 2013
@shanesveller
Copy link

While #52 says that 0.2.5 should improve Rails 4 pre-release support, I am still seeing the above issue with this newer meta_request version and Rails 4.0 RC1. Perhaps one of my other dependencies is causing the conflict instead.

@dejan
Copy link
Owner

dejan commented May 10, 2013

Can you please paste your Gemfile. Thanks.

@shanesveller
Copy link

@dejan Here's a gist: https://gist.github.com/shanesveller/80a010c63b58c3f2bc7f

This is ultra low-priority for me, I'm only a hobby programmer experimenting with bumping a project app to Rails 4. I appreciate you taking the time to look at it whenever you like.

@zzemla
Copy link

zzemla commented May 11, 2013

+1

@zzemla
Copy link

zzemla commented May 11, 2013

Not sure if this will help, but quick research into this error shows that app_request.events contains 'process_action.action_controller' event which references (via payload[:request]) the current Rack::Request. Calling to_json on Rack::Request object fails for me, probably because it contains references to IO objects (like STDERR). Tested on ruby 2.0, Rails 4 RC1.

@dejan dejan mentioned this issue May 26, 2013
@dejan dejan closed this as completed in e5ad3ab May 26, 2013
@dejan
Copy link
Owner

dejan commented May 26, 2013

@shanesveller thank you very much for the Gemfile. It helped me recreate the issue and fix it. The newrelic_rpm gem set the payload[:request] that contained some closed IO as @zzemia discovered.

@dejan
Copy link
Owner

dejan commented May 26, 2013

Fix is in meta_request 0.2.6.

@cschramm
Copy link
Author

Works for me. Thanks!

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

No branches or pull requests

5 participants