Bug #107269 MySQL Workbench can't connect to server when gnome-keyring-daemon is not running
Submitted: 12 May 2022 8:05 Modified: 13 May 2022 9:33
Reporter: Liu Yan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:8.0.29 OS:Fedora (35)
Assigned to: CPU Architecture:x86
Tags: MySQL Workbench

[12 May 2022 8:05] Liu Yan
Description:
Because gnome-keyring-daemon has a [serious bug](https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/84), I had forbidden gnome-keyring-daemon running by execute `chmod -x /usr/bin/gnome-keyring-*; killall gnome-keyring-daemon;` command.

After gnome-keyring-daemon been disabled and been stopped, MySQL Workbench can't connect to MySQL server (can't open saved connection) anymore:
An error messagebox popup, with error message:

  #### Error message start ####
  Cannot Connect to Database Server
  
  Your connection attemp failed for user 'root' to MySQL server at 127.0.0.1:3306:
    The name is not activatable
  ...
  #### Error message end ####

And, it does not ask me to re-enter password to connect to server after the after messagebox closed.

How to repeat:
* Disable gnome-keyring-daemon and stop it
  `chmod -x /usr/bin/gnome-keyring-*; killall gnome-keyring-daemon;`
* Run mysql-workbench, and try open any saved connection which had put password into keyring.

Suggested fix:
* Ask user to re-enter password to connect to server when looking up password from gnome-keyring-daemon failed.
* Decoupling with gnome-keyring, It would be wonderful if MySQL Workbench can work with other keyring/keychain daemons, say gpg-agent or Kwallet?
[12 May 2022 12:31] MySQL Verification Team
Hello Liu Yan,

Thank you for the bug report.
Imho this is duplicate of Bug #91836, please see Bug #91836. 

Regards,
Ashwini Patil
[13 May 2022 9:33] Liu Yan
Thanks for the quick response, MySQL Verification Team.

Looks like several users have similar situations, my second 'Suggested fix' is duplicated to Bug #91836.

However, my first 'Suggested fix' is about to choose a fallback option to connect to server - let the user enter password if lookup for password failed.

I think it's reasonable, because if the password is stored/retrieved to/from outside, there will be a chance that the operation may fail or out of control, so choose a fallback option to retrieve password by let the user enter it could make the connection succeeded, and increased user experience.

Regards,
Liu Yan
[16 Feb 19:52] Chris Mayfield
I second Liu Yan's suggested fix of asking the user to enter the password if gnome keyring fails. MySQL Workbench is completely usable in our university's computer labs, because we have disabled gnome keyring.

In fact, students don't even get the chance to enter a password for the first time. If gnome keyring is not present, the following error message is displayed when attempting to create a new connection: "Error calling StartServiceByName for org.freedesktop.secrets: Failed to execute program org.freedesktop.secrets: Permission denied."

I tried running Workbench with WB_NO_GNOME_KEYRING=1 and got the same error.

P.S. I searched bugs.mysql.com for all bugs with the word "keyring" in the MySQL Workbench category. There's a long history of people reporting issues related to this one. If users could enter a password every time, and Workbench did not force users to save passwords, then Workbench could work on a wider range of Linux environments.

https://bugs.mysql.com/search.php?cmd=display&bug_type[]=MySQL+Workbench&status=All&search...