SOLVED - Launcher App - Error calling __commands::nuke_12.1v2((), {}): - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 150: invalid continuation byte

Hello group,

We are using Shotgun and it’s pipeline for a couple of years now.
We’re in the process of updating the Pipeline to Python 3. Which hasn’t been smooth to say the least…

So we’ve installed the newest version of SG Desktop and set the env var SHOTGUN_PYTHON_VERSION = 3.

Desktop starts normally, but now on some machines we get the following error when we want to launch Nuke or Houdini. Now on most machines we can launch, but for some unknown reason we can’t on others.

2022-03-09 11:07:33,418 [    INFO] Connecting to gui pipe \\.\pipe\pyc-25540-0-zbhe2q8r
2022-03-09 11:07:40,192 [   ERROR] [PROXY] Error calling __commands::nuke_12.1v2((), {}):
Traceback (most recent call last):
  File "C:\Users\HIDDEN\AppData\Roaming\Shotgun\bundle_cache\app_store\tk-desktop\v2.6.1\python\tk_desktop\desktop_engine_project_implementation.py", line 210, in _trigger_callback
    callback(*args, **kwargs)
  File "C:\Users\HIDDEN\AppData\Roaming\Shotgun\HIDDEN\p1607c1616.basic.desktop\cfg\install\core\python\tank\platform\engine.py", line 1083, in callback_wrapper
    return callback(*args, **kwargs)
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.1\python\tk_multi_launchapp\base_launcher.py", line 138, in launch_version
    **kwargs
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.1\python\tk_multi_launchapp\base_launcher.py", line 405, in _launch_callback
    software_entity,
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.1\python\tk_multi_launchapp\base_launcher.py", line 190, in _launch_app
    app_engine, app_path, app_args, context, file_to_open
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.1\python\tk_multi_launchapp\prepare_apps.py", line 51, in prepare_launch_for_engine
    launch_info = launcher.prepare_launch(app_path, app_args, file_to_open)
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-nuke\v0.14.3\startup.py", line 267, in prepare_launch
    required_env["TANK_CONTEXT"] = sgtk.Context.serialize(self.context)
  File "C:\Users\HIDDEN\AppData\Roaming\Shotgun\HIDDEN\p1607c1616.basic.desktop\cfg\install\core\python\tank\context.py", line 762, in serialize
    return pickle.dumps(data)
  File "C:\Users\HIDDEN\AppData\Roaming\Shotgun\HIDDEN\p1607c1616.basic.desktop\cfg\install\core\python\tank\util\pickle.py", line 46, in dumps
    return six.ensure_str(cPickle.dumps(data, **DUMP_KWARGS))
  File "C:\Users\HIDDEN\AppData\Roaming\Shotgun\HIDDEN\p1607c1616.basic.desktop\cfg\install\core\python\tank_vendor\six.py", line 899, in ensure_str
    s = s.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 150: invalid continuation byte

It looks like for some reason in Python 3 mode it cannot properly decode a string. But why it does work on other machines is a mystery. So for now we have to revert back to python 2 on some machines. But this is not a nice sollution since some apps don’t work properly.
Now, I don’t want to fiddle with the App code itself, otherwise I have to change the code everytime we update the App in the future.

If anybody has a solution or other insights it would really make my day…

Cheers,

David

We saw similar error if user had international punctuation(unicode character) in his name. If we removed such characters it was working again. I’ve reported to AD and this is what they wrote back to me

Engineering team has confirmed it is a bug. The internal bug ticket is SG-6588. Because it is could be avoided by changing “i” to “i”. It won’t be on high priority to be fixed. I am sorry about that.

Our tracelog was this

`2021-11-16 14:47:35,859 [   ERROR] [PROXY] Error calling __commands::maya_2020((), {}):
Traceback (most recent call last):
  File "\\XXXXX\_toolkits\_engines\tk-desktop\v2.6.0\python\tk_desktop\desktop_engine_project_implementation.py", line 210, in _trigger_callback
    callback(*args, **kwargs)
  File "C:\Users\XXXX\AppData\Roaming\Shotgun\XXXX\p221c233.basic.desktop\cfg\install\core\python\tank\platform\engine.py", line 1083, in callback_wrapper
    return callback(*args, **kwargs)
  File "\\XXXXXX\_toolkits\_apps\tk-multi-launchapp\v0.12.0\python\tk_multi_launchapp\base_launcher.py", line 138, in launch_version
    **kwargs
  File "\\XXXXXX\_toolkits\_apps\tk-multi-launchapp\v0.12.0\python\tk_multi_launchapp\base_launcher.py", line 405, in _launch_callback
    software_entity,
  File "\\XXXXXX\_toolkits\_apps\tk-multi-launchapp\v0.12.0\python\tk_multi_launchapp\base_launcher.py", line 190, in _launch_app
    app_engine, app_path, app_args, context, file_to_open
  File "\\XXXXXX\_toolkits\_apps\tk-multi-launchapp\v0.12.0\python\tk_multi_launchapp\prepare_apps.py", line 51, in prepare_launch_for_engine
    launch_info = launcher.prepare_launch(app_path, app_args, file_to_open)
  File "\\XXXXXX\_toolkits\_engines\tk-maya\v0.11.1\startup.py", line 137, in prepare_launch
    required_env["SGTK_CONTEXT"] = sgtk.context.serialize(self.context)
  File "C:\Users\XXXX\AppData\Roaming\Shotgun\XXXX\p221c233.basic.desktop\cfg\install\core\python\tank\context.py", line 1702, in serialize
    return context.serialize()
  File "C:\Users\XXXX\AppData\Roaming\Shotgun\XXXX\p221c233.basic.desktop\cfg\install\core\python\tank\context.py", line 770, in serialize
    return pickle.dumps(data)
  File "C:\Users\XXXX\AppData\Roaming\Shotgun\XXXX\p221c233.basic.desktop\cfg\install\core\python\tank\util\pickle.py", line 46, in dumps
    return six.ensure_str(cPickle.dumps(data, **DUMP_KWARGS))
  File "C:\Users\XXXX\AppData\Roaming\Shotgun\XXXX\p221c233.basic.desktop\cfg\install\core\python\tank_vendor\six.py", line 899, in ensure_str
    s = s.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 147: invalid continuation byte`

Looks pretty similar

In our case it was “í” in your case seems to be “é”
Ales

1 Like

Hi Ales,

Cheers for the quick reply.
You mean in the Shotgun user name? Of the system User name?

Cheers,

David

Shotgrid’s one, or better AD’s one, it was ok until we migrated to AD identity

Hey Ales,

As I said, you made my day :wink:
It was indeed a user with é
Had to change it in 2 places. In “name” en “first name” for anyone else who encounters this.

Cheers!

1 Like