Every request with no body that requires body fails with 500

Bug #1424009 reported by Andrii Ostapenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Triaged
High
Unassigned

Bug Description

Each of requests which are expected to have body will fail with 500 error code, if no body is provided. Expected error code 400.
E.g.:

create table:
curl -i http://<magnetodb-api>:8480/v1/data/<tenant_id>/tables -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <token>"

scan:
curl -i http://<magnetodb-api>:8480/v1/data/<tenant_id>/tables/test_table/scan -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <token>"

query:
curl -i http://<magnetodb-api>:8480/v1/data/<tenant_id>/tables/test_table/query -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <token>"

put item:
curl -i http://<magnetodb-api>:8480/v1/data/<tenant_id>/tables/test_table/put_item -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <token>"

etc

Server side trace:
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 63, in __call__
    response = req.get_response(self.application)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token.py", line 823, in __call__
    return self._call_app(env, start_response)
  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token.py", line 758, in _call_app
    return self._app(env, _fake_start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 63, in __call__
    response = req.get_response(self.application)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 246, in __call__
    action_result = self.execute_action(action, request, **action_args)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 260, in execute_action
    return self.dispatch(self.controller, action, request, **action_args)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 269, in dispatch
    return method(*args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/api/__init__.py", line 35, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/common/probe.py", line 94, in wrapper
    return f(*args, **kwargs)
TypeError: create_table() takes exactly 4 arguments (3 given)

Changed in magnetodb:
status: New → Triaged
importance: Undecided → High
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.