Reviewed: https://review.openstack.org/295395 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=52b165bf1cf019353cd90b427ac3dd9991de48c7 Submitter: Jenkins Branch: master
commit 52b165bf1cf019353cd90b427ac3dd9991de48c7 Author: Matt Riedemann <[email protected]> Date: Mon Mar 21 12:31:19 2016 -0400 Return 400 on boot for invalid image metadata Horizon allows a free-form input field for architecture when creating an image. However, the architecture in the image metadata is validated against nova.compute.arch.ALL so when converting the image metadata in the compute API boot validation, if we hit a ValueError we should raise an appropriate exception so the REST API will return a 400 rather than a 500. Change-Id: Ib01b4b088fec065c671f83f5912e928b4d7fec71 Closes-Bug: #1558866 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1558866 Title: Architecture ValueError Uncaught API Exception Status in OpenStack Dashboard (Horizon): Opinion Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) liberty series: Confirmed Status in OpenStack Compute (nova) mitaka series: Confirmed Bug description: If an image is imported with an invalid Architecture, instances are unable to launch and cause a ValueError exception. This exception is only visible in logs and UI only tells user an exception occurred. Running Mirantis Openstack 8.0 (nova-api 2:12.0.0-1~u14.04+mos43) 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/objects/image_meta.py", line 457, in from_dict 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions obj._set_attr_from_legacy_names(image_props) 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/objects/image_meta.py", line 388, in _set_attr_from_legacy_names 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions setattr(self, new_key, image_props[legacy_key]) 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions field_value = field.coerce(self, name, value) 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 189, in coerce 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions return self._type.coerce(obj, attr, value) 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/objects/fields.py", line 87, in coerce 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions raise ValueError(msg) 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions ValueError: Architecture name 'x64' is not valid 2016-03-18 01:13:35.846 28025 ERROR nova.api.openstack.extensions 2016-03-18 01:13:35.848 28025 INFO nova.api.openstack.wsgi [req-f56ff830-6e2d-46ab-b1a3-50f021725374 813401d7df1d4ad68388dee16def6a6b 9e90e9d0bb8c43b3a6fa3d2b1fb08efa - - -] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. Reproduce: Import image with architecture named 'x64' (or presumably anything, since it's a freeform input), try to launch instance of image. Expected Result: Image launches, or if it cannot and error is needed, error should tell user there is an invalid architecture. If architecture can only be chosen from limited options, it should probably be a combobox rather than a freeform input when creating a new image. Actual Result: Generic API exception. Image fails to launch. To manage notifications about this bug go to: https://bugs.launchpad.net/horizon/+bug/1558866/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

