Fails to set the image name attribute when localtions.metatdata is an empty dict

Bug #1943492 reported by Adam Dyess
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned

Bug Description

glance running 2:18.0.1-0ubuntu1 (bionic-stein)

stack-trace: https://paste.ubuntu.com/p/vHc3t8Mnym/

When setting the name attribute from the openstack CLI encounters a stack trace.

$ openstack image set --name 'my-custom-name' 'c61f99fc-8530-4d61-8279-709735106ea8'
HTTP 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation.

Tracked it down to here:
https://github.com/openstack/glance/blob/stable/stein/glance/location.py#L64

I believe if the same patch is applied as on
https://github.com/openstack/glance/blob/stable/stein/glance/location.py#L124

this could be a potential work-around, but i'm not familiar with this code

Revision history for this message
Adam Dyess (addyess) wrote :

Looks to me this method was re-architected here:
https://github.com/openstack/glance/commit/cb45edf5c81f7d09c9ef0b88d40d56b4750beb10#diff-a3da48c8916a4132e7104e204f7fd486476af70d0c87ba46b05acb99061cf201

Then this bug fixed LP#1838332 addresses a similar issue, with the re-architecture -- but not this issue.
Commit for LP#1838332: https://opendev.org/openstack/glance/commit/a027cc453a93c4e64ad81d208b9a6fe755fe8c02

Revision history for this message
Adam Dyess (addyess) wrote :

Output from openstack image show

$ openstack image show c61f99fc-8530-4d61-8279-709735106ea8 -cproperties --format yaml
properties:
  base_image_ref: <redacted>
  boot_roles: Member,heat_stack_owner
  direct_url: rbd://<redacted>/snap
  image_location: snapshot
  image_state: available
  image_type: image
  instance_uuid: <redacted>
  locations:
  - metadata: {}
    url: rbd://<redacted>/snap
  os_hidden: false
  owner_project_name: build
  owner_user_name: <redacted>
  prod_consumers: none,none
  user_id: <redacted>

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

I think Abhishek fixed this with a26e7a3bc08368f65169e27a20a0e1d286d26351. Unfortunately, I don't think we can backport this to Stein. Maybe the Ubuntu maintainer could cherry-pick the patch?

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.