kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.08k stars 365 forks source link

Migration fails with "AttributeError: 'str' object has no attribute 'decode'" #1339

Open Catfriend1 opened 3 years ago

Catfriend1 commented 3 years ago

Hi,

I've found a bug.

Error:
[19/Jan/2021:16:34:26] HTTP
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python3/dist-packages/cherrypy/lib/encoding.py", line 220, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cpdispatch.py", line 60, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/wok/control/base.py", line 161, in wrapper
    action_result = action_fn(*model_args)
  File "/usr/lib/python3/dist-packages/wok/plugins/kimchi/model/vms.py", line 2100, in migrate
    name = name.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

Reproducer:

Root cause:

I could work around by commenting the two "decode" lines out.

Specs: