bad_header for AMQP connection while connecting sensu-client to server
Asked Answered
B

2

12

I have installed sensu with chef community cookbook. However, sensu client fails to connect to server. Results in rabbitmq connection error with message timed out while attempting to connect

Here are detailed client logs

logs from sensu-client.log

"timestamp":"2014-07-08T12:39:33.982647+0000","level":"warn","message":"config file applied changes","config_file":"/etc/sensu/conf.d/config.json","changes":{"rabbitmq":{"heartbeat":[null,20]},"client":[null,{"name":"girija-sensu-client","address":"test sensu client","subscriptions":["test-node"]}],"version":[null,"0.12.6-4"]}}
{"timestamp":"2014-07-08T12:39:33.996680+0000","level":"info","message":"loaded extension","type":"mutator","name":"only_check_output","description":"returns check output"}
{"timestamp":"2014-07-08T12:39:34.000721+0000","level":"info","message":"loaded extension","type":"handler","name":"debug","description":"outputs json event data"}
{"timestamp":"2014-07-08T12:39:34.104300+0000","level":"warn","message":"reconnecting to rabbitmq"}
{"timestamp":"2014-07-08T12:39:39.108623+0000","level":"warn","message":"reconnecting to rabbitmq"}
{"timestamp":"2014-07-08T12:39:44.111818+0000","level":"warn","message":"reconnecting to rabbitmq"}
{"timestamp":"2014-07-08T12:39:49.115250+0000","level":"warn","message":"reconnecting to rabbitmq"}
{"timestamp":"2014-07-08T12:39:54.045648+0000","level":"fatal","message":"rabbitmq connection error","error":"timed out while attempting to connect"}

Rabbitmq logs from server show following error

=INFO REPORT==== 8-Jul-2014::12:39:54 ===
accepting AMQP connection <0.395.0> (10.254.153.131:42813 -> 10.254.130.25:5672)

=ERROR REPORT==== 8-Jul-2014::12:39:54 ===
closing AMQP connection <0.395.0> (10.254.153.131:42813 -> 10.254.130.25:5672):
{bad_header,<<129,15,1,3,3,0,246,0>>}

I am running this on CentOS 6.4 on AWS Rabbitmq version 3.0.4 Erlang_version, "Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:30] [kernel-poll:true]\n"},

bad_header suggests mismatch for client and broker AMQP version. Any help for finding out AMQP version and fixing this problem

Basipetal answered 8/7, 2014 at 13:1 Comment(0)
H
9

This issue was caused, in my case, when my client was configured to use ssl authentication, but the rabbitmq server was not properly configured to use ssl and instead was expecting "plain" user/pass login with no ssl.

Humectant answered 15/10, 2014 at 20:54 Comment(1)
I had the opposite problem -- my /etc/config.json specified use of the plaintext port when the rabbit server was configured to only use SSL. Changing the port setting got the Sensu client working again.Stralka
I
0

I had the same issue when posting messages in rabbitmq from an .http file in Visual Studio Code with REST Client plugin.

The issue was that the port i was connecting to was 5672 which is the AMQP API one.

Changing the port to 15672 makes the call to the HTTP API and it works

Infrangible answered 25/4 at 9:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.