← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1682811] [NEW] nova boot apis raises 500 error if scheduler_hints additionalProperties value passed as "null" or "dict"

 

Public bug reported:

Additional scheduler_hints can be passed while creating a VM but if
those additional scheduler_hints value is 'null' or 'dict' the create
server call fails with 500 InternalServerError.

Steps to reproduce:

Command:
$ curl -g -i -X POST http://10.232.48.201:8774/v2.1/servers -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "OpenStack-API-Version: compute 2.41" -H "X-OpenStack-Nova-API-Version: 2.41" -H "X-Auth-Token: gAAAAABY7Jf4Qiwm2GKc-dsLiRVxK6-9CPHvk1Vu kRL6kVKItGetXrPUdLIhHtKebr4rSCAnK7VQTMI6v0LySvu3Cpu7e8y_7WSpELWp-Bfx5PEosbDh2UDsiJW7ib8jPEW5rcyQuDun5gDR9NbaugQ6UBcmKW1TMm9QZdTSI2npqyYJTVFuis" -H "Content-Type: application/json" -d '{"os:scheduler_hints": {"key": null}, "server": {"name": "instances1", "imageRef": "107f0481-754d-46a2-98a7-a26228c4280e", "flavorRef": "1", "max_count": 1, "min_count": 1, "networks": "auto"}}'

