Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

API /stashes returns internal error #1365

Closed
darwin67 opened this issue Jul 8, 2016 · 6 comments
Closed

API /stashes returns internal error #1365

darwin67 opened this issue Jul 8, 2016 · 6 comments

Comments

@darwin67
Copy link

darwin67 commented Jul 8, 2016

Hi,

I'm using Ubuntu 14.04 and using a wrapper of sensu-chef cookbook.
The sensu version I'm pinning to is 0.25.3-1.

I'm seeing the following log repeating in sensu-api.log.

{"timestamp":"2016-07-08T22:52:43.026457+0000","level":"info","message":"api response","request":{"remote_address":"127.0.0.1","user_agent":"Go-http-client/1.1","method":"GET","uri":"/stashes","query_string":null,"body":""},"status":500,"content_length":59}

This looks really like #1332 but my files seems to be correctly generated from chef.

config.json

{
  "transport": {
    "reconnect_on_error": true
  },
  "rabbitmq": {
    "host": "127.0.0.1",
    "port": 5671,
    "vhost": "/sensu",
    "user": "sensu",
    "password": "xxxx",
    "ssl": {
      "cert_chain_file": "/etc/sensu/ssl/cert.pem",
      "private_key_file": "/etc/sensu/ssl/key.pem"
    }
  },
  "redis": {
    "host": "127.0.0.1",
    "port": 6379,
    "reconnect_on_error": true
  },
  "api": {
    "host": "127.0.0.1",
    "bind": "127.0.0.1",
    "port": 4567
  },
  "handlers": {
    ...
  },
  "checks": {}
}

Also confirmed that both sensu-server and sensu-api connects to redis when restarting it so doesn't seem to be the related to #1209

Tried querying localhost:4567 and got this.

{
    error: "redis and transport connections not initialized"
}

Downgrading to 0.22.1-1 will work gracefully but anything above 0.23 will not work.

Any ideas what's happening here?

@portertech
Copy link
Contributor

@darwin67 this error suggests that the transport connection has not yet initialized. Is the API able to connect?

@darwin67
Copy link
Author

Thank you for the response.
I need to work on something else for now and can't really check on it so I'm closing this issue for the moment.

I'll check on the API as proposed once I got the time and would reopen it if I still have any issue.

Thanks

@darwin67
Copy link
Author

Looks like it was my configuration problem. It's working now. Thank you.

@mikaoelitiana
Copy link

@darwin67 can you mention the changes you made to your configuration?

@darwin67
Copy link
Author

darwin67 commented Nov 4, 2016

it's quite a while ago so i don't really remember, but i think i've set the host explicitly.

something like this.

default['sensu']['rabbitmq']['host'] = 'hello.world@example.com'

@kingzus
Copy link

kingzus commented Nov 12, 2016

i alse met the same issue.

{
error: "redis and transport connections not initialized"
}

the sensu server config.json as follows:

{
  "transport":{
    "reconnect_on_error": true
   },
  "rabbitmq": {
    "host": "localhost",
    "port": 5672,
    "user": "sensu",
    "password": "xxxxxx",
    "vhost": "/sensu"
  },
  "redis": {
    "host": "127.0.0.1",
    "port": 6379,
   "reconnect_on_error": true
  },
  "api": {
    "host": "10.8.10.110",
    "port": 4567
  }
}

rabbitmq server version: 3.6.5-1
Both redis and rabbitmq are work well.
rabbitmq sensu user and paswor also have been created.

curl -i -u sensu:xxxxxx http://127.0.0.1:15672/api/whoami
HTTP/1.1 401 Unauthorized
vary: origin
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Sat, 12 Nov 2016 12:27:35 GMT
Content-Type: application/json
Content-Length: 50

{"error":"not_authorised","reason":"Login failed"}
curl -i -u sensu:zeasn161111 http://127.0.0.1:15672/api/whoami
HTTP/1.1 401 Unauthorized
vary: origin
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Sat, 12 Nov 2016 12:29:21 GMT
Content-Type: application/json
Content-Length: 57

{"error":"not_authorised","reason":"Not management user"}

when i found this error , i set the rabbitmq sensu user as management. the issue no longer appeard.

rabbitmqctl set_user_tags sensu management

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants