admin image table failed to load image list

Bug #1624700 reported by Akihiro Motoki
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Timur Sufiev

Bug Description

Admin Image panel fails to load image list with the following error message.
Due to the error, the admin image table has no content.

2016-09-17 15:21:46.000420 error invoking apiclient
2016-09-17 15:21:46.000461 Traceback (most recent call last):
2016-09-17 15:21:46.000466 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/rest/utils.py", line 126, in _wrapped
2016-09-17 15:21:46.000470 data = function(self, request, *args, **kw)
2016-09-17 15:21:46.000474 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/rest/glance.py", line 163, in get
2016-09-17 15:21:46.000477 request, filters=filters, **kwargs)
2016-09-17 15:21:46.000480 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 281, in image_list_detailed
2016-09-17 15:21:46.000484 _normalize_list_input(filters, **kwargs)
2016-09-17 15:21:46.000487 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 176, in _normalize_list_input
2016-09-17 15:21:46.000491 _normalize_is_public_filter(filters)
2016-09-17 15:21:46.000495 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 165, in _normalize_is_public_filter
2016-09-17 15:21:46.000498 visibility = PUBLIC_TO_VISIBILITY_MAP[filters['is_public']]
2016-09-17 15:21:46.000502 KeyError: u'None'
2016-09-17 15:21:46.020015 error invoking apiclient
2016-09-17 15:21:46.020089 Traceback (most recent call last):
2016-09-17 15:21:46.020121 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/rest/utils.py", line 126, in _wrapped
2016-09-17 15:21:46.020147 data = function(self, request, *args, **kw)
2016-09-17 15:21:46.020172 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/rest/glance.py", line 163, in get
2016-09-17 15:21:46.020196 request, filters=filters, **kwargs)
2016-09-17 15:21:46.020219 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 281, in image_list_detailed
2016-09-17 15:21:46.020265 _normalize_list_input(filters, **kwargs)
2016-09-17 15:21:46.020293 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 176, in _normalize_list_input
2016-09-17 15:21:46.020321 _normalize_is_public_filter(filters)
2016-09-17 15:21:46.020366 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 165, in _normalize_is_public_filter
2016-09-17 15:21:46.020396 visibility = PUBLIC_TO_VISIBILITY_MAP[filters['is_public']]
2016-09-17 15:21:46.020420 KeyError: u'None'

Akihiro Motoki (amotoki)
description: updated
Akihiro Motoki (amotoki)
Changed in horizon:
assignee: Akihiro Motoki (amotoki) → nobody
Revision history for this message
Akihiro Motoki (amotoki) wrote :

After investigating this issue, it turns out it is more complex than I thought.

To retrieve all images from all tenants, is_public=None needs to be specified in Glance API v1. On the other hand, Glance API v2 returns all images from all tenants if a caller has admin privilege.

The error I reported occurs when Glance v2 API is used.

The cause is list-function-extra-params="{is_public: 'None'}" specified in openstack_dashboard/static/app/core/images/admin-panel.html.
If we consider glance v2 API only, the diff below will fix the problem.

---
diff --git a/openstack_dashboard/static/app/core/images/images.module.js b/openstack_dashboard/static/app/core/images/images.module.js
index e708291..2ead08e 100644
--- a/openstack_dashboard/static/app/core/images/images.module.js
+++ b/openstack_dashboard/static/app/core/images/images.module.js
@@ -303,7 +303,7 @@
     });

     $routeProvider.when('/admin/images', {
- templateUrl: path + 'admin-panel.html'
+ templateUrl: path + 'panel.html'
     });

     function goToAngularDetails(params) {

--

Unfortunately, this solution does not work for Glance v1 API.

I am not sure where should be changed to fix this bug.
To handle this bug, the logic needs to know which image API version is used.
The server side logic looks suitable to fix this issue, but at now the client side code handles v1/v2 differences.

Thought?

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/372400

Changed in horizon:
assignee: nobody → Timur Sufiev (tsufiev-x)
status: New → In Progress
Revision history for this message
Brad Pokorny (bpokorny) wrote :

Note: This only affects the Angular Admin->Images page.

A workaround for now is to set this value in local_settings.py:

ANGULAR_FEATURES = { 'images_panel': False, }

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/372400
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=66094201154dbdb09782e78f15840c8aeade4fc6
Submitter: Jenkins
Branch: master

commit 66094201154dbdb09782e78f15840c8aeade4fc6
Author: Timur Sufiev <email address hidden>
Date: Mon Sep 19 13:56:18 2016 +0300

    Fix getting the images list in Admin->Images

    Do this by converting 'None' / 'True' / 'False' to their Python
    counterparts.

    Change-Id: Ifd17f4587759e7a67218278d28ee77fc9b80530a
    Closes-Bug: #1624700

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/373030

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/newton)

Reviewed: https://review.openstack.org/373030
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6512bf2868c506b62cc8d33b4a8269ebee749c35
Submitter: Jenkins
Branch: stable/newton

commit 6512bf2868c506b62cc8d33b4a8269ebee749c35
Author: Timur Sufiev <email address hidden>
Date: Mon Sep 19 13:56:18 2016 +0300

    Fix getting the images list in Admin->Images

    Do this by converting 'None' / 'True' / 'False' to their Python
    counterparts.

    Change-Id: Ifd17f4587759e7a67218278d28ee77fc9b80530a
    Closes-Bug: #1624700
    (cherry picked from commit 66094201154dbdb09782e78f15840c8aeade4fc6)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 10.0.0.0rc2

This issue was fixed in the openstack/horizon 10.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 11.0.0.0b1

This issue was fixed in the openstack/horizon 11.0.0.0b1 development milestone.

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.