← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1953734] [NEW] POST /os-security-groups returns HTTP 500 on invalid input

 

Public bug reported:

Nova does not validate the input on os-security-groups API resource.

curl -X POST 'http://10.1.0.21/compute/v2.1/os-security-groups' -d '{"security_group": "nostrud commodo tempor", "name": "eiusmod veniam", "description": "non esse occaecat"}' -H "Content-Type: application/json; charset=UTF-8" -H "Accept: application/json" -H "X-Auth-Token: ${token}" 
{"computeFault": {"code": 500, "message": "Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.\n<class 'AttributeError'>"}}

Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi [None req-910489b0-9e02-4748-84ed-f2b2574ec7bb admin admin] Unexpected exception in API method: Attribut>
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi Traceback (most recent call last):
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 658, in wrapped
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/compute/security_groups.py", line 219, in create
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi     group_name = security_group.get('name', None)
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi AttributeError: 'str' object has no attribute 'get'
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi 
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: INFO nova.api.openstack.wsgi [None req-910489b0-9e02-4748-84ed-f2b2574ec7bb admin admin] HTTP exception thrown: Unexpected API Error. >
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: <class 'AttributeError'>
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: DEBUG nova.api.openstack.wsgi [None req-910489b0-9e02-4748-84ed-f2b2574ec7bb admin admin] Returning 500 to user: Unexpected API Error.>
Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: <class 'AttributeError'> {{(pid=3644655) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:936}}

reproducible on recent master with simple devstack setup

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: api security-groups

** Tags added: api security-groups

** Summary changed:

- POST /os-security-groups returns HTTP 500 of invalid input
+ POST /os-security-groups returns HTTP 500 on invalid input

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1953734

Title:
  POST /os-security-groups returns HTTP 500 on invalid input

Status in OpenStack Compute (nova):
  New

Bug description:
  Nova does not validate the input on os-security-groups API resource.

  curl -X POST 'http://10.1.0.21/compute/v2.1/os-security-groups' -d '{"security_group": "nostrud commodo tempor", "name": "eiusmod veniam", "description": "non esse occaecat"}' -H "Content-Type: application/json; charset=UTF-8" -H "Accept: application/json" -H "X-Auth-Token: ${token}" 
  {"computeFault": {"code": 500, "message": "Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.\n<class 'AttributeError'>"}}

  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi [None req-910489b0-9e02-4748-84ed-f2b2574ec7bb admin admin] Unexpected exception in API method: Attribut>
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi Traceback (most recent call last):
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 658, in wrapped
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/compute/security_groups.py", line 219, in create
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi     group_name = security_group.get('name', None)
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi AttributeError: 'str' object has no attribute 'get'
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: ERROR nova.api.openstack.wsgi 
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: INFO nova.api.openstack.wsgi [None req-910489b0-9e02-4748-84ed-f2b2574ec7bb admin admin] HTTP exception thrown: Unexpected API Error. >
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: <class 'AttributeError'>
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: DEBUG nova.api.openstack.wsgi [None req-910489b0-9e02-4748-84ed-f2b2574ec7bb admin admin] Returning 500 to user: Unexpected API Error.>
  Dec 09 10:27:16 master0 devstack@n-api.service[3644655]: <class 'AttributeError'> {{(pid=3644655) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:936}}

  reproducible on recent master with simple devstack setup

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1953734/+subscriptions



Follow ups