mysql / mysql/mysql-shell-plugins

When the system language is Chinese, it cannot be normalized

Open
#20 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
96
Forks
22
PR merge metrics
No merged PRs in 30d

Description

When I switch the system language to English, it's normal

Below is the log information

Running on a local VS Code session.
Starting embedded MySQL Shell, using config dir '/home/user/.mysqlsh-gui' ...
Cannot set LC_ALL to locale en_US.UTF-8: No such file or directory

Please enter the single instance token:
23:1:33.960889 INFO: Token read from STDIN
23:1:33.961106 INFO: Starting MySQL Shell GUI web server...

23:1:34.14769 INFO: Checking web server certificate...

23:1:34.42297 DEBUG3: Executing Shell Command: certutil.exe -verifystore -user ROOT MySQL Shell Auto Generated CA Certificate

23:1:34.296013 ERROR: Exception information:
Traceback (most recent call last):

  • File "/home/user/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.8.2-linux-x64/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 "/home/user/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.8.2-linux-x64/shell/lib/mysqlsh/plugins/gui_plugin/core/lib/SystemUtils.py", line 157, in run_shell_cmd
  • output = stream.read()
  • File "/home/user/.vscode-server/extensions/oracle.mysql-shell-for-vs-code-1.8.2-linux-x64/shell/lib/mysqlsh/lib/python3.10/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

23:1:34.296734 DEBUG: The certificate installation is inconsistent:
23:1:34.296840 DEBUG: USER_HOME: /home/user/.mysqlsh-gui/plugin_data/gui_plugin/web_certs/rootCA.crt, [Installed: True, Valid: True]
23:1:34.296917 DEBUG: WIN: WIN Certificate Store, [Installed: False, Valid: False, Reason: The certificate is not installed at WIN Certificate Store]
23:1:34.296967 INFO: The installed certificate has errors: The certificate is not installed at WIN Certificate Store
23:1:34.297099 INFO: Certificate is not installed. Use gui.core.installShellWebCertificate() to install one.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with shell/lib/mysqlsh/plugins/gui_plugin/core/lib/certs/locations.py, especially _get_installed_certs, and then inspect shell/lib/mysqlsh/plugins/gui_plugin/core/lib/SystemUtils.py around run_shell_cmd. Reproduce the certificate check under the Chinese system locale and trace the non-UTF-8 output. Done means the check and certificate installation complete without the UnicodeDecodeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, python, vscode
Domain
security, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.