Nova quota-update fails with HTTP 400

Bug #1173353 reported by Armando Migliaccio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Critical
Sean Dague

Bug Description

If I do:

nova --debug quota-update --cores 400 ffd146506e2444da9d378b79f5e1d7f0

I get:

ERROR: Bad key(s) force in quota_set (HTTP 400) (Request-ID: req-5ecdd1c8-a9f0-4447-9e37-e0b16fce2029)

Request and response body are:

REQUEST BODY: {"quota_set": {"force": false, "tenant_id": "ffd146506e2444da9d378b79f5e1d7f0", "cores": 400}}

RESP: [400] {'date': 'Fri, 26 Apr 2013 19:12:53 GMT', 'content-length': '73', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-5ecdd1c8-a9f0-4447-9e37-e0b16fce2029'}
RESP BODY: {"badRequest": {"message": "Bad key(s) force in quota_set", "code": 400}}

Stacktrace is:

DEBUG (shell:768) Bad key(s) force in quota_set (HTTP 400) (Request-ID: req-5ecdd1c8-a9f0-4447-9e37-e0b16fce2029)
Traceback (most recent call last):
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 765, in main
    OpenStackComputeShell().main(map(strutils.safe_decode, sys.argv[1:]))
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 701, in main
    args.func(self.cs, args)
  File "/opt/stack/python-novaclient/novaclient/v1_1/shell.py", line 2835, in do_quota_update
    _quota_update(cs.quotas, args.tenant, args)
  File "/opt/stack/python-novaclient/novaclient/v1_1/shell.py", line 2715, in _quota_update
    manager.update(identifier, force_update, **updates)
  File "/opt/stack/python-novaclient/novaclient/v1_1/quotas.py", line 68, in update
    return self._update('/os-quota-sets/%s' % tenant_id, body, 'quota_set')
  File "/opt/stack/python-novaclient/novaclient/base.py", line 158, in _update
    _resp, body = self.api.client.put(url, body=body)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 236, in put
    return self._cs_request(url, 'PUT', **kwargs)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 217, in _cs_request
    **kwargs)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 199, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 193, in request
    raise exceptions.from_response(resp, body, url, method)
BadRequest: Bad key(s) force in quota_set (HTTP 400) (Request-ID: req-5ecdd1c8-a9f0-4447-9e37-e0b16fce2029)

This happens on trunk.

If I edit the server code to allow 'force' as _good_ key, the operation goes through just fine, but I am not 100% sure if that's the right fix.

Changed in nova:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

It looks like there was a fix that jumped the gun:

(client-side) https://review.openstack.org/#/c/26365/

whereas:

(server-side) https://review.openstack.org/#/c/25887/

hasn't quite made it.

I am duplicating this bug

Revision history for this message
Robert Collins (lifeless) wrote :

This is not a duplicate: its the fallout from the other enhancement being landed in the wrong order. I'm unduplicating and retargeting to nova-client: we need to back that change out until nova merges support for the force option.

affects: nova → python-novaclient
Changed in python-novaclient:
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Robert Collins (lifeless) wrote :

In fact, it's worse: this is backwards incompatible with all existing nova installs: it's a regression.

Revision history for this message
Robert Collins (lifeless) wrote :

(setting NOVA_VERSION to 1.0 doesn't prevent the bad key being passed)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
assignee: Armando Migliaccio (armando-migliaccio) → Sean Dague (sdague)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/30436
Committed: http://github.com/openstack/python-novaclient/commit/c305a458926f66d717d827dbad4596a7b22a02eb
Submitter: Jenkins
Branch: master

commit c305a458926f66d717d827dbad4596a7b22a02eb
Author: Sean Dague <email address hidden>
Date: Fri May 24 09:04:09 2013 -0400

    Revert "Support force update quota"

    This reverts commit e8b665edbfcd86488f75ed0b79dafdedbf8f5950.

    The previous commit created an incompatibility in using new nova
    client with older nova server. Nova client needs to be always
    releasable, and work with all nova server API versions out there.

    Fixes bug #1173353

    Change-Id: I2c07d109af4a35bc3b98dedaf991d5d3cc6fdd3b

Changed in python-novaclient:
status: In Progress → Fix Committed
Changed in python-novaclient:
status: Fix Committed → Fix Released
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.