Comment 0 for bug 1951005

Revision history for this message
DUFOUR Olivier (odufourc) wrote :

There is small issue currently with mysql-shell as it is right now.
It is reproducible on any Ubuntu deployment using this snap since its related to the snap environment itself.
(Tested in my case on Focal and Impish even with the locale en_US.UTF-8 generated on the system)

Whenever running mysql-shell command, it will complain right at the beginning about missing a locale
```
$ mysql-shell.mysqlsh
Cannot set LC_ALL to locale en_US.UTF-8: No such file or directory
MySQL Shell 8.0.23
```

While this is not blocking any command. It also pollutes messages and logs on mysql-innodb-cluster's charm since some hooks and actions use mysql-shell like "rejoin-instance" or simply during a Juju debug-log where it will appear as an error level type message.

It happens on mysql-shell based on version 8.0.23 and also 8.0.27 when I tried to rebuilt the snap from upstream version with the latest matching tag set on snapcraft.yaml file.

When looking at the source code of mysql-shell, this error is triggered from main.cc in the source code, where apparently the locale to use, en_US.UTF-8, is simply hardcoded : [1]
However from the snap environment of mysql-shell, only the locales C, C.UTF-8 are available.

I'm missing some informations about the way MySQL handles really the locale, but to fix this issue it will probably requires either to :
* install the locale en_US in the core18 environement
* make mysql-shell to use the only available locale in Ubuntu Core

For the first option, it doesn't see simple since I couldn't find a way to add a locale and specify on Ubuntu Core 18 image.

And just as a test for the second point, I made a quick and somewhat crude patch replacing all the en_US.UTF-8 entries to C.UTF-8 with the help of sed. It makes at least the initial error disappear when using mysql-shell but I haven't tested more since I don't know what is the right approach to fix this.

On minor issues regarding the snap package building itself :
a) There is an issue regarding the repository used for library boost where I get a 403 error from the server whenever I try to pull the archive.
I was able to circumvent this by obtening the archive here : [2]

b) to build the package, I also needed to add gcc-8 and g++-8 as requirements for the build-packages section in the snapcraft.yaml .

[1] : https://github.com/mysql/mysql-shell/blob/master/src/mysqlsh/main.cc#L628

[2] : https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz