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

GELF::Notifier#serialize_hash fails when attempting to read 'rack.errors' #44

Open
rthbound opened this issue Apr 22, 2016 · 4 comments

Comments

@rthbound
Copy link

rthbound commented Apr 22, 2016

Hi, I'm using graylog with rails 5 (edge)... I've found that GELF::Notifier now fails here: https://github.com/Graylog2/gelf-rb/blob/master/lib/gelf/notifier.rb#L254 ...

Tracing the code, I see that the error occurs when calling #as_json on #IO:

IOError: not opened for reading.

I believe this is because we're attempting to read $stderr, which is write-only.

ping @joschi

@rthbound
Copy link
Author

rthbound commented Jun 6, 2016

@joschi any ideas?

@rthbound rthbound changed the title Trouble with GELF::Notifier#serialize_hash and latest Rack GELF::Notifier#serialize_hash fails when attempting to read 'rack.errors' Jun 6, 2016
@rthbound
Copy link
Author

rthbound commented Jun 6, 2016

Pinging a few others: @bernd @dennisoelkers @edmundoa @mariussturm (please don't hate me 😄 )

Is this a new problem? Have you guys coded around this previously? As far as I can see, rack.errors has always held a STDERR stream (and has always been write-only). Was there some code written to skip over rack.errors, to rescue from IOErrors, something else?

Looking forward to using graylog when rails5 comes out, but it looks like this error will prevent that.

Edit: another possibility is that #as_json's behavior has changed (maybe it's become less forgiving)

@milgner
Copy link
Contributor

milgner commented Aug 21, 2016

Hi @rthbound,

thank you for bringing this to our attention! Do you happen to have a full backtrace of the problem at hand? It would be interesting to see how the rack.errors find their way into the hash at all since I'd guess that this gem is not the only logger that might have trouble working with those.

@rthbound
Copy link
Author

rthbound commented Sep 9, 2016

@milgner apologies for the delay. It looks like others may be noticing this too, outside of the gelf-rb world. rails/rails/issues/26132

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