This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2292069 - Using version 2.10 to query glance returns 300 MULTIPLE_CHOICES
Summary: Using version 2.10 to query glance returns 300 MULTIPLE_CHOICES
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 16.2 (Train)
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: z7
: 16.2 (Train on RHEL 8.4)
Assignee: Cyril Roelandt
QA Contact: msava
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-06-12 20:25 UTC by mlaniel
Modified: 2025-01-22 16:22 UTC (History)
7 users (show)

Fixed In Version: openstack-glance-19.0.5-2.20241015145035.eb6ad61
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2025-01-22 16:20:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   OSP-32252 0 None None None 2025-01-22 16:20:16 UTC
Red Hat Issue Tracker OSP-33524 0 None None None 2025-01-22 16:22:44 UTC

Description mlaniel 2024-06-12 20:25:24 UTC
=== From our customer ===
When the tenants query the glance api searching for "current" version, its returning a 2 digit suffix (v2.10). 
Taking that version and using it to query the image list, glance returns: 300 MULTIPLE_CHOICES. This doesn't happen 1 digit suffix (ie v2.9)

=== My take on this ===
It looks like glance does not understand when we pass version 2.10 explicitly, and returns the list of available versions. 2.10 should be a valid choice.

Reproducible: Always

Steps to Reproduce:
1. curl the glance endpoint with different version
2. this will list the images, as expected, except when using the 'current' release, 2.10



Actual Results:  
=== Curl while using v2 ===

(overcloud) [stack@undercloud ~]$ curl -X GET http://10.2.0.254:9292/v2/images -H "X-Auth-Token: $(openstack token issue | awk '/ id / {print $4}')"
{"images": [{"name": "CirrOS", "disk_format": "qcow2", "container_format": "bare", "visibility": "public", "size": 21430272, "virtual_size": null, "status": "active", "checksum": "c8fc807773e5354afe61636071771906", (...truncated) "schema": "/v2/schemas/image", "stores": "default_backend"}], "first": "/v2/images", "schema": "/v2/schemas/images"}

=== Curl while using v2.9 ===
(overcloud) [stack@undercloud ~]$ curl -X GET http://10.2.0.254:9292/v2.9/images -H "X-Auth-Token: $(openstack token issue | awk '/ id / {print $4}')"
{"images": [{"name": "CirrOS", "disk_format": "qcow2", "container_format": "bare", "visibility": "public", "size": 21430272, "virtual_size": null, "status": "active", "checksum": "c8fc807773e5354afe61636071771906", (...truncated) "schema": "/v2/schemas/image", "stores": "default_backend"}], "first": "/v2/images", "schema": "/v2/schemas/images"}

=== Curl while using 2.10 ===
(overcloud) [stack@undercloud ~]$ curl -X GET http://10.2.0.254:9292/v2.10/images -H "X-Auth-Token: $(openstack token issue | awk '/ id / {print $4}')"
{"versions": [{"id": "v2.10", "status": "CURRENT", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.9", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.8", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.7", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.6", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.5", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.4", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.3", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.2", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.1", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}, {"id": "v2.0", "status": "SUPPORTED", "links": [{"rel": "self", "href": "http://10.2.0.254:9292/v2/"}]}]}


Expected Results:  
glance to return the image list , regardless the version suffix

- Tested in RHOSP16.2.5 and RHOSP16.2.6, curl v2.10 does not return the image list
- Also tested in 17.1.3 and it does work as expected there
- Could it be related to this bug (https://bugzilla.redhat.com/show_bug.cgi?id=2172285), which does not look like is fixed in 16.2.6. In the Glance container, versions.py still show only 2.10 between quotes.

Comment 1 Cyril Roelandt 2024-06-14 18:37:42 UTC
Hello,

> - Could it be related to this bug (https://bugzilla.redhat.com/show_bug.cgi?id=2172285), which does not look like is fixed in 16.2.6. In the Glance container, versions.py still show only 2.10 between quotes.

Quickly looking at this bug, this looks quite likely. Downstream, commit e5c01469a8730f649b85ed9edf42804eb13602d7 fixes issues with "floats vs strings" in versions. This should be part of openstack-glance-19.0.5-2.20230310205019.eb6ad61 .

Comment 3 Cyril Roelandt 2024-06-21 23:30:37 UTC
Can you confirm that you're indeed using 16.2.5 and confirm what version of Glance you're using by running:

$ rpm -qa | grep glance

Thanks!

Comment 5 Cyril Roelandt 2024-07-04 20:40:51 UTC
OK so I've taken a closer look at this, and it seems v2.10 is not part of glance/api/middleware/version_negotiation.py in rhos/rhos-16.2-trunk-patches:

    def _get_allowed_versions(self):
        allowed_versions = {}
        if CONF.enable_v2_api:
            allowed_versions['v2'] = 2
            allowed_versions['v2.0'] = 2
            allowed_versions['v2.1'] = 2
            allowed_versions['v2.2'] = 2
            allowed_versions['v2.3'] = 2
            allowed_versions['v2.4'] = 2
            allowed_versions['v2.5'] = 2
            allowed_versions['v2.6'] = 2
            allowed_versions['v2.7'] = 2
            allowed_versions['v2.9'] = 2
            if CONF.enabled_backends:
                allowed_versions['v2.8'] = 2
        return allowed_versions


Because 2.10 is available in glance/api/versions though, you see it in the returned "allowed versions".

Why did you need to use v2.10? Do you need to delete an image from a specific store when using a multistore configuration?

Comment 7 Cyril Roelandt 2024-07-05 15:16:25 UTC
Yes, I agree with your comment on the customer case. If the customer just wants us to know that there is a bug but has no need for the new features in v2.10, we can leave this code as-is. If they need to use features introduced in v2.10, then we need to fix it. I have asked RHOS delivery about potential future async releases.

Comment 17 Cyril Roelandt 2024-12-19 15:51:01 UTC
Hello,

I expect this fix to be part of 16.2.7.


Note You need to log in before you can comment on or make changes to this bug.