Please note the scheduler_hints: {"os:scheduler_hints": {"key": null}

Output:
HTTP/1.1 500 Internal Server Error
Openstack-Api-Version: compute 2.41
X-Openstack-Nova-Api-Version: 2.41
Vary: OpenStack-API-Version
Vary: X-OpenStack-Nova-API-Version
Content-Type: application/json; charset=UTF-8
Content-Length: 194
X-Compute-Request-Id: req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64
Date: Tue, 11 Apr 2017 08:47:26 GMT

{"computeFault": {"message": "Unexpected API Error. Please report this
at http://bugs.launchpad.net/nova/ and attach the Nova API log if
possible.\n<type 'exceptions.ValueError'>", "code": 500}}


nova-api:

2017-04-11 14:17:26.843 ERROR nova.api.openstack.extensions [req-3c29eadc-20d0-4aef
-b3c0-def9a51b0e64 admin admin] Unexpected exception in API method
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions Traceback (most recent
call last):
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova
/nova/api/openstack/extensions.py", line 336, in wrapped
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return f(*args, **k
wargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova
/nova/api/validation/__init__.py", line 108, in wrapper
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args,
**kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova
/nova/api/validation/__init__.py", line 108, in wrapper
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args,
**kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/openstack/compute/servers.py", line 553, in create
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     **create_kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/hooks.py", line 154, in inner
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     rv = f(*args, **kwargs)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1671, in create
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     check_server_group_quota=check_server_group_quota)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1240, in _create_instance
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     key_pair)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1102, in _provision_instances
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     quotas.rollback()
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     self.force_reraise()
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     six.reraise(self.type_, self.value, self.tb)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1015, in _provision_instances
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     security_groups=security_groups)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/objects/request_spec.py", line 415, in from_components
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     spec_obj._from_hints(filter_properties.get('scheduler_hints', {}))
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/objects/request_spec.py", line 224, in _from_hints
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     for hint, value in hints_dict.items()}
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     field_value = field.coerce(self, name, value)
python2.7/dist-packages/oslo_versionedobjects/fields.py", line 640, in coerce
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     coerced_list.extend(value)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 1242, in extend
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     for index, item in enumerate(t)]
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 1222, in _coerce_item
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return self._element_type.coerce(self._obj, att_name, item)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 193, in coerce
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return self._null(obj, attr)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 171, in _null
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     raise ValueError(_("Field `%s' cannot be None") % attr)
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions ValueError: Field `scheduler_hints[[]][0]' cannot be None
2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions
2017-04-11 14:17:26.984 INFO nova.api.openstack.wsgi [req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64 admin admin] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.ValueError'>
2017-04-11 14:17:26.985 DEBUG nova.api.openstack.wsgi [req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64 admin admin] Returning 500 to user: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.ValueError'> from (pid=2056) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1041
2017-04-11 14:17:26.986 INFO nova.osapi_compute.wsgi.server [req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64 admin admin] 10.232.48.201 "POST /v2.1/servers HTTP/1.1" status: 500 len: 539 time: 1.1872978


Latest commit:
commit ae637e70a72166067e09f3bbc3acb54e5d92771e
Merge: 9e071f4 370820b
Author: Jenkins <jenkins@xxxxxxxxxxxxxxxxxxxx>
Date:   Fri Apr 14 01:38:43 2017 +0000

    Merge "Fix hypervisors api missing HostMappingNotFound handlers"

** Affects: nova
     Importance: Undecided
     Assignee: Dinesh Bhor (dinesh-bhor)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Dinesh Bhor (dinesh-bhor)

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

Title:
  nova boot apis raises 500 error if scheduler_hints
  additionalProperties value passed as "null" or "dict"

Status in OpenStack Compute (nova):
  New

Bug description:
  Additional scheduler_hints can be passed while creating a VM but if
  those additional scheduler_hints value is 'null' or 'dict' the create
  server call fails with 500 InternalServerError.

  Steps to reproduce:

  Command:
  $ curl -g -i -X POST http://10.232.48.201:8774/v2.1/servers -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "OpenStack-API-Version: compute 2.41" -H "X-OpenStack-Nova-API-Version: 2.41" -H "X-Auth-Token: gAAAAABY7Jf4Qiwm2GKc-dsLiRVxK6-9CPHvk1Vu kRL6kVKItGetXrPUdLIhHtKebr4rSCAnK7VQTMI6v0LySvu3Cpu7e8y_7WSpELWp-Bfx5PEosbDh2UDsiJW7ib8jPEW5rcyQuDun5gDR9NbaugQ6UBcmKW1TMm9QZdTSI2npqyYJTVFuis" -H "Content-Type: application/json" -d '{"os:scheduler_hints": {"key": null}, "server": {"name": "instances1", "imageRef": "107f0481-754d-46a2-98a7-a26228c4280e", "flavorRef": "1", "max_count": 1, "min_count": 1, "networks": "auto"}}'

  Please note the scheduler_hints: {"os:scheduler_hints": {"key": null}

  Output:
  HTTP/1.1 500 Internal Server Error
  Openstack-Api-Version: compute 2.41
  X-Openstack-Nova-Api-Version: 2.41
  Vary: OpenStack-API-Version
  Vary: X-OpenStack-Nova-API-Version
  Content-Type: application/json; charset=UTF-8
  Content-Length: 194
  X-Compute-Request-Id: req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64
  Date: Tue, 11 Apr 2017 08:47:26 GMT

  {"computeFault": {"message": "Unexpected API Error. Please report this
  at http://bugs.launchpad.net/nova/ and attach the Nova API log if
  possible.\n<type 'exceptions.ValueError'>", "code": 500}}

  
  nova-api:

  2017-04-11 14:17:26.843 ERROR nova.api.openstack.extensions [req-3c29eadc-20d0-4aef
  -b3c0-def9a51b0e64 admin admin] Unexpected exception in API method
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions Traceback (most recent
  call last):
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova
  /nova/api/openstack/extensions.py", line 336, in wrapped
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return f(*args, **k
  wargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova
  /nova/api/validation/__init__.py", line 108, in wrapper
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args,
  **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova
  /nova/api/validation/__init__.py", line 108, in wrapper
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args,
  **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/validation/__init__.py", line 108, in wrapper
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return func(*args, **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/openstack/compute/servers.py", line 553, in create
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     **create_kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/hooks.py", line 154, in inner
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     rv = f(*args, **kwargs)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1671, in create
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     check_server_group_quota=check_server_group_quota)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1240, in _create_instance
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     key_pair)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1102, in _provision_instances
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     quotas.rollback()
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     self.force_reraise()
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     six.reraise(self.type_, self.value, self.tb)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/compute/api.py", line 1015, in _provision_instances
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     security_groups=security_groups)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/objects/request_spec.py", line 415, in from_components
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     spec_obj._from_hints(filter_properties.get('scheduler_hints', {}))
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/objects/request_spec.py", line 224, in _from_hints
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     for hint, value in hints_dict.items()}
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     field_value = field.coerce(self, name, value)
  python2.7/dist-packages/oslo_versionedobjects/fields.py", line 640, in coerce
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     coerced_list.extend(value)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 1242, in extend
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     for index, item in enumerate(t)]
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 1222, in _coerce_item
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return self._element_type.coerce(self._obj, att_name, item)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 193, in coerce
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     return self._null(obj, attr)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 171, in _null
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions     raise ValueError(_("Field `%s' cannot be None") % attr)
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions ValueError: Field `scheduler_hints[[]][0]' cannot be None
  2017-04-11 14:17:26.843 TRACE nova.api.openstack.extensions
  2017-04-11 14:17:26.984 INFO nova.api.openstack.wsgi [req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64 admin admin] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <type 'exceptions.ValueError'>
  2017-04-11 14:17:26.985 DEBUG nova.api.openstack.wsgi [req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64 admin admin] Returning 500 to user: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <type 'exceptions.ValueError'> from (pid=2056) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1041
  2017-04-11 14:17:26.986 INFO nova.osapi_compute.wsgi.server [req-3c29eadc-20d0-4aef-b3c0-def9a51b0e64 admin admin] 10.232.48.201 "POST /v2.1/servers HTTP/1.1" status: 500 len: 539 time: 1.1872978

  
  Latest commit:
  commit ae637e70a72166067e09f3bbc3acb54e5d92771e
  Merge: 9e071f4 370820b
  Author: Jenkins <jenkins@xxxxxxxxxxxxxxxxxxxx>
  Date:   Fri Apr 14 01:38:43 2017 +0000

      Merge "Fix hypervisors api missing HostMappingNotFound handlers"

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1682811/+subscriptions


Follow ups