Resource usage stats shows error when "--" is selected as grouping parameter

Bug #1387530 reported by Pradeep Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Pradeep Kumar

Bug Description

When selecting '--' as grouping parameter, Resource usage stats displays error message as "Internal server error"

Log shows the following error:

[Thu Oct 30 06:42:17 2014] [error] Internal Server Error: /admin/metering/samples
[Thu Oct 30 06:42:17 2014] [error] Traceback (most recent call last):
[Thu Oct 30 06:42:17 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
[Thu Oct 30 06:42:17 2014] [error] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 36, in dec
[Thu Oct 30 06:42:17 2014] [error] return view_func(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 84, in dec
[Thu Oct 30 06:42:17 2014] [error] return view_func(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 52, in dec
[Thu Oct 30 06:42:17 2014] [error] return view_func(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 36, in dec
[Thu Oct 30 06:42:17 2014] [error] return view_func(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 84, in dec
[Thu Oct 30 06:42:17 2014] [error] return view_func(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 69, in view
[Thu Oct 30 06:42:17 2014] [error] return self.dispatch(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 87, in dispatch
[Thu Oct 30 06:42:17 2014] [error] return handler(request, *args, **kwargs)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/metering/views.py", line 97, in get
[Thu Oct 30 06:42:17 2014] [error] resources, unit = query.query(meter_name)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/utils/metering.py", line 150, in query
[Thu Oct 30 06:42:17 2014] [error] filter_func=filter_by_meter_name)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/ceilometer.py", line 653, in resources_with_statistics
[Thu Oct 30 06:42:17 2014] [error] with_users_and_tenants=with_users_and_tenants)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/ceilometer.py", line 617, in resources
[Thu Oct 30 06:42:17 2014] [error] query=query, ceilometer_usage_object=ceilometer_usage_object)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/ceilometer.py", line 290, in resource_list
[Thu Oct 30 06:42:17 2014] [error] resources.list(q=query)
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/python-ceilometerclient/ceilometerclient/v2/resources.py", line 35, in list
[Thu Oct 30 06:42:17 2014] [error] return self._list(options.build_url(path, q))
[Thu Oct 30 06:42:17 2014] [error] File "/opt/stack/python-ceilometerclient/ceilometerclient/v2/options.py", line 52, in build_url
[Thu Oct 30 06:42:17 2014] [error] query_params['q.%s' % name].append(query.get(name, ''))
[Thu Oct 30 06:42:17 2014] [error] AttributeError: 'unicode' object has no attribute 'get'

Revision history for this message
Pradeep Kumar (pradeep-av) wrote :
Changed in horizon:
assignee: nobody → Pradeep Kumar (pradeep-av)
summary: - Resource usage stats shows error when "--" is selected
+ Resource usage stats shows error when "--" is selected ad grouping
+ parameter
summary: - Resource usage stats shows error when "--" is selected ad grouping
+ Resource usage stats shows error when "--" is selected as grouping
parameter
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/131980

Changed in horizon:
status: New → In Progress
Revision history for this message
Pradeep Kumar (pradeep-av) wrote :

There is a propagated base class attribute that is causing this break.

Horizon helper function for Meter based filtering expects a single query object. The base class attribute self.queries has a tenant based filter list which is passed as a query to this function and error occurs. Considering meter based filter doesn't require tenant based filter, if we clear this filter the functionality works fine

David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Medium
milestone: none → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/131980
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6a6f1072f50b165e2fcc3c8ecaec728e9ea4051d
Submitter: Jenkins
Branch: master

commit 6a6f1072f50b165e2fcc3c8ecaec728e9ea4051d
Author: avpra <email address hidden>
Date: Thu Oct 30 15:00:36 2014 +0530

    Fixes group by none defect in resource usage stats:

    * Resets the inherited tenant filter queries that come
      from base class. The helper function for filter by
      meter expects a single query unlike project aggregates

    Change-Id: Id9f371b09eaddd6c58d1181cbaeadf7654bbd067
    Closes-Bug: #1387530

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
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.