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

Bridge takes 3 minutes to startup unless gnome-keyring-daemon is killed beforehand #472

Open
g-regex opened this issue Apr 19, 2024 · 4 comments

Comments

@g-regex
Copy link

g-regex commented Apr 19, 2024

Hi! Since I have started using proton-mail-bridge (about 2 years ago), I have been experiencing this issue with every version of the bridge (currently 3.10.0):

When gnome-keyring-daemon is running, the bridge takes about 3 minutes to startup, reporting warnings that it failed to add test credentials. If gnome-keyring-daemon is not running, the bridge starts up without any delay.

Behaviour with gnome-keyring-daemon running (added the date command to show the delay):

$ date +%H:%M:%S && proton-mail-bridge -c
23:02:43
INFO[0000] Migrating keychain helper
WARN[Apr 19 23:03:44.539] Failed to add test credentials to keychain    error="timed out after 10s" helper="*keychain.SecretServiceDBusHelper"
WARN[Apr 19 23:05:59.136] Failed to add test credentials to keychain    error="Error calling StartServiceByName for org.freedesktop.secrets: Timeout was reached" helper="*secretservice.Secretservice"

            Welcome to Proton Mail Bridge interactive shell

Behaviour when killing gnome-keyring-daemon beforehand:

$ date +%H:%M:%S && killall gnome-keyring-daemon && proton-mail-bridge -c
23:19:27
INFO[0000] Migrating keychain helper

            Welcome to Proton Mail Bridge interactive shell

System information

proton-mail-bridge version: 3.10.0 (built from source)
System uname: Linux-6.6.21-gentoo-x86_64-Intel-R-_Core-TM-_i5-5250U_CPU_@_1.60GHz-with-glibc2.38

Versions of dependencies:

  • libsecret-0.21.1
  • protobuf-23.3
  • sentry-native-0.6.7
  • qtbase-6.7.0
  • qtdeclarative-6.7.0
  • qtsvg-6.7.0
  • mesa-24.0.4
  • grpc-1.60.0
  • ninja-1.11.1
  • cmake-3.28.3
  • go-1.22.2
  • unzip-6.0
  • pkgconfig-2.1.1
  • gcc-13.2.1

I have searched the GitHub issues but could not find anything similar. Is this a known problem and, if so, is there a better workaround (or fix) than killing gnome-keyring-daemon?

@droople1
Copy link

I am also having this problem.

@droople1
Copy link

droople1 commented Oct 14, 2024

If the gnome-keyring-daemon is running, then the bridge hangs after putting Creating keychain list in the logs, where it waits to timeout. I traced the timeout to here.

So this could be go keychain's problem.

Edit: My mistake, it should be this fork of go keychain.

@droople1
Copy link

droople1 commented Oct 14, 2024

I've been able to confirm that this problem occurs outside the context of protonmail-bridge. Running the function

func getSession() (*secretservice.SecretService, *secretservice.Session, error) {

in isolation (go-keychain was the only import) resulted in a timeout if gnome-keyring-daemon was running, and did not result in a timeout if it wasn't. I was able to confirm this for the upstream version of go-keychain as well.

This doesn't address the problem that protonmail-bridge will make you wait for the timeout even if you would prefer to use another helper.

@g-regex
Copy link
Author

g-regex commented Oct 24, 2024

@droople1, is your dbus session started properly?

Check whether DBUS_SESSION_BUS_ADDRESS is set. It wasn't set in my case. I'm not on a desktop environment such as Gnome or KDE and launched my window manager / wayland compositor with a command like exec i3 or exec Hyprland.
To make the dbus session visible to all children of the window manager, one should start it with a command like exec dbus-launch --exec-with-session i3.

With these changes, the issue disappears for me.

It might be useful to let the bridge check whether DBUS_SESSION_BUS_ADDRESS is set and let it print a warning otherwise.

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