If the console.log contains control characters, get console output fails with UnknownError

Bug #758054 reported by Vish Ishaya on 2011-04-11
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Yuriy Taraday

Bug Description

This is due to rpc trying to serialize the message to utf-8

2011-04-11 19:51:19,232 ERROR nova [-] Exception during message handling
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc.py", line 202, in _receive
(nova): TRACE: msg_reply(msg_id, rval, None)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc.py", line 260, in msg_reply
(nova): TRACE: publisher.send({'result': reply, 'failure': failure})
(nova): TRACE: File "/usr/lib/pymodules/python2.6/carrot/messaging.py", line 753, in send
(nova): TRACE: serializer=serializer)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/carrot/messaging.py", line 682, in create_message
(nova): TRACE: serializer=serializer)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/carrot/serialization.py", line 137, in encode
(nova): TRACE: payload = encoder(data)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/anyjson/__init__.py", line 123, in <lambda>
(nova): TRACE: serialize = lambda value: implementation.serialize(value)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/anyjson/__init__.py", line 83, in serialize
(nova): TRACE: return self._encode(data)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/simplejson/__init__.py", line 230, in dumps
(nova): TRACE: return _default_encoder.encode(obj)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/simplejson/encoder.py", line 200, in encode
(nova): TRACE: chunks = self.iterencode(o, _one_shot=True)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/simplejson/encoder.py", line 260, in iterencode
(nova): TRACE: return _iterencode(o, 0)
(nova): TRACE: UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 5618: unexpected code byte
(nova): TRACE:
2011-04-11 19:51:19,235 ERROR nova.rpc [-] Returning exception 'utf8' codec can't decode byte 0xff in position 5618: unexpected code byte to caller

Related branches

Thierry Carrez (ttx) wrote :

Cool bug.

Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Yuriy Taraday (yorik-sar) wrote :

Got the same error. Patch in attachment.
Unfortunately, after slipping through all modules we can get only ascii-allowed symbols.
So I added some sanitizing into libvirt driver since get_console_output is implemented in this driver only. Probably, this should be done in more abstract way.

Yuriy Taraday (yorik-sar) wrote :

Created branch and proposed it for merging.

Thierry Carrez (ttx) on 2011-05-02
Changed in nova:
assignee: nobody → Yuriy Taraday (yorik-sar)
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2011-06-02
Changed in nova:
milestone: none → diablo-1
Thierry Carrez (ttx) on 2011-09-22
Changed in nova:
milestone: diablo-1 → 2011.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers