NoMethodError after reconnect #359

eflukx opened this Issue Nov 16, 2015 · 5 comments


None yet

3 participants

eflukx commented Nov 16, 2015

Bunny is not reconnecting as expected after network issues. Bunny connection was setup using :automatically_recover=>true. After reconnecting the following happens. Parsing error of bogus data? I'm using RabbitMQ v 3.4.4 on Ubuntu as AMQP server. The bunny client is running on Windows 7 x64, MRI v2.2.

E, [2015-11-16T20:48:09.238787 #180960] ERROR -- #<Bunny::Session:0x45f4788, vhost=/, addresses=[]>: Got an exception when receiving data: An existing connection was forcibly closed by the remote host. (Errno::ECONNRESET)
W, [2015-11-16T20:48:09.313791 #180960]  WARN -- #<Bunny::Session:0x45f4788, vhost=/, addresses=[]>: Recovering from a network failure...
W, [2015-11-16T20:48:19.346365 #180960]  WARN -- #<Bunny::Session:0x45f4788, vhost=/, addresses=[]>: Retrying connection on next host in line:
W, [2015-11-16T20:48:34.160212 #180960]  WARN -- #<Bunny::Session:0x45f4788, vhost=/, addresses=[]>: TCP connection failed, reconnecting in 5.0 seconds
W, [2015-11-16T20:48:44.200787 #180960]  WARN -- #<Bunny::Session:0x45f4788, vhost=/, addresses=[]>: Retrying connection on next host in line:
C:/Ruby22/lib/ruby/gems/2.2.0/gems/amq-protocol-2.0.0/lib/amq/protocol/frame.rb:62:in `decode_header': undefined method `unpack' for #<Hash:0x45f4260> (NoMethodError)
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bunny-2.2.1/lib/bunny/transport.rb:245:in `read_next_frame'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bunny-2.2.1/lib/bunny/reader_loop.rb:68:in `run_once'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bunny-2.2.1/lib/bunny/reader_loop.rb:35:in `block in run_loop'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bunny-2.2.1/lib/bunny/reader_loop.rb:32:in `loop'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bunny-2.2.1/lib/bunny/reader_loop.rb:32:in `run_loop'

We need a traffic capture to suggest something. A hash coming from the parser sounds pretty odd.

If you have a way to reproduce, please capture traffic with Wireshark and post your dump somewhere.

eflukx commented Nov 16, 2015

Dam'n you're fast 🚀

Just updated my Windows WiFi driver, if that seems to cure the issue I'll downgrade to unfix the issue and see if i can reproduce the problem.

eflukx commented Nov 16, 2015

Done: see this gist

Triggered the issue by switching off my access point.


I cannot reproduce this and we haven't seen this reported elsewhere => considering this environment-specific :(

@michaelklishin michaelklishin self-assigned this Dec 10, 2015
djmb commented Mar 15, 2016

I've also seen this issue and I've managed to fix it in my case with this PR: #387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment