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

Exception when updating program status #83

Closed mohierf closed 7 years ago

mohierf commented 7 years ago

As reported by @spea1:

# -----------------------------------------------------------------------------
# /usr/local/var/log/alignak/brokerd.log
# -----------------------------------------------------------------------------
TypeError: <alignak.commandcall.CommandCall object at 0x7fc023608dd0> is not JSON serializable
[2017-05-28 21:44:58 CEST] ERROR: [alignak.module.backend_broker] Manage brok exception: <alignak.commandcall.CommandCall object at 0x7fc023608e60> is not JSON serializable
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/alignak_module_backend/broker/module.py", line 766, in manage_brok
    self.update_program_status(brok)
  File "/usr/local/lib/python2.7/dist-packages/alignak_module_backend/broker/module.py", line 681, in update_program_status
    response = self.backend.post('alignak', brok.data)
  File "/usr/local/lib/python2.7/dist-packages/alignak_backend_client/client.py", line 492, in post
    data = json.dumps(data)
  File "/usr/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <alignak.commandcall.CommandCall object at 0x7fc023608e60> is not JSON serializable
mohierf commented 7 years ago

It looks strange because the program status brok is containing a CommandCall object !

Got it! It is because of the global host/service event handlers that are configured !

mohierf commented 7 years ago

This is to be related with this issue: https://github.com/Alignak-monitoring-contrib/alignak-backend/issues/387