Nova passing bad 'size' property value 'None' to Glance for images
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Zhenyu Zheng | ||
Liberty |
Fix Released
|
High
|
Matt Riedemann |
Bug Description
Glance does not accept 'None' as a valid value for the 'size' property [1]. However, in certain situations Nova is sending a 'size' property with a 'None' value. This results in a 400 response from Glance to Nova, and the following backtrace in Glance:
2015-08-21 14:54:17.916 10446 TRACE glance.
2015-08-21 14:54:17.916 10446 TRACE glance.
2015-08-21 14:54:17.916 10446 TRACE glance.
2015-08-21 14:54:17.916 10446 TRACE glance.
2015-08-21 14:54:17.916 10446 TRACE glance.
2015-08-21 14:54:17.916 10446 TRACE glance.
I believe what's happening is Nova tries to enforce certain required properties when creating or updating an image, and in the process reconciling those with the properties that Glance already has (through the _translate_
Nova is enforcing the 'size' property being in place [4], but if Glance does not already have a 'size' property on the image (like if the image has been queued but not uploaded yet), the value gets set to 'None' on the Nova side [5]. This gets sent to Glance in subsequent calls, and it fails because 'None' cannot be converted to an integer (see backtrace above.)
Steps to Reproduce:
Nova and Glance 2015.1.1
1. Queue a new image in Glance
2. Attempt to set a metadata attribute on that image (this will fail with 400 error from Glance)
3. Actually upload the image data sometime later
Potential Solution:
I've patched this locally to simply check that the 'size' property gets set to 0 instead of 'None' on the Nova side. I am not familiar enough with all the internals here to understand if that's the "right" solution, but I can confirm it's working for us and this bug is no longer triggered.
[1] https:/
[2] https:/
[3] https:/
[4] https:/
[5] https:/
summary: |
- Nova passing bad 'size' property value 'None' to Glance for image - metadata + Nova passing bad 'size' property value 'None' to Glance for images |
Changed in nova: | |
assignee: | Mike Dorman (mdorman-m) → Zhenyu Zheng (zhengzhenyu) |
Changed in nova: | |
importance: | Undecided → High |
Fix proposed to branch: master /review. openstack. org/215947
Review: https:/