Horizon monitoring - overview throw HTTP 500 error AttributeError: 'Settings' object has no attribute 'DASHBOARDS'

Bug #1967278 reported by Mirek
26
This bug affects 6 people
Affects Status Importance Assigned to Milestone
kolla-ansible
New
Undecided
Unassigned

Bug Description

Kolla all in one deployment with enabled_monasca = yes, will throw HTTP 500 error in Horizon when you click Overview tab. It's down to the monasca-ui code being updated and new files being introduced but Kolla docker/kolla_extend_start is still using old ones.
As a fix I've added the following lines to kolla_extend_start script
function config_monasca_ui {
    config_dashboard "${ENABLE_MONASCA:-no}" \
        "${SITE_PACKAGES}/monitoring/enabled/_50_admin_add_monitoring_panel.py" \
        "${SITE_PACKAGES}/openstack_dashboard/local/enabled/_50_admin_add_monitoring_panel.py"
    config_dashboard "${ENABLE_MONASCA:-no}" \
        "${SITE_PACKAGES}/monitoring/config/local_settings.py" \
        "${SITE_PACKAGES}/openstack_dashboard/local/local_settings.d/_50_monasca.py"
    touch /etc/openstack-dashboard/monitoring_policy.yaml
}

The reason why I didn't copy ${SITE_PACKAGES}/monitoring/conf/monitoring_policy.yaml is because the roles defined in the file are not in keystone and with the file in the monitoring tab won't show at all. So two things here:
 - one the loca_settings.py is not included in the kolla_extend_start
 - two the monitoring file has changed and also introduce new roles

In horizon.log you can see the following error
[Wed Mar 30 19:33:15.713250 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] Default policy file for monitoring is not defined. Check DEFAULT_POLICY_FILES setting.
[Wed Mar 30 19:33:15.713530 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] No policy rules for service 'monitoring' in /etc/openstack-dashboard/monitoring_policy.yaml
[Wed Mar 30 19:33:15.716090 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] Failed to parse dashboard links by project, returning defaults.
[Wed Mar 30 19:33:15.721024 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] Internal Server Error: /monitoring/
[Wed Mar 30 19:33:15.721050 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] Traceback (most recent call last):
[Wed Mar 30 19:33:15.721054 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
[Wed Mar 30 19:33:15.721058 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] response = get_response(request)
[Wed Mar 30 19:33:15.721061 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response
[Wed Mar 30 19:33:15.721064 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] response = self.process_exception_by_middleware(e, request)
[Wed Mar 30 19:33:15.721068 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response
[Wed Mar 30 19:33:15.721086 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Wed Mar 30 19:33:15.721090 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/horizon/decorators.py", line 51, in dec
[Wed Mar 30 19:33:15.721095 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return view_func(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721101 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/horizon/decorators.py", line 35, in dec
[Wed Mar 30 19:33:15.721104 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return view_func(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721107 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/horizon/decorators.py", line 83, in dec
[Wed Mar 30 19:33:15.721110 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return view_func(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721112 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/horizon/decorators.py", line 35, in dec
[Wed Mar 30 19:33:15.721115 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return view_func(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721118 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/horizon/decorators.py", line 111, in dec
[Wed Mar 30 19:33:15.721121 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return view_func(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721123 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 71, in view
[Wed Mar 30 19:33:15.721126 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return self.dispatch(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721129 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 97, in dispatch
[Wed Mar 30 19:33:15.721132 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return handler(request, *args, **kwargs)
[Wed Mar 30 19:33:15.721135 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 158, in get
[Wed Mar 30 19:33:15.721138 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] context = self.get_context_data(**kwargs)
[Wed Mar 30 19:33:15.721140 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/monitoring/overview/views.py", line 248, in get_context_data
[Wed Mar 30 19:33:15.721143 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] context["dashboards"] = get_dashboard_links(self.request)
[Wed Mar 30 19:33:15.721146 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/monitoring/overview/views.py", line 109, in get_dashboard_links
[Wed Mar 30 19:33:15.721149 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] return settings.DASHBOARDS
[Wed Mar 30 19:33:15.721152 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 80, in __getattr__
[Wed Mar 30 19:33:15.721158 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] val = getattr(self._wrapped, name)
[Wed Mar 30 19:33:15.721163 2022] [wsgi:error] [pid 981:tid 140127669282560] [remote 172.16.71.100:2275] AttributeError: 'Settings' object has no attribute 'DASHBOARDS'

Revision history for this message
Jay Jahns (jjahns) wrote :

This problem is in stable/yoga.

Revision history for this message
Joab de Araújo Silva (joab.silva) wrote :

Any solution?

Revision history for this message
Christian Stelter (stelterlab) wrote :

Same here. Tried Xena and now Yoga. Using the ubuntu-source images.

Revision history for this message
Tony Kim (hee4004) wrote :

Same here too. Using the centos-source images (Yoga)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.