Functional tests fail intermittently with 400 Bad Request from placement

Bug #1701129 reported by melanie witt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
melanie witt

Bug Description

Noticed this on a test run on an unrelated patch I uploaded, functional test failure with trace:

2017-06-28 22:16:50,659 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "PUT /allocations/f0bd6e91-2486-418c-bea2-bb2392568171" status: 400 len: 2220 microversion: 1.0
2017-06-28 22:16:50,659 INFO [nova.placement.wsgi.server] 127.0.0.1 "PUT /allocations/f0bd6e91-2486-418c-bea2-bb2392568171 HTTP/1.1" status: 400 len: 2504 time: 0.0040810
2017-06-28 22:16:50,660 WARNING [nova.scheduler.client.report] Unable to submit allocation for instance f0bd6e91-2486-418c-bea2-bb2392568171 (400 <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br /><br />
JSON does not validate: Additional properties are not allowed (u'project_id', u'user_id' were unexpected)

Failed validating 'additionalProperties' in schema:
    {'additionalProperties': False,
     'properties': {'allocations': {'items': {'additionalProperties': False,
                                              'properties': {'resource_provider': {'additionalProperties': False,
                                                                                   'properties': {'uuid': {'format': 'uuid',
                                                                                                           'type': 'string'}},
                                                                                   'required': ['uuid'],
                                                                                   'type': 'object'},
                                                             'resources': {'additionalProperties': False,
                                                                           'patternProperties': {'^[0-9A-Z_]+$': {'minimum': 1,
                                                                                                                  'type': 'integer'}},
                                                                           'type': 'object'}},
                                              'required': ['resource_provider',
                                                           'resources'],
                                              'type': 'object'},
                                    'type': 'array'}},
     'required': ['allocations'],
     'type': 'object'}

On instance:
    {u'allocations': [{u'resource_provider': {u'uuid': u'29000c79-94bf-4326-9630-281d2ef67071'},
                       u'resources': {u'DISK_GB': 20,
                                      u'MEMORY_MB': 2048,
                                      u'VCPU': 1}}],
     u'project_id': u'6f70656e737461636b20342065766572',
     u'user_id': u'fake'}

 </body>
</html>)

The problem is that microversion 1.0 is being requested with parameters only available in microversion >= 1.8. This is because the PlacementFixture's _fake_put() method ignores the version keyword argument and doesn't pass it along to placement.

melanie witt (melwitt)
summary: - Functional tests fail intermittently with Bad Request from placement
+ Functional tests fail intermittently with 400 Bad Request from placement
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/478683

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/478683
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1d74a7ab3da2a04e133347bd59cb1e37e1c8e322
Submitter: Jenkins
Branch: master

commit 1d74a7ab3da2a04e133347bd59cb1e37e1c8e322
Author: melanie witt <email address hidden>
Date: Wed Jun 28 23:50:53 2017 +0000

    Handle version for PUT and POST in PlacementFixture

    The SchedulerReportClient allows a "version" keyword argument to be
    specified for its get/put/post methods and several functions pass a
    version because they are sending data supported only in specific
    microversions of the placement API.

    The PlacementFixture has to mock the SchedulerReportClient
    get/put/post/delete methods to swap in a Keystone session with
    auth=None. The fake methods for PUT and POST are missing handling of
    the "version" keyword argument, causing intermittent "400 Bad Request"
    failures in the functional test jobs when unexpected parameters are
    passed to placement microversion 1.0 instead of the intended
    microversion.

    Closes-Bug: #1701129

    Change-Id: I681712ac37f732c7803c68f6c7d1eae9f2877d3d

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0b3

This issue was fixed in the openstack/nova 16.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.