Alignak-monitoring-contrib / alignak-module-backend

Alignak modules (arbiter, broker, scheduler) for the backend
GNU Affero General Public License v3.0
0 stars 2 forks source link

livestate update, when etag do not match, connection is broken #95

Closed mohierf closed 6 years ago

mohierf commented 7 years ago

Indeed two problems:

[2017-07-19 12:04:20 CEST] ERROR: [alignak.module.backend_broker] Patch livestate for service 594b757e99fe63592c61080e error
[2017-07-19 12:04:20 CEST] ERROR: [alignak.module.backend_broker] Data: {'ls_output': u'Ok - Init', 'ls_last_state': u'OK', 'ls_last_time_ok': 1500458659, 'ls
_last_time_unknown': 0, '_realm': u'596e000599fe63be81d55ef4', 'ls_perf_data': u'', 'ls_attempt': 1, 'ls_last_time_unreachable': 0, 'ls_last_time_warning': 0,
 'ls_last_check': 1500458658, 'ls_last_state_type': u'HARD', 'ls_long_output': u'Ok - Init', 'ls_last_hard_state_changed': 1500271202, 'ls_acknowledged': Fals
e, 'ls_state_id': 0, 'ls_last_time_critical': 0, 'ls_acknowledgement_type': 1, 'ls_latency': 0.8079500198, 'ls_downtimed': False, 'ls_last_state_changed': 150
0271202.275111, 'ls_state': u'OK', 'ls_execution_time': 0, 'ls_state_type': u'HARD'}
[2017-07-19 12:04:20 CEST] ERROR: [alignak.module.backend_broker] Exception: Backend error code 412: {"_status": "ERR", "_error": {"message": "Client and serv
er etags don't match", "code": 412}}, response: <Response [412]>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/alignak_module_backend-0.6.7-py2.7.egg/alignak_module_backend/broker/module.py", line 501, in send_to_backend
    data, headers, True)
  File "/usr/local/lib/python2.7/site-packages/alignak_backend_client/client.py", line 640, in patch
    data=data, headers=headers, inception=False
  File "/usr/local/lib/python2.7/site-packages/alignak_backend_client/client.py", line 643, in patch
    raise BackendException(412, response.content, response)
BackendException: Backend error code 412: {"_status": "ERR", "_error": {"message": "Client and server etags don't match", "code": 412}}, response: <Response [
412]>
[2017-07-19 12:04:20 CEST] ERROR: [alignak.module.backend_broker] Alignak backend connection is not available. Skipping objects update.
mohierf commented 7 years ago

Still another error:

[2017-07-19 12:54:06 CEST] ERROR: [alignak.module.backend_broker] Patch livestate for host 594b5c1b99fe63592d60bd9b error
[2017-07-19 12:54:06 CEST] ERROR: [alignak.module.backend_broker] Data: {'ls_output': u'EK3022FDJ-00014 is alive, uptime is 21230 seconds (0 days 5 hours 53 minutes 50 seconds 847 ms)', 'ls_last_time_up': 1500461642, 'ls_last_time_down': 0, 'ls_last_time_unknown': 0, '_realm': u'596e000599fe63be81d55ef4', 'ls_perf_data': u"'Uptime'=21230", 'ls_attempt': 1, 'ls_execution_time': 0.0, 'ls_last_check': 1500461641, 'ls_last_state_type': u'HARD', 'ls_long_output': u'', 'ls_last_hard_state_changed': 0.0, 'ls_acknowledged': False, 'ls_state_id': 0, 'ls_acknowledgement_type': 1, 'ls_latency': 0, 'ls_downtimed': False, 'ls_last_state_changed': 0.0, 'ls_state': u'UP', 'ls_last_time_unreachable': 0, 'ls_state_type': u'HARD', 'ls_last_state': u'UP'}
[2017-07-19 12:54:06 CEST] ERROR: [alignak.module.backend_broker] Exception: Backend error code 1000: Backend connection error, response: None
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/alignak_module_backend-0.6.7-py2.7.egg/alignak_module_backend/broker/module.py", line 485, in send_to_backend
    data, headers, True)
  File "/usr/local/lib/python2.7/site-packages/alignak_backend_client/client.py", line 640, in patch
    data=data, headers=headers, inception=False
  File "/usr/local/lib/python2.7/site-packages/alignak_backend_client/client.py", line 621, in patch
    raise BackendException(1000, "Backend connection error")
BackendException: Backend error code 1000: Backend connection error, response: None
[2017-07-19 12:54:06 CEST] ERROR: [alignak.module.backend_broker] Alignak backend connection is not available. Skipping objects update.
mohierf commented 6 years ago

Looks fixed with #141