Additional properties are not allowed ('block_device_mapping_v2' was unexpected)

Bug #1412547 reported by Davanum Srinivas (DIMS)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Davanum Srinivas (DIMS)

Bug Description

Logstash query:
message:"'block_device_mapping_v2' was unexpected"

Logstash URL:
http://logstash.openstack.org/#eyJzZWFyY2giOiJtZXNzYWdlOlwiJ2Jsb2NrX2RldmljZV9tYXBwaW5nX3YyJyB3YXMgdW5leHBlY3RlZFwiIiwiZmllbGRzIjpbXSwib2Zmc2V0IjowLCJ0aW1lZnJhbWUiOiIxNzI4MDAiLCJncmFwaG1vZGUiOiJjb3VudCIsInRpbWUiOnsidXNlcl9pbnRlcnZhbCI6MH0sInN0YW1wIjoxNDIxNjk0Nzk2MDE3fQ==

Example traceback
2015-01-19 18:58:52.035 | nova.tests.unit.api.openstack.compute.contrib.test_block_device_mapping_v1.BlockDeviceMappingTestV21.test_create_instance_both_bdm_formats
2015-01-19 18:58:52.035 | ------------------------------------------------------------------------------------------------------------------------------------------
2015-01-19 18:58:52.035 |
2015-01-19 18:58:52.035 | Captured traceback:
2015-01-19 18:58:52.035 | ~~~~~~~~~~~~~~~~~~~
2015-01-19 18:58:52.035 | Traceback (most recent call last):
2015-01-19 18:58:52.036 | File "nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping_v1.py", line 337, in test_create_instance_both_bdm_formats
2015-01-19 18:58:52.036 | self.assertRaises(exc.HTTPBadRequest, self._test_create, params)
2015-01-19 18:58:52.036 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 420, in assertRaises
2015-01-19 18:58:52.036 | self.assertThat(our_callable, matcher)
2015-01-19 18:58:52.036 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 431, in assertThat
2015-01-19 18:58:52.036 | mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
2015-01-19 18:58:52.036 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 481, in _matchHelper
2015-01-19 18:58:52.036 | mismatch = matcher.match(matchee)
2015-01-19 18:58:52.036 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
2015-01-19 18:58:52.036 | mismatch = self.exception_matcher.match(exc_info)
2015-01-19 18:58:52.036 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
2015-01-19 18:58:52.036 | mismatch = matcher.match(matchee)
2015-01-19 18:58:52.037 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 412, in match
2015-01-19 18:58:52.037 | reraise(*matchee)
2015-01-19 18:58:52.037 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
2015-01-19 18:58:52.037 | result = matchee()
2015-01-19 18:58:52.037 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 965, in __call__
2015-01-19 18:58:52.037 | return self._callable_object(*self._args, **self._kwargs)
2015-01-19 18:58:52.037 | File "nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping_v1.py", line 95, in _test_create
2015-01-19 18:58:52.037 | self.controller.create(req, body=body).obj['server']
2015-01-19 18:58:52.037 | File "nova/api/openstack/extensions.py", line 428, in wrapped
2015-01-19 18:58:52.037 | return f(*args, **kwargs)
2015-01-19 18:58:52.037 | File "nova/api/validation/__init__.py", line 56, in wrapper
2015-01-19 18:58:52.038 | schema_validator.validate(kwargs['body'])
2015-01-19 18:58:52.038 | File "nova/api/validation/validators.py", line 114, in validate
2015-01-19 18:58:52.038 | raise exception.ValidationError(detail=detail)
2015-01-19 18:58:52.038 | ValidationError: Invalid input for field/attribute server. Value: {'name': 'server_test', 'imageRef': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6', 'block_device_mapping': [{'device_name': 'foo'}], 'block_device_mapping_v2': [{'source_type': 'volume', 'uuid': 'fake_vol'}], 'flavorRef': 'http://localhost/123/flavors/3', 'metadata': {'open': 'stack', 'hello': 'world'}}. Additional properties are not allowed ('block_device_mapping_v2' was unexpected)

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

Changed in nova:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
status: New → In Progress
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit abd6d880bcff18d0a6dcef28121c00d7d172e496
Author: Davanum Srinivas <email address hidden>
Date: Mon Jan 19 14:36:53 2015 -0500

    Fix py27 gate failure - test_create_instance_both_bdm_formats

    Intermittent failure, depending on how the extensions get loaded.
    The specific check for HTTPBadRequest is for the exception being
    thrown here:
    https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/plugins/v3/block_device_mapping_v1.py#L53

    To be able to reach this piece of code, both the extensions
    'os-block-device-mapping' and 'os-block-device-mapping-v1'
    need to be activated. To be sure this happens all the time
    we create a both_controllers with an empty blacklist and
    use that for this test.

    Closes-Bug: #1412547
    Change-Id: I284cc9f053909359a8de1a0bd85f61fbfbc98af0

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
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.