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

Retention exception when serializing Notifications #35

Closed mohierf closed 7 years ago

mohierf commented 8 years ago
[2016-11-02 07:52:54 UTC] ERROR: [alignak.scheduler] The instance backend_scheduler raise an exception <alignak.notification.Notification object at 0x80c1e5b50> is not JSON serializable.I disable it and set it to restart it later
[2016-11-02 07:52:54 UTC] ERROR: [alignak.scheduler] Exception trace follows: Traceback (most recent call last):
  File "/root/git/alignak/alignak/scheduler.py", line 543, in hook_point
    fun(self)
  File "/usr/local/lib/python2.7/site-packages/alignak_module_backend/scheduler/module.py", line 176, in hook_save_retention
    self.backend.post('retentionhost', data=data_to_save['hosts'][host])
  File "/usr/local/lib/python2.7/site-packages/alignak_backend_client/client.py", line 474, in post
    data = json.dumps(data)
  File "/usr/local/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <alignak.notification.Notification object at 0x80c1e5b50> is not JSON serializable
mohierf commented 7 years ago

will re-open if it happens