Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL VS Code MySQL Shell UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 6: invalid continuation byte #46

Open
opsarno opened this issue Mar 7, 2024 · 2 comments

Comments

@opsarno
Copy link

opsarno commented Mar 7, 2024

Environment

  • Windows 11
  • VS Code 1.87.0
  • MySQL Shell for VS Code v1.14.2
# RockyLinux 8.9
PS C:\Users\fande> wsl -l -v
  NAME                   STATE           VERSION
* RockyLinux             Running         2

MySQL Shell For VS Code - Debug message

Running on a local VS Code session.
Starting embedded MySQL Shell, using config dir '/root/.mysqlsh-gui' ...
Please enter the single instance token: 
15:58:31.542697 INFO: Token read from STDIN
15:58:31.542765 INFO: Starting MySQL Shell GUI web server...

15:58:31.542928 INFO: 	Checking web server certificate...

15:58:31.659934 ERROR: Exception information:
Traceback (most recent call last):
-  File "/root/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.14.2/shell/lib/mysqlsh/plugins/gui_plugin/core/lib/certs/locations.py", line 719, in _get_installed_certs
-    exit_code, output = lib.run_shell_cmd(cmd)
-  File "/root/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.14.2/shell/lib/mysqlsh/plugins/gui_plugin/core/lib/SystemUtils.py", line 157, in run_shell_cmd
-    output = stream.read()
-  File "/root/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.14.2/shell/lib/mysqlsh/lib/python3.9/codecs.py", line 322, in decode
-    (result, consumed) = self._buffer_decode(data, self.errors, final)
-UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 6: invalid continuation byte

15:58:31.660251 DEBUG: The certificate installation is inconsistent:
15:58:31.660286 DEBUG: USER_HOME: /root/.mysqlsh-gui/plugin_data/gui_plugin/web_certs/rootCA.crt, [Installed: True, Valid: True]
15:58:31.660304 DEBUG: WIN: WIN Certificate Store, [Installed: False, Valid: False, Reason: The certificate is not installed at WIN Certificate Store]

15:58:31.660316 INFO: The installed certificate has errors: The certificate is not installed at WIN Certificate Store

15:58:31.660362 INFO: 	Certificate is not installed. Use gui.core.installShellWebCertificate() to install one.

Starting embedded MySQL Shell, using config dir '/root/.mysqlsh-gui' ...
15:58:42.289654 ERROR: Exception information:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 6: invalid continuation byte

15:58:46.690508 ERROR: Exception information:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 6: invalid continuation byte

15:58:46.782888 ERROR: Exception information:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 6: invalid continuation byte

true

image

@Misaka-Mikodo
Copy link

I have the same issue.

@Misaka-Mikodo
Copy link

@opsarno I found the reason for this problem: the character set of your windows terminal is gbk encoding, so using utf-8 decoding will cause errors. I have a simple solution: open the plug-in root directory, such as /root/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.14.2/shell/lib/mysqlsh/plugins/gui_plugin/core/lib/SystemUtils.py shown in your log, add encoding='gbk' in the subprocess.Popen function called by popen function, and restart the vscode to install it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants