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

Improve "Whoa we shouldn't get this frame" message #22

Open
ph opened this issue Jul 29, 2016 · 3 comments
Open

Improve "Whoa we shouldn't get this frame" message #22

ph opened this issue Jul 29, 2016 · 3 comments

Comments

@ph
Copy link
Contributor

ph commented Jul 29, 2016

This error can happen when an incorrect frame is send back from the server and its confusing and hard to debug. I suggest that we at least include the frame_type that we received to get a better ideas of what actually happened.

Just a note the only frame that the server can send is A so I dont know what actually is happenning here. Probably something bad was raised on the server side?

@jordansissel
Copy link
Contributor

jordansissel commented Jul 29, 2016

The frame type is included. https://github.com/elastic/ruby-lumberjack/blob/master/lib/lumberjack/client.rb#L146

The unmentioned reporting case for this is the user was reporting this error message (excuse any typos, I am transcribing from a screenshot):

Client write error, trying to connect {:e =#<RuntimeError: Whoa we shouldn't get this frame: >, ...

In this case, it looks like the type trying to be logged was actually an empty string or a nil (both to_s to empty strings). This could be caused by the socket read returning nil or empty string for the frame type in the read_version_and_type method - https://github.com/elastic/ruby-lumberjack/blob/master/lib/lumberjack/client.rb#L158

My belief in this is based on the exception text:

#<RuntimeError: Whoa we shouldn't get this frame: >

And the exception message code:

Whoa we shouldn't get this frame: #{type}

As you can see in the RuntimeError, the text ends frame: followed by a space. (The > is just Ruby's way of showing you an object inspection, #<SomeClass ....>, and is not part of the text).

@aadicodes
Copy link

Any further progress on this issue ? I am facing the same error while trying to ship log from one logstash to another using lumberjack output plugin.
}Client write error, trying connect {:e=>#<RuntimeError: Whoa we shouldn't get this frame: >, :backtrace=>["/opt/logstash/logstash/vendor/bundle/jruby/1.9/gems/jls-lumberjack-0.0.26/lib/lumberjack/client.rb:146:in `ack'", ...

@jsdumont
Copy link

Same issue here. Logstash 5.6.2 sending to another logstash through lumberjack

[ERROR][logstash.outputs.lumberjack] Client write error, trying connect {:e=>#<RuntimeError: Whoa we shouldn't get this frame: >, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/jls-lumberjack-0.0.26/lib/lumberjack/client.rb:146:in ack'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/jls-lumberjack-0.0.26/lib/lumberjack/client.rb:134:in write_sync'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/jls-lumberjack-0.0.26/lib/lumberjack/client.rb:42:in write'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-lumberjack-3.1.5/lib/logstash/outputs/lumberjack.rb:65:in flush'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.23/lib/stud/buffer.rb:219:in buffer_flush'", "org/jruby/RubyHash.java:1342:in each'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.23/lib/stud/buffer.rb:216:in buffer_flush'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.23/lib/stud/buffer.rb:193:in buffer_flush'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.23/lib/stud/buffer.rb:159:in buffer_receive'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-lumberjack-3.1.5/lib/logstash/outputs/lumberjack.rb:52:in register'", "org/jruby/RubyProc.java:281:in call'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.4/lib/logstash/codecs/json.rb:42:in encode'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-lumberjack-3.1.5/lib/logstash/outputs/lumberjack.rb:59:in receive'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:92:in multi_receive'", "org/jruby/RubyArray.java:1613:in each'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:92:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/legacy.rb:22:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:49:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:436:in output_batch'", "org/jruby/RubyHash.java:1342:in each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:435:in output_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:381:in worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:342:in `start_workers'"]}

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

4 participants