list_tables throws 500 error when passing in start_table_name

Bug #1382088 reported by Charles Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
High
Charles Wang

Bug Description

Steps to reproduce:

1. create a few tables
2. invoke list_tables, you should see a list of tables
3. use one of the table name as "start_table_name" and invoke list_tables again
4. you will see 500 error

  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 61, 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/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 244, in __call__
    action_result = self.execute_action(action, request, **action_args)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 258, in execute_action
    return self.dispatch(self.controller, action, request, **action_args)
  File "/opt/stack/magnetodb/magnetodb/common/wsgi.py", line 267, in dispatch
    return method(*args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/common/probe.py", line 94, in wrapper
    return f(*args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/api/openstack/v1/request/list_tables.py", line 51, in list_tables
    validation.validate_unexpected_props(params, "params")
  File "/opt/stack/magnetodb/magnetodb/api/validation.py", line 130, in validate_unexpected_props
    unexpected_props=json.dumps(value)
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: MultiDict([(u'start_table_name', u'AThread')]) is not JSON serializable

2014-10-16 14:53:05.460 3345 INFO magnetodb.common.probe [-] PROBE: <class 'magnetodb.common.middleware.fault.FaultWrapper'>, <_MainThread(MainThread, started 140279752873728)>, finished, 3.87501716614 ms
192.168.33.1 - - [16/Oct/2014 14:53:05] "GET /v1/6542e7a7502e4e498ff87f5610e7e493/data/tables?start_table_name=AThread HTTP/1.1" 500 461 0.004425

Tags: ux
Changed in magnetodb:
milestone: none → kilo-1
tags: added: ux
Changed in magnetodb:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnetodb (master)

Reviewed: https://review.openstack.org/129387
Committed: https://git.openstack.org/cgit/stackforge/magnetodb/commit/?id=5724b25ead6771d16b99eca7ea0dcc6b4f6ffdc8
Submitter: Jenkins
Branch: master

commit 5724b25ead6771d16b99eca7ea0dcc6b4f6ffdc8
Author: Charles Wang <email address hidden>
Date: Fri Oct 17 17:22:42 2014 -0400

    Fix validation error handling and doc on list_tables

    DocImpact
    Closes-Bug: #1382088
    Change-Id: I3e55d6cd606a100e4cea5209c342a5f7a5c87056

Changed in magnetodb:
status: New → Fix Committed
Changed in magnetodb:
assignee: nobody → Charles Wang (charles-wang)
Changed in magnetodb:
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.