shinken-solutions / shinken

Flexible and scalable monitoring framework
http://www.shinken-monitoring.org
GNU Affero General Public License v3.0
1.14k stars 335 forks source link

No Backend Available error from thruk #1893

Open shilpa-karri opened 7 years ago

shilpa-karri commented 7 years ago

Hello,

Getting the below error from Thruk.

No Backend available None of the configured Backends could be reached, please have a look at the logfile for detailed information and make sure the core is up and running.

Details: Shinken: ERROR: failed to connect - Connection refused (localhost:50000)

Restarted Shinken, Mongo Database and Thruk, but no Luck.

Following error is seen in thruk log:

[2017/02/21 11:00:12][freppau-lrsup01][ERROR][Thruk] No Backend available [2017/02/21 11:00:12][freppau-lrsup01][ERROR][Thruk] on page: https://freppau-lrsup01/thruk/cgi-bin/status.cgi?hostgroup=all&style=hostdetail&_=1487671212632 [2017/02/21 11:00:12][freppau-lrsup01][ERROR][Thruk] Shinken: ERROR: failed to connect - Connection refused (localhost:50000) [2017/02/21 11:01:44][freppau-lrsup01][ERROR][Thruk] No Backend available [2017/02/21 11:01:44][freppau-lrsup01][ERROR][Thruk] on page: https://freppau-lrsup01/thruk/cgi-bin/status.cgi?hostgroup=all&style=hostdetail&_=1487671304131 [2017/02/21 11:01:44][freppau-lrsup01][ERROR][Thruk] Shinken: ERROR: failed to connect - Connection refused (localhost:50000)

Please help resolving this issue.

shilpa-karri commented 7 years ago

Got the following from broker logs:

2017-02-22 11:58:47,306 [1487761127] Info : [Broker-Prime] [livestatus[4286]]: Now running.. 2017-02-22 11:58:47,313 [1487761127] Info : [LogstoreMongoDB] Get an LogStore MongoDB module for plugin logstore-mongodb 2017-02-22 11:58:48,316 [1487761128] Info : Trying to init module: logstore-mongodb 2017-02-22 11:58:48,316 [1487761128] Info : I correctly loaded the modules: [logstore-mongodb] 2017-02-22 11:58:48,316 [1487761128] Info : [Livestatus Broker] Go run 2017-02-22 11:58:48,357 [1487761128] Info : [Livestatus Broker] Livestatus query thread started 2017-02-22 11:58:48,357 [1487761128] Info : [Livestatus Broker] listening on tcp port: 50000 2017-02-22 11:58:48,358 [1487761128] Info : [Livestatus Broker] listening on unix socket: /var/run/shinken/rw/live 2017-02-22 11:58:48,647 [1487761128] Info : [Broker-Prime] The module None is asking me to get all initial data from the scheduler 0 2017-02-22 11:58:48,647 [1487761128] Error : [Broker-Prime] the module livestatus just crash! Please look at the traceback: 2017-02-22 11:58:48,648 [1487761128] Error : [Broker-Prime] Traceback (most recent call last): File "/var/lib/shinken/modules/livestatus/module.py", line 225, in main self.do_main() File "/var/lib/shinken/modules/livestatus/module.py", line 286, in do_main self.manage_lql_thread() File "/var/lib/shinken/modules/livestatus/module.py", line 482, in manage_lql_thread self.db.commit_and_rotate_log_db() File "/var/lib/shinken/modules/logstore-mongodb/module.py", line 191, in commit_and_rotate_log_db self.db[self.collection].remove({u'time': {'$lt': time.mktime(oldest.timetuple())}}) File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 563, in remove options, self.uuid_subtype), safe) File "/usr/lib64/python2.6/site-packages/pymongo/mongo_replica_set_client.py", line 1360, in _send_message rv = self.check_response_to_last_error(response) File "/usr/lib64/python2.6/site-packages/pymongo/mongo_replica_set_client.py", line 1273, in __check_response_to_last_error raise OperationFailure(error["err"]) OperationFailure: n >= 0 && n < static_cast(_files.size()) 2017-02-22 11:58:50,464 [1487761130] Info : [Livestatus Broker] So I quit

geektophe commented 7 years ago

It seems the livestatus module fails to communicate with your mongodb instance.

What version of pymogo and mongodb server are you using ?