Getting random AMQ::Protocol::EmptyResponseError when application is running

Skip to first unread message

Grant Schoep

Jun 20, 2019, 5:21:02 PM6/20/19
to Ruby RabbitMQ libraries
Using Ruby 2.6.3, bunny 2.14.1

So doing my applications run time, I keep seeing this error pattern

 .../lib/bunny/reader_loop.rb:132: Exception in the reader loop: AMQ::Protocol::EmptyResponseError: Empty response received from the server.
 .../lib/bunny/reader_loop.rb:133: Backtrace:
 .../lib/bunny/reader_loop.rb:135:  /my_app/vendor/bundle/ruby/2.6.0/gems/amq-protocol-2.3.0/lib/amq/protocol/frame.rb:60:in `decode_header'
 .../lib/bunny/reader_loop.rb:135:  /my_app/vendor/bundle/ruby/2.6.0/gems/bunny-2.14.1/lib/bunny/transport.rb:262:in `read_next_frame'
 .../lib/bunny/reader_loop.rb:135:  /my_app/vendor/bundle/ruby/2.6.0/gems/bunny-2.14.1/lib/bunny/reader_loop.rb:73:in `run_once'
 .../lib/bunny/reader_loop.rb:135:  /my_app/vendor/bundle/ruby/2.6.0/gems/bunny-2.14.1/lib/bunny/reader_loop.rb:39:in `block in run_loop'
 .../lib/bunny/reader_loop.rb:135:  /my_app/vendor/bundle/ruby/2.6.0/gems/bunny-2.14.1/lib/bunny/reader_loop.rb:36:in `loop'
 .../lib/bunny/reader_loop.rb:135:  /my_app/vendor/bundle/ruby/2.6.0/gems/bunny-2.14.1/lib/bunny/reader_loop.rb:36:in `run_loop'
 .../lib/bunny/session.rb:728: Will recover from a network failure (no retry limit)...

I have an app that is has multiple workers on the same queue. It seems to happen when on of those worker threads is "REALLY" busy on some IO action. However, the exception doesn't seem to be coming from that specific worker thread

Its happening on my production server, and my ability to really dig into it live is a bit more difficult.  The only thing I am pretty certain on is it is happeing when one of the worker threads for the queue is doing heavy IO, (in this case copying a large file between NFS volumes)

Any ideas on how to help reduce these? Or really, what is going on here?


Michael Klishin

Jun 22, 2019, 2:58:05 PM6/22/19
to Ruby RabbitMQ libraries
Increase socket read and heartbeat timeouts to, say, 30 or 60 or 90 seconds. That should
reduce the probability.
> --
> Bunny:
> March Hare:
> IRC: #rabbitmq on
> Post to the group: | unsubscribe:
> ---
> You received this message because you are subscribed to the Google Groups "Ruby RabbitMQ libraries" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> To view this discussion on the web visit
> For more options, visit

Reply all
Reply to author
0 new messages