put item fails while trying to put utf-8 string value

Bug #1399648 reported by Andrii Ostapenko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
High
Andrii Ostapenko

Bug Description

trying to put item:
{
        "item": {
                "hash": {"S": "â"}
        }

}

we receive an error:
'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Server side:

File "/opt/stack/magnetodb/magnetodb/common/middleware/fault.py", line 114, in process_request
    return req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/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/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/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 755, in __call__
    return self._call_app(env, start_response)
  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token.py", line 691, in _call_app
    return self._app(env, _fake_start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/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/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/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/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/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/put_item.py", line 77, in process_request
    expected_condition_map=expected_item_conditions,
  File "/opt/stack/magnetodb/magnetodb/storage/__init__.py", line 180, in put_item
    if_not_exist, expected_condition_map
  File "/opt/stack/magnetodb/magnetodb/storage/manager/simple_impl.py", line 313, in put_item
    if_not_exist, expected_condition_map
  File "/opt/stack/magnetodb/magnetodb/common/probe.py", line 94, in wrapper
    return f(*args, **kwargs)
  File "/opt/stack/magnetodb/magnetodb/storage/driver/cassandra/cassandra_impl.py", line 765, in put_item
    self.__cluster_handler.execute_query("".join(query_builder),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Tags: ux
Changed in magnetodb:
status: New → Triaged
importance: Undecided → High
milestone: none → kilo-1
tags: added: ux
Changed in magnetodb:
assignee: nobody → Andrei V. Ostapenko (aostapenko)
Changed in magnetodb:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnetodb (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnetodb (master)

Reviewed: https://review.openstack.org/139977
Committed: https://git.openstack.org/cgit/stackforge/magnetodb/commit/?id=6118e86574e11bbcc005902c63b654f92c4d60ab
Submitter: Jenkins
Branch: master

commit 6118e86574e11bbcc005902c63b654f92c4d60ab
Author: Andrei V. Ostapenko <email address hidden>
Date: Fri Dec 5 20:48:12 2014 +0200

    Fixes bug with unicode data

    Closes-bug: #1399648
    Change-Id: I5397fddeb5fd04582baa48a31fc957f193330f1d

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