← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1519342] [NEW] Returns 500 when delete method is called with request body

 

Public bug reported:

In current neutron, if we execute "DELETE" method with request body,
the neutron-server returns 500(Internal server error).  This request body should be correct JSON format as follows:

  example:   in case of "network"
   {
      "network":
      {
          "id": "5cc4e4b1-cab3-40a1-970b-9294c793295d"
      }
  }

It should be fixed 400(BadRequest) when execute "DELETE" method with an
unnecessary request body.

[Version]
  trunk

[Server]
  devstack(all-in-one)

[How to reproduce]
$ source devstack/openrc admin admin
$ export TOKEN=`openstack token issue|grep ' id '|get_field 2`
$ neutron net-list -c id -c name
+--------------------------------------+----------+
| id                                   | name     |
+--------------------------------------+----------+
| b3c4eaf1-2828-4c7f-a9ba-876b12d470b0 | private  |
+--------------------------------------+----------+
$ curl -i -X DELETE -d '{"network":{"id":"b3c4eaf1-2828-4c7f-a9ba-876b12d470b0"}}' -H "x-auth-token:$TOKEN" 192.168.122.253:9696/v2.0/networks/b3c4eaf1-2828-4c7f-a9ba-876b12d470b0
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=UTF-8
Content-Length: 150
X-Openstack-Request-Id: req-814b2033-6df0-4149-9b5b-f26a94a12f37
Date: Tue, 24 Nov 2015 12:38:55 GMT

{"NeutronError": {"message": "Request Failed: internal server error
while processing your request.", "type": "HTTPInternalServerError",
"detail": ""}}

[q-svc.log]
ERROR neutron.api.v2.resource [req-814b2033-6df0-4149-9b5b-f26a94a12f37 admin cb3d9e782f4c4537989a904a8cbefc69] delete failed
TRACE neutron.api.v2.resource Traceback (most recent call last):
TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
TRACE neutron.api.v2.resource     result = method(request=request, **args)
TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 147, in wrapper
TRACE neutron.api.v2.resource     ectxt.value = e.inner_exc
TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 197, in __exit__
TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 137, in wrapper
TRACE neutron.api.v2.resource     return f(*args, **kwargs)
TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 546, in delete
TRACE neutron.api.v2.resource     obj_deleter(request.context, id, **kwargs)
TRACE neutron.api.v2.resource TypeError: delete_network() got an unexpected keyword argument 'body'
TRACE neutron.api.v2.resource

** Affects: neutron
     Importance: Undecided
     Assignee: Yushiro FURUKAWA (y-furukawa-2)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Yushiro FURUKAWA (y-furukawa-2)

** Description changed:

  In current neutron, if we execute "DELETE" method with request body,
  the neutron-server returns 500(Internal server error).  This request body should be correct JSON format as follows:
  
-   example:   in case of "network"
-    {
-       "network":
-       {
-           "id": "5cc4e4b1-cab3-40a1-970b-9294c793295d"
-       }
-   }    
+   example:   in case of "network"
+    {
+       "network":
+       {
+           "id": "5cc4e4b1-cab3-40a1-970b-9294c793295d"
+       }
+   }
  
  It should be fixed 400(BadRequest) when execute "DELETE" method with an
- unnecessary request body. 
+ unnecessary request body.
  
  [Version]
-   trunk
+   trunk
  
  [Server]
-   devstack(all-in-one)
+   devstack(all-in-one)
  
  [How to reproduce]
  $ source devstack/openrc admin admin
  $ export TOKEN=`openstack token issue|grep ' id '|get_field 2`
  $ neutron net-list -c id -c name
  +--------------------------------------+----------+
  | id                                   | name     |
  +--------------------------------------+----------+
  | b3c4eaf1-2828-4c7f-a9ba-876b12d470b0 | private  |
  +--------------------------------------+----------+
  $ curl -i -X DELETE -d '{"network":{"id":"b3c4eaf1-2828-4c7f-a9ba-876b12d470b0"}}' -H "x-auth-token:$TOKEN" 192.168.122.253:9696/v2.0/networks/b3c4eaf1-2828-4c7f-a9ba-876b12d470b0
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json; charset=UTF-8
  Content-Length: 150
  X-Openstack-Request-Id: req-814b2033-6df0-4149-9b5b-f26a94a12f37
  Date: Tue, 24 Nov 2015 12:38:55 GMT
  
  {"NeutronError": {"message": "Request Failed: internal server error
  while processing your request.", "type": "HTTPInternalServerError",
  "detail": ""}}
  
  [q-svc.log]
