You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Arvind N <ar...@gmail.com> on 2016/06/15 03:26:09 UTC

Openstack nova 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.

20:09:07.804 DEBUG o.j.o.k.v.s.RegionIdToURIFromAccessForTypeAndVersion -
endpoints for apiType compute and version 2: {
    RegionOne=[Endpoint{
        id=0bc801fadd374dc38750d0a3cb76fec9,
        region=RegionOne,
        publicURL=http: //192.168.56.101:
8774/v2.1/ad631219e6764c0380da57bcd88cba4c,
        internalURL=http: //192.168.56.101:
8774/v2.1/ad631219e6764c0380da57bcd88cba4c,
        adminURL=http: //192.168.56.101:
8774/v2.1/ad631219e6764c0380da57bcd88cba4c
    }]
}
20:09:07.811  DEBUG o.j.rest.internal.InvokeHttpMethod - >> invoking
flavor:create
20:09:07.811  DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending
request -1781028928: POST
http://192.168.56.101:8774/v2.1/ad631219e6764c0380da57bcd88cba4c/flavors
HTTP/1.1
20:09:07.811  DEBUG jclouds.wire - >> "{
    "flavor": {
        "ram": 6144,
        "disk": 50,
        "vcpus": 4,
        "id": "arv-da-1_RegionOne",
        "name":
"IPS-VM100-VSS-8.1.7.27-arv-da-1-sensorsw_vm100-vss_81727-disk1.qcow",
        "links": []
    }
}"
20:09:07.811  DEBUG jclouds.headers - >> POST
http://192.168.56.101:8774/v2.1/ad631219e6764c0380da57bcd88cba4c/flavors
HTTP/1.1
20:09:07.811  DEBUG jclouds.headers - >> Accept: application/json
20:09:07.811  DEBUG jclouds.headers - >> X-Auth-Token:
124ad0cc300f4efd837e40629aedced3
20:09:07.811  DEBUG jclouds.headers - >> Content-Type: application/json
20:09:07.811  DEBUG jclouds.headers - >> Content-Length: 157
20:09:07.845  DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Receiving
response -1781028928: HTTP/1.1 400 Bad Request
20:09:07.845  DEBUG jclouds.headers - << HTTP/1.1 400 Bad Request
20:09:07.845  DEBUG jclouds.headers - << Date: Wed, 15 Jun 2016 03:09:07 GMT
20:09:07.845  DEBUG jclouds.headers - << Vary: X-OpenStack-Nova-API-Version
20:09:07.845  DEBUG jclouds.headers - << X-Openstack-Nova-Api-Version: 2.1
20:09:07.845  DEBUG jclouds.headers - << Connection: keep-alive
20:09:07.845  DEBUG jclouds.headers - << X-Compute-Request-Id:
req-4964d964-265c-496f-b509-c1636a1a2804
20:09:07.845  DEBUG jclouds.headers - << Content-Type: application/json;
charset=UTF-8
20:09:07.845  DEBUG jclouds.headers - << Content-Length: 323
20:09:07.845  DEBUG jclouds.wire - << "{
    "badRequest": {
        "message": "Invalid input for field/attribute flavor. Value:
{u'name':
u'IPS-VM100-VSS-8.1.7.27-arv-da-1-sensorsw_vm100-vss_81727-disk1.qcow',
u'links': [], u'ram': 6144, u'vcpus': 4, u'disk': 50, u'id':
u'arv-da-1_RegionOne'}. Additional properties are not allowed (u'links' was
unexpected)",
        "code": 400
    }"


Thanks!!
-- 
Arvind N