Requirements containing non-ascii characters causes internal error

Bug #1803147 reported by Pierre Riteau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Confirmed
Medium
Pierre Riteau

Bug Description

Updating a lease with requirements including non-ascii characters caused the following trace:

2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server [-] Exception during message handling
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 155, in _process_incoming
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 222, in dispatch
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 192, in _do_dispatch
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/blazar/utils/service.py", line 77, in run_method
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server return method(**kwargs)
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/blazar/status.py", line 223, in wrapper
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server lease_id, str(e))
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 50: ordinal not in range(128)
2018-11-12 13:38:25.827 184217 ERROR oslo_messaging.rpc.server
2018-11-12 13:38:25.834 184189 ERROR blazar.api.v1.utils [-] Request aborted with status code 500 and message 'Internal Server Error'
2018-11-12 13:38:25.858 184189 ERROR blazar.api.v1.utils [-] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/blazar/api/v1/utils.py", line 76, in handler
    return func(**kwargs)
  File "/usr/lib/python2.7/site-packages/blazar/api/v1/validation.py", line 53, in handler
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blazar/api/v1/leases/v1_0.py", line 54, in leases_update
    return api_utils.render(lease=_api.update_lease(lease_id, data))
  File "/usr/lib/python2.7/site-packages/blazar/utils/__init__.py", line 32, in __run_method
    return getattr(self.instance, __name)(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blazar/policy.py", line 110, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blazar/api/v1/leases/service.py", line 76, in update_lease
    return self.manager_rpcapi.update_lease(lease_id, data)
  File "/usr/lib/python2.7/site-packages/blazar/manager/leases/rpcapi.py", line 43, in update_lease
    return self.call('update_lease', lease_id=lease_id, values=values)
  File "/usr/lib/python2.7/site-packages/blazar/utils/service.py", line 44, in call
    return self._client.call(ctx.to_dict(), name, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 465, in call
    return self.prepare().call(ctxt, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 169, in call
    retry=self.retry)
  File "/usr/lib/python2.7/site-packages/oslo_messaging/transport.py", line 97, in _send
    timeout=timeout, retry=retry)
  File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 566, in send
    retry=retry)
  File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 557, in _send
    raise result
RemoteError: Remote error: UnicodeEncodeError 'ascii' codec can't encode character u'\u201c' in position 50: ordinal not in range(128)

Lease stayed in UPDATING status.

This happened on a customized code base: first verify if this is repeatable with upstream code.

Changed in blazar:
assignee: nobody → Asmita Singh (asmita2018)
Revision history for this message
Pierre Riteau (priteau) wrote :

This was incorrectly marked as duplicate of https://bugs.launchpad.net/blazar/+bug/1804156.
It is a different bug, not related to Nova hypervisor hostnames.

Step to reproduce:

blazar lease-update foo --reservation id=<uuid>,resource_properties='[">=", "$Noël", "2"]'
ERROR: BlazarDBNotFound: A database error occurred

Changed in blazar:
status: New → Confirmed
assignee: Asmita Singh (asmita2018) → Pierre Riteau (priteau)
importance: Undecided → Medium
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.