- DEBUG oslo_policy._cache_handler [req-814b2033-6df0-4149-9b5b-f26a94a12f37 admin cb3d9e782f4c4537989a904a8cbefc69] Reloading cached file /etc/neutron/pol
- ) read_cached_file /usr/local/lib/python2.7/dist-packages/oslo_policy/_cache_handler.py:38
- DEBUG oslo_policy.policy [req-814b2033-6df0-4149-9b5b-f26a94a12f37 admin cb3d9e782f4c4537989a904a8cbefc69] Reloaded policy file: /etc/neutron/policy.json
- policy_file /usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py:441
  ERROR neutron.api.v2.resource [req-814b2033-6df0-4149-9b5b-f26a94a12f37 admin cb3d9e782f4c4537989a904a8cbefc69] delete failed
  TRACE neutron.api.v2.resource Traceback (most recent call last):
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
  TRACE neutron.api.v2.resource     result = method(request=request, **args)
  TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 147, in wrapper
  TRACE neutron.api.v2.resource     ectxt.value = e.inner_exc
  TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 197, in __exit__
  TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 137, in wrapper
  TRACE neutron.api.v2.resource     return f(*args, **kwargs)
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 546, in delete
  TRACE neutron.api.v2.resource     obj_deleter(request.context, id, **kwargs)
  TRACE neutron.api.v2.resource TypeError: delete_network() got an unexpected keyword argument 'body'
  TRACE neutron.api.v2.resource

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1519342

Title:
  Returns 500 when delete method is called with request body

Status in neutron:
  New

Bug description:
  In current neutron, if we execute "DELETE" method with request body,
  the neutron-server returns 500(Internal server error).  This request body should be correct JSON format as follows:

    example:   in case of "network"
     {
        "network":
        {
            "id": "5cc4e4b1-cab3-40a1-970b-9294c793295d"
        }
    }

  It should be fixed 400(BadRequest) when execute "DELETE" method with an
  unnecessary request body.

  [Version]
    trunk

  [Server]
    devstack(all-in-one)

  [How to reproduce]
  $ source devstack/openrc admin admin
  $ export TOKEN=`openstack token issue|grep ' id '|get_field 2`
  $ neutron net-list -c id -c name
  +--------------------------------------+----------+
  | id                                   | name     |
  +--------------------------------------+----------+
  | b3c4eaf1-2828-4c7f-a9ba-876b12d470b0 | private  |
  +--------------------------------------+----------+
  $ curl -i -X DELETE -d '{"network":{"id":"b3c4eaf1-2828-4c7f-a9ba-876b12d470b0"}}' -H "x-auth-token:$TOKEN" 192.168.122.253:9696/v2.0/networks/b3c4eaf1-2828-4c7f-a9ba-876b12d470b0
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json; charset=UTF-8
  Content-Length: 150
  X-Openstack-Request-Id: req-814b2033-6df0-4149-9b5b-f26a94a12f37
  Date: Tue, 24 Nov 2015 12:38:55 GMT

  {"NeutronError": {"message": "Request Failed: internal server error
  while processing your request.", "type": "HTTPInternalServerError",
  "detail": ""}}

  [q-svc.log]
  ERROR neutron.api.v2.resource [req-814b2033-6df0-4149-9b5b-f26a94a12f37 admin cb3d9e782f4c4537989a904a8cbefc69] delete failed
  TRACE neutron.api.v2.resource Traceback (most recent call last):
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
  TRACE neutron.api.v2.resource     result = method(request=request, **args)
  TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 147, in wrapper
  TRACE neutron.api.v2.resource     ectxt.value = e.inner_exc
  TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 197, in __exit__
  TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 137, in wrapper
  TRACE neutron.api.v2.resource     return f(*args, **kwargs)
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 546, in delete
  TRACE neutron.api.v2.resource     obj_deleter(request.context, id, **kwargs)
  TRACE neutron.api.v2.resource TypeError: delete_network() got an unexpected keyword argument 'body'
  TRACE neutron.api.v2.resource

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


Follow ups