shinken-monitoring / mod-webui

Shinken Web User Interface
GNU Affero General Public License v3.0
79 stars 71 forks source link

Notification way update error #657

Closed mohierf closed 5 years ago

mohierf commented 5 years ago

When receiving new notification way update broks, an exception is raised:

[Wed Dec 05 14:16:18 2018] INFO: [Shinken] Got a configuration from SchedulerLink_2
[Wed Dec 05 14:16:18 2018] INFO: [Shinken] Creating a notification way: detailled-email from scheduler SchedulerLink_2
[Wed Dec 05 14:16:18 2018] ERROR: [Shinken] Exception on brok management: 'unicode' object has no attribute 'timeperiod_name'
[Wed Dec 05 14:16:18 2018] ERROR: [Shinken] Traceback: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/alignak_webui/regenerator.py", line 215, in manage_brok
    manage(brok)
  File "/usr/local/lib/python2.7/dist-packages/alignak_webui/regenerator.py", line 1210, in manage_initial_notificationway_status_brok
    self.linkify_a_timeperiod(nw, 'host_notification_period')
  File "/usr/local/lib/python2.7/dist-packages/alignak_webui/regenerator.py", line 638, in linkify_a_timeperiod
    tpname = t.timeperiod_name
AttributeError: 'unicode' object has no attribute 'timeperiod_name'

[Wed Dec 05 14:16:18 2018] ERROR: [Shinken] Brok 'initial_notificationway_status': {u'notificationway_name': u'detailled-email', u'uuid': u'22185c35-4583-4824-b46a-969ac7939cb8', u'host_notifications_enabled': True, u'service_notification_options': [u'c', u'w', u'r'], u'host_notification_commands': [<alignak.commandcall.CommandCall object at 0x7eff547349e0>], u'service_notification_period': u'a43c3079-c1df-4741-9ea7-078137a7ee09', u'downtimes': {}, u'min_business_impact': 1, 'instance_id': u'SchedulerLink_2', u'host_notification_options': [u'd', u'u', u'r', u'f', u's'], u'service_notifications_enabled': True, u'host_notification_period': u'a43c3079-c1df-4741-9ea7-078137a7ee09', u'service_notification_commands': [<alignak.commandcall.CommandCall object at 0x7eff4f6e9560>], 'id': u'22185c35-4583-4824-b46a-969ac7939cb8', u'tags': []}
[Wed Dec 05 14:16:18 2018] INFO: [Shinken] Creating a notification way: log from scheduler SchedulerLink_2
[Wed Dec 05 14:16:18 2018] ERROR: [Shinken] Exception on brok management: 'unicode' object has no attribute 'timeperiod_name'
[Wed Dec 05 14:16:18 2018] ERROR: [Shinken] Traceback: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/alignak_webui/regenerator.py", line 215, in manage_brok
    manage(brok)
  File "/usr/local/lib/python2.7/dist-packages/alignak_webui/regenerator.py", line 1210, in manage_initial_notificationway_status_brok
    self.linkify_a_timeperiod(nw, 'host_notification_period')
  File "/usr/local/lib/python2.7/dist-packages/alignak_webui/regenerator.py", line 638, in linkify_a_timeperiod
    tpname = t.timeperiod_name
AttributeError: 'unicode' object has no attribute 'timeperiod_name'
mohierf commented 5 years ago

Note that this only happens for a configuration reload ! Not for the initial configuration on Web UI start up ... only when the WebUI already has received some information and that Shinken (or Alignak) raise new initial status broks