ERROR (BadRequest): expected string or buffer

Bug #1552888 reported by jichenjc
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
jichenjc

Bug Description

see https://bugs.launchpad.net/nova/+bug/1541691, different bug so open another track

I think that https://review.openstack.org/#/c/281143/ broke the openstackclient and novaclient aggregate create CLI. Both allowed made the availability zone optional which results in null being passed to the API.

ubuntu@openstackclient:/opt/stack/python-openstackclient$ openstack aggregate create foo
expected string or buffer (HTTP 400) (Request-ID: req-41d146cf-8ce4-4cce-8371-ffe6e03a3c73)
ubuntu@openstackclient:/opt/stack/python-openstackclient$ nova aggregate-create foo
ERROR (BadRequest): expected string or buffer (HTTP 400) (Request-ID: req-57bdcf61-d7d4-4242-98f6-88204ac3869b)

Tags: api
jichenjc (jichenjc)
Changed in nova:
assignee: nobody → jichenjc (jichenjc)
Revision history for this message
Matt Riedemann (mriedem) wrote :

Weird, the jsonschema on the aggregate create call should allow null for the availability zone:

https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/aggregates.py#L23

Changed in nova:
status: New → Confirmed
importance: Undecided → High
tags: added: api mitaka-rc-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :

This seems like a release blocker given the regression.

Revision history for this message
jichenjc (jichenjc) wrote :

I reverted the patch because not sure the side effect of the problem and how much code we need to copy from jsonschema
if some guru can find a way, then It would be better :)
https://review.openstack.org/#/c/288125/

Revision history for this message
Alex Xu (xuhj) wrote :

Looks like this is a regression. Reading this http://json-schema.org/latest/json-schema-validation.html#anchor104, formart keyword will work for all the types, not only string. I will give a try another way to write the schema today.

Revision history for this message
Alex Xu (xuhj) wrote :
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/288268

Changed in nova:
assignee: jichenjc (jichenjc) → Alex Xu (xuhj)
status: Confirmed → In Progress
Revision history for this message
Alex Xu (xuhj) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/288746

Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
status: In Progress → Fix Released
assignee: Alex Xu (xuhj) → jichenjc (jichenjc)
Revision history for this message
Alex Xu (xuhj) wrote :

For the wrong usage of 'format' keyword in server boot API, move to this bug https://bugs.launchpad.net/nova/+bug/1555656

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

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

commit eda0c1cdf0ac472ebbdd20e18b86e22bf5e3423e
Author: jichenjc <email address hidden>
Date: Tue Feb 23 15:55:56 2016 +0800

    Add functional regression test for bug 1552888

    Add this functional test to avoid further regress issue

    Related-Bug: 1552888

    Change-Id: I1b8843132394c39324c19bc46dded974625775a9

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit a9691bfb920fd6caca39218ae3104a3a30f177ea
Author: He Jie Xu <email address hidden>
Date: Fri Mar 4 14:52:51 2016 +0800

    Correct the wrong usage of 'format' jsonschema keyword in servers API

    'format' keyword works for any types. That means for 'port' field,
    'null' value never passed the format checks. We should use 'oneOf'
    keyword instead of it.

    Change-Id: Ic51e9e1c6efadce0a0b4d20a114ca75799fb36a5
    Partial-Bug: #1552888

Matt Riedemann (mriedem)
tags: removed: mitaka-rc-potential
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.