Bug #109403 MySQL Shell vscode extension doesn't work on Pop!_OS
Submitted: 16 Dec 2022 8:44 Modified: 30 Sep 2023 12:47
Reporter: rustam docstranslator Email Updates:
Status: No Feedback Impact on me:
None 
Category:Shell VSCode Extension Severity:S2 (Serious)
Version:1.6.0 OS:Linux
Assigned to: MySQL Verification Team CPU Architecture:x86

[16 Dec 2022 8:44] rustam docstranslator
Description:
MySQL Shell plugin for VSCode(from snap) doesn't install certificates on Pop!_OS.
And because of that it is not usable.
The configuration wizard simply doesn't open a terminal window for install.sh.
And frankly install.sh isn't generated at all.
So the plugin is useless on POP!_OS
But if you copy install.sh(from other install) and run it, it works just fine.

OS:
Pop!_OS 22.04
Vscode -> latest from snap
MySQL -> provided by the system  8.0.31-22.04.1 (the one from ubuntu -> debian repos)

Expected:
MySQL Shell plugin Wizard to configure itself successfully like on Ubuntu(vscode from snap)

Actual:
MySQL Shell plugin Wizard does nothing and MySQL Shell plugin Wizard is useless

p.s:
I tried such setups to troubleshoot:
1)
Ubuntu + MySQL(tar.gz) + vscode(apt) + MySQL Shell plugin 
-> works
2) 
Ubuntu + Mysql from Mysql repo + vscode(apt) + MySQL Shell plugin 
-> works the best (cause during install sets temporary root password, which is easily changed afterwards)
3)
Ubuntu + Mysql from ubuntu + vscode(apt) + MySQL Shell plugin 
-> works
4) Ubuntu + Mysql from ubuntu + vscode(snap) + MySQL Shell plugin 
-> works
5) Pop!_OS  + Mysql from ubuntu + vscode(snap) + MySQL Shell plugin 
-> doesn't generate install.sh  & doesn't show a shell window to install certs
DOESN'T WORK

How to repeat:
1) install mysql-server provided by Ubuntu
  sudo apt install mysql-server
2)set root password
  sudo mysql -u root -p 
  ALTER user 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '0';
  exit
3) install snapd & vscode
sudo apt install snapd
sudo snap install snap-store
in snap-store -> install vscode
(alternatively install from cmd: sudo snap install code)
4) install MySQL Shell From vscode
5) in MySQL shell wizard press on the button
6) see that NOTHING HAPPENS -> no terminal window is invoked which installs libnss3-tools
7) see in ~/.mysqlsh-gui/plugin_data/gui_plugin/web_certs/ that there is no 
   install.sh  file present

Suggested fix:
the workaround is to copy the goddamn install.sh from a working installation
and run it on Pop!_OS and then magically everything will gonna work.

So steps:
1) get install.sh from a Ubuntu 22.04 LTS from Visual Studio Code installed from snap (where plugin works & shell window opens & install.sh runs)
2) copy to Pop!_OS 22.04 (where install.sh wasn't generated)
  cp install.sh ~/.mysqlsh-gui/plugin_data/gui_plugin/web_certs/
3) run ~/.mysqlsh-gui/plugin_data/gui_plugin/web_certs/install.sh
4) press y
5) work with MySQL Shell in Vscode(from snap) on Pop!_OS
[16 Dec 2022 9:19] rustam docstranslator
For a matter of fact Wizard doesn't work at all on Pop!_OS

i tried:
Pop!_OS 22.04
MySQL from debian repo
VSCode from apt(microsoft repo)

MySQL Shell plugin for vscode doesn't generate and launch install.sh on Pop!_OS.
[16 Dec 2022 9:32] rustam docstranslator
os-release file on POP!_OS shows  ID_LIKE="ubuntu debian"

$ cat /etc/os-release

NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-osv

and if I change ID_LIKE to be ID_LIKE="debian"

Wizard WORKS !!!

so the issue is in 

https://github.com/mysql/mysql-shell-plugins/blob/b4eace716898a1532e827a92c362df8193de5cbc...

the function is hardcoded to a single value
ID_LIKE="debian"
instead of searching "debian" in ID_LIKE="ubuntu debian"
[16 Dec 2022 9:40] rustam docstranslator
I mean get_script() is hardcoded to "debian" instead of dealing with (ID_LIKE="ubuntu debian" & ID_LIKE="ubuntu")

https://github.com/mysql/mysql-shell-plugins/blob/b4eace716898a1532e827a92c362df8193de5cbc...
 
So essentially the plugin could work on any Ubuntu based Linux distro, but it doesn't cause of some hardcoded things...

There are 49 distros based Ubuntu on distrowatch:
https://distrowatch.com/search.php?ostype=All&category=All&origin=All&basedon=Ubuntu&notba...
[30 Aug 2023 12:47] MySQL Verification Team
Hello Rustam,

Thank you for the report.
This is open source and if you file a pull request, we will check it and merge it if there's no problem. Thanks.

Regards,
Ashwini Patil
[1 Oct 2023 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".