You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Arvind N <ar...@gmail.com> on 2016/06/11 16:29:24 UTC

Openstack Issue with additional properties being passed in

Hi,

As part of Openstack releases(Kilo+), V2.1 of the API's are being exposed.

2.1 supports stronger input validation. see here
<https://specs.openstack.org/openstack/nova-specs/specs/kilo/implemented/v2-on-v3-api.html#rest-api-impact>

Another impact is strong input validation of JSON-Schema. JSON-Schema
contains the “additionalProperties” feature which can deny undefined
properties in an input request. V2 API just ignored undefined properties if
a request contain, but V2.1 API denies the request and returns a BadRequest
response to a client.

During V2.1 development, we found that Tempest also passed undefined
properties to Nova API, and Nova V2 API just ignored them then tests
succeeded. However Nova V2.1 API rejected these requests and tests failed.
So that was Tempest bug, but we imagined this kind of problem would happen
on the other SDKs. Before fixing this Tempest bug, we investigated major
SDKs(fog, *jclouds*)’s code and we confirmed these SDKs send a valid
request without undefined properties and they don’t contain this kind of
problem.

For creating flavors in openstack, Jcloud includes the links properties
which were safely ignored in V2 API but causing issues in V2.1 API

Is there a quick workaround for this issue? What is the solution? I can
help with fixing this bug if i know how to fix this.

POST http://172.19.46.39:8774/v2.1/8d0578a052814946b2115e72a026bf44/flavors
HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content:
[{"badRequest": {"message": "Invalid input for field/attribute flavor.
Value: {u'name':
u'SNORT-0.2-0.2.0.20150626002613-IPS-1-snort_disk-20150626002613.qcow2',
u'links': [], u'ram': 2048, u'vcpus': 2, u'disk': 50, u'id':
u'IPS-1_RegionOne'}. Additional properties are not allowed (u'links' was
unexpected)", "code": 400}}]

Thanks!!
-- 
Arvind N