Bootstrap FreeKB - RabbitMQ - Resolve "Error on AMQP connection" with a Shovel
RabbitMQ - Resolve "Error on AMQP connection" with a Shovel

Updated:   |  RabbitMQ articles

Let's say your rabbit.log has something like this.

2022-02-13 02:00:04.049 [info] <0.22410.126> Error on AMQP connection <0.18236.1> (10.5.0.1:57763 -> 10.5.0.2:5672 - Shovel foo.shovel, vhost:'foo', user: 'john.doe', state: running), channel 0:

 

This means there was some error with the AMQP connection for the shovel named "foo.shovel" from the RabbitMQ servers with IP address 10.5.0.1 to the RabbitMQ server with IP address 10.5.0.2. 

This is a fairly common event in the rabbit.log when the RabbitMQ server is restarted. If the RabbitMQ server on is restarted, the rabbit.log will often contain these "Error on AMQP connection" events shortly after the RabbitMQ server was asked to stop. In this scenario, you can simply review the rabbit.log to see if the RabbitMQ server was restarted shortly before the "Error on AMQP connection" event was appended to the rabbit.log.

2022-02-13 02:00:03.997 [info] <0.22410.126> RabbitMQ is asked to stop...

 

If this is a stand alone instance of RabbitMQ, the shovel should reconnect after the RabbitMQ server has restarted and is up and running again. When the RabbitMQ server is starting up, you should see something like this in rabbit.log.

2022-02-13 02:00:48.925 [info] <0.274.0>
  Starting RabbitMQ 3.8.15 on Erlang 23.3.4.3
  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
  Licensed under the MPL 2.0. Website: https://rabbitmq.com 

 

And then something like this.

2022-02-13 02:01:08.816 [info] <0.1894.0> Server startup complete; 8 plugins started.

 

And then you should see the shovel reconnection.

2022-02-13 02:02:08.104 [info] accepting AMQP connection <0.5841.0> (10.5.0.1:53904 -> 10.5.0.2:5672)
2022-02-13 02:02:08.156 [info] Connection <0.5841.0> (10.5.0.1:53904 -> 10.5.0.2:5672) has a client-provided name: Shovel foo.shovel
2022-02-13 02:02:08.210 [info] connection <0.5841.0> (10.5.0.1:53904 -> 10.5.0.2:5672 - Shovel foo.shovel): user: 'garden_shovel' authenticated and granted access to vhost 'foo'

 

If you have two or more RabbitMQ servers in a cluster, when one of the servers is restarted, the shovel should reconnect to one of the other servers in the cluster. In this scenario, you should see the "accepting AMQP connection" event in the rabbit.log on one of the other RabbitMQ servers in the cluster.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter bd7c12 in the box below so that we can be sure you are a human.