Detected TCP connection failure

I have installed sensu server using sensu-chef cookbook. The API is not starting. The error in the logs is the following:

{“timestamp”:“2014-01-02T16:58:27.658883+0000”,“level”:“error”,“message”:"[amqp] Detected TCP connection failure"}

The config file is the standard one:

/etc/sensu# cat config.json

{

“rabbitmq”: {

“host”: “192.168.33.100”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “password”

},

“redis”: {

“host”: “localhost”,

“port”: 6379

},

“api”: {

“host”: “localhost”,

“bind”: “0.0.0.0”,

“port”: 4567

},

“dashboard”: {

“bind”: “0.0.0.0”,

“port”: 8080,

“user”: “admin”,

“password”: “secret”

}

this is the config file for the API:

/etc/sensu# cat conf.d/api.json

{

“api”: {

“host”: “localhost”,

“port”: 4567,

“user”: "sensu,

“password”: “password”

}

}

This is the version of sensu installed on Ubuntu 13.04: 0.12.3-1

This is the hash passed to the API script:

/etc/sensu# service sensu-service api start

  • Starting sensu-api

["-b", “-c”, “/etc/sensu/config.json”, “-d”, “/etc/sensu/conf.d”, “-e”, “/etc/sensu/extensions”, “-p”, “/var/run/sensu/sensu-api.pid”, “-l”, “/var/log/sensu/sensu-api.log”, “-L”, “info”]

It seems that conf.d/api.json is not used?Or is it picked up from ‘/etc/sensu/conf.d’?

Any idea where to have a look?

The error message is from amqp so I would focus on checking rabbitmq logs. A common configuration issue is connecting to rabbitmq on the wrong port (ssl vs non-ssl, for instance)

···

On Thu, Jan 2, 2014 at 9:54 AM, Riccardo Tacconi rtacconi@gmail.com wrote:

I have installed sensu server using sensu-chef cookbook. The API is not starting. The error in the logs is the following:

{“timestamp”:“2014-01-02T16:58:27.658883+0000”,“level”:“error”,“message”:“[amqp] Detected TCP connection failure”}

The config file is the standard one:

/etc/sensu# cat config.json

{

“rabbitmq”: {

“host”: “192.168.33.100”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “password”

},

“redis”: {

“host”: “localhost”,

“port”: 6379

},

“api”: {

“host”: “localhost”,

“bind”: “0.0.0.0”,

“port”: 4567

},

“dashboard”: {

“bind”: “0.0.0.0”,

“port”: 8080,

“user”: “admin”,

“password”: “secret”

}

this is the config file for the API:

/etc/sensu# cat conf.d/api.json

{

“api”: {

“host”: “localhost”,

“port”: 4567,

“user”: "sensu,

“password”: “password”

}

}

This is the version of sensu installed on Ubuntu 13.04: 0.12.3-1

This is the hash passed to the API script:

/etc/sensu# service sensu-service api start

  • Starting sensu-api

[“-b”, “-c”, “/etc/sensu/config.json”, “-d”, “/etc/sensu/conf.d”, “-e”, “/etc/sensu/extensions”, “-p”, “/var/run/sensu/sensu-api.pid”, “-l”, “/var/log/sensu/sensu-api.log”, “-L”, “info”]

It seems that conf.d/api.json is not used?Or is it picked up from ‘/etc/sensu/conf.d’?

Any idea where to have a look?

From the rabbitmq logs I can see only this error:

=ERROR REPORT==== 2-Jan-2014::17:39:37 ===

webmachine error: path=“/api/whoami”

“Unauthorized”

···

On Thursday, 2 January 2014 18:30:25 UTC, Joe Miller wrote:

The error message is from amqp so I would focus on checking rabbitmq logs. A common configuration issue is connecting to rabbitmq on the wrong port (ssl vs non-ssl, for instance)

On Thu, Jan 2, 2014 at 9:54 AM, Riccardo Tacconi rtac...@gmail.com wrote:

I have installed sensu server using sensu-chef cookbook. The API is not starting. The error in the logs is the following:

{“timestamp”:“2014-01-02T16:58:27.658883+0000”,“level”:“error”,“message”:“[amqp] Detected TCP connection failure”}

The config file is the standard one:

/etc/sensu# cat config.json

{

“rabbitmq”: {

“host”: “192.168.33.100”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “password”

},

“redis”: {

“host”: “localhost”,

“port”: 6379

},

“api”: {

“host”: “localhost”,

“bind”: “0.0.0.0”,

“port”: 4567

},

“dashboard”: {

“bind”: “0.0.0.0”,

“port”: 8080,

“user”: “admin”,

“password”: “secret”

}

this is the config file for the API:

/etc/sensu# cat conf.d/api.json

{

“api”: {

“host”: “localhost”,

“port”: 4567,

“user”: "sensu,

“password”: “password”

}

}

This is the version of sensu installed on Ubuntu 13.04: 0.12.3-1

This is the hash passed to the API script:

/etc/sensu# service sensu-service api start

  • Starting sensu-api

[“-b”, “-c”, “/etc/sensu/config.json”, “-d”, “/etc/sensu/conf.d”, “-e”, “/etc/sensu/extensions”, “-p”, “/var/run/sensu/sensu-api.pid”, “-l”, “/var/log/sensu/sensu-api.log”, “-L”, “info”]

It seems that conf.d/api.json is not used?Or is it picked up from ‘/etc/sensu/conf.d’?

Any idea where to have a look?

That looks like an error from the rabbitmq_management http api, which shouldn’t be related to sensu which only talks to rabbit over amqp ports.

There are a couple good tips on approaching the diagnosis of this problem in this SO thread even though it is not specific to Sensu: http://stackoverflow.com/questions/11637998/suddenly-possibleauthenticationfailureerror-in-amqp

With regards to the credentials, ensure you have created the sensu user correctly and given it perms to the sensu vhost since that is what you have listed in your config json:

rabbitmqctl add_vhost /sensu rabbitmqctl add_user sensu mypass rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"
···

On Fri, Jan 3, 2014 at 3:02 AM, Riccardo Tacconi rtacconi@gmail.com wrote:

From the rabbitmq logs I can see only this error:

=ERROR REPORT==== 2-Jan-2014::17:39:37 ===

webmachine error: path=“/api/whoami”

“Unauthorized”

On Thursday, 2 January 2014 18:30:25 UTC, Joe Miller wrote:

The error message is from amqp so I would focus on checking rabbitmq logs. A common configuration issue is connecting to rabbitmq on the wrong port (ssl vs non-ssl, for instance)

On Thu, Jan 2, 2014 at 9:54 AM, Riccardo Tacconi rtac...@gmail.com wrote:

I have installed sensu server using sensu-chef cookbook. The API is not starting. The error in the logs is the following:

{“timestamp”:“2014-01-02T16:58:27.658883+0000”,“level”:“error”,“message”:“[amqp] Detected TCP connection failure”}

The config file is the standard one:

/etc/sensu# cat config.json

{

“rabbitmq”: {

“host”: “192.168.33.100”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “password”

},

“redis”: {

“host”: “localhost”,

“port”: 6379

},

“api”: {

“host”: “localhost”,

“bind”: “0.0.0.0”,

“port”: 4567

},

“dashboard”: {

“bind”: “0.0.0.0”,

“port”: 8080,

“user”: “admin”,

“password”: “secret”

}

this is the config file for the API:

/etc/sensu# cat conf.d/api.json

{

“api”: {

“host”: “localhost”,

“port”: 4567,

“user”: "sensu,

“password”: “password”

}

}

This is the version of sensu installed on Ubuntu 13.04: 0.12.3-1

This is the hash passed to the API script:

/etc/sensu# service sensu-service api start

  • Starting sensu-api

[“-b”, “-c”, “/etc/sensu/config.json”, “-d”, “/etc/sensu/conf.d”, “-e”, “/etc/sensu/extensions”, “-p”, “/var/run/sensu/sensu-api.pid”, “-l”, “/var/log/sensu/sensu-api.log”, “-L”, “info”]

It seems that conf.d/api.json is not used?Or is it picked up from ‘/etc/sensu/conf.d’?

Any idea where to have a look?

sorry guys, I was focussed on the ports but the problem was the wrong IP since it was loaded from a variable stored in the environment.

···

On 3 January 2014 15:39, Joe Miller joeym@joeym.net wrote:

That looks like an error from the rabbitmq_management http api, which shouldn’t be related to sensu which only talks to rabbit over amqp ports.

There are a couple good tips on approaching the diagnosis of this problem in this SO thread even though it is not specific to Sensu: http://stackoverflow.com/questions/11637998/suddenly-possibleauthenticationfailureerror-in-amqp

With regards to the credentials, ensure you have created the sensu user correctly and given it perms to the sensu vhost since that is what you have listed in your config json:

rabbitmqctl add_vhost /sensu rabbitmqctl add_user sensu mypass rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"


Riccardo Tacconi
Ruby on Rails and PHP development - System Administration
VIRTUELOGIC LIMITED

http://github.com/rtacconi
http://riccardotacconi.blogspot.com
http://twitter.com/rtacconi

On Fri, Jan 3, 2014 at 3:02 AM, Riccardo Tacconi rtacconi@gmail.com wrote:

From the rabbitmq logs I can see only this error:

=ERROR REPORT==== 2-Jan-2014::17:39:37 ===

webmachine error: path=“/api/whoami”

“Unauthorized”

On Thursday, 2 January 2014 18:30:25 UTC, Joe Miller wrote:

The error message is from amqp so I would focus on checking rabbitmq logs. A common configuration issue is connecting to rabbitmq on the wrong port (ssl vs non-ssl, for instance)

On Thu, Jan 2, 2014 at 9:54 AM, Riccardo Tacconi rtac...@gmail.com wrote:

I have installed sensu server using sensu-chef cookbook. The API is not starting. The error in the logs is the following:

{“timestamp”:“2014-01-02T16:58:27.658883+0000”,“level”:“error”,“message”:“[amqp] Detected TCP connection failure”}

The config file is the standard one:

/etc/sensu# cat config.json

{

“rabbitmq”: {

“host”: “192.168.33.100”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “password”

},

“redis”: {

“host”: “localhost”,

“port”: 6379

},

“api”: {

“host”: “localhost”,

“bind”: “0.0.0.0”,

“port”: 4567

},

“dashboard”: {

“bind”: “0.0.0.0”,

“port”: 8080,

“user”: “admin”,

“password”: “secret”

}

this is the config file for the API:

/etc/sensu# cat conf.d/api.json

{

“api”: {

“host”: “localhost”,

“port”: 4567,

“user”: "sensu,

“password”: “password”

}

}

This is the version of sensu installed on Ubuntu 13.04: 0.12.3-1

This is the hash passed to the API script:

/etc/sensu# service sensu-service api start

  • Starting sensu-api

[“-b”, “-c”, “/etc/sensu/config.json”, “-d”, “/etc/sensu/conf.d”, “-e”, “/etc/sensu/extensions”, “-p”, “/var/run/sensu/sensu-api.pid”, “-l”, “/var/log/sensu/sensu-api.log”, “-L”, “info”]

It seems that conf.d/api.json is not used?Or is it picked up from ‘/etc/sensu/conf.d’?

Any idea where to have a look?