ProtonVPN / proton-vpn-gtk-app

Official ProtonVPN Linux app
https://protonvpn.com/download-linux
GNU General Public License v3.0
152 stars 20 forks source link

`proton-vpn-gtk-app` not opening withing 2 minute (120 second) of system startup! #34

Closed BIGBEASTISHANK closed 4 months ago

BIGBEASTISHANK commented 4 months ago

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):


I am on arch linux and have bspwm, when use anything like old protovpn-gui/cli it openes fine on startup but when i put this new gtk app it dont open forsometimes it just shows genric png type image agter 2 minute it openes fine, tried running it throught termianl got output

╭─ishank@ArchBeast /home/ishank  ‹system›
╰─$ protonvpn-app
2024-02-24T15:00:08.552323 | proton.vpn.connection.vpnconnector:168 | INFO | CONN:STATE_CHANGED | Disconnected (initial state)
2024-02-24T15:00:08.553048 | proton.vpn.app.gtk.app:57 | INFO | APP:PROCESS_START | self=<app.App object at 0x7a929c329c00 (proton+vpn+app+gtk+app+App at 0x63f7e4212960)>
2024-02-24T15:00:08.643254 | proton.vpn.app.gtk.widgets.main.tray_indicator:45 | INFO | AyanaAppIndicator3 not found: Namespace AyatanaAppIndicator3 not available
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/secretstorage/util.py", line 48, in send_and_get_reply
    raise DBusErrorResponse(resp_msg)
jeepney.wrappers.DBusErrorResponse: [org.freedesktop.DBus.Error.ServiceUnknown] ('The name is not activatable',)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/keyring/backends/SecretService.py", line 61, in get_preferred_collection
    collection = secretstorage.get_default_collection(bus)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/secretstorage/collection.py", line 177, in get_default_collection
    return Collection(connection)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/secretstorage/collection.py", line 45, in __init__
    self._collection.get_property('Label')
  File "/usr/lib/python3.11/site-packages/secretstorage/util.py", line 67, in get_property
    (signature, value), = self.send_and_get_reply(msg)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/secretstorage/util.py", line 58, in send_and_get_reply
    raise SecretServiceNotAvailableException(data) from resp
secretstorage.exceptions.SecretServiceNotAvailableException: The name is not activatable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/proton/keyring_linux/core/keyring_linux.py", line 99, in _is_backend_working
    keyring_backend.get_password(
  File "/usr/lib/python3.11/site-packages/keyring/backends/SecretService.py", line 78, in get_password
    collection = self.get_preferred_collection()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keyring/backends/SecretService.py", line 63, in get_preferred_collection
    raise InitError("Failed to create the collection: %s." % e)
keyring.errors.InitError: Failed to create the collection: The name is not activatable.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/proton/vpn/app/gtk/app.py", line 94, in do_activate
    self.tray_indicator = self._build_tray_indicator_if_possible(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/vpn/app/gtk/app.py", line 195, in _build_tray_indicator_if_possible
    return TrayIndicator(controller, main_window)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/vpn/app/gtk/widgets/main/tray_indicator.py", line 118, in __init__
    self._menu = self._build_menu()
                 ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/vpn/app/gtk/widgets/main/tray_indicator.py", line 221, in _build_menu
    if self._controller.user_logged_in:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/vpn/app/gtk/controller.py", line 129, in user_logged_in
    return self._api.is_user_logged_in()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/vpn/core/api.py", line 89, in is_user_logged_in
    return self._session_holder.session.logged_in
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/vpn/core/session.py", line 71, in session
    self._session = self._proton_sso.get_default_session(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/sso/sso.py", line 192, in get_default_session
    sessions = self.sessions
               ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/sso/sso.py", line 130, in sessions
    keyring = self._keyring
              ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/sso/sso.py", line 111, in _keyring
    self.__keyring_backend = Keyring.get_from_factory()
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/keyring/_base.py", line 49, in get_from_factory
    keyring_backend = Loader.get("keyring", class_name=backend)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/loader/loader.py", line 105, in get
    if entry.cls._validate():
       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/keyring_linux/secretservice/secretservice_backend.py", line 40, in _validate
    return cls._is_backend_working(SecretService.Keyring())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/proton/keyring_linux/core/keyring_linux.py", line 108, in _is_backend_working
    logger.exception(f"Keyring \"{keyring_backend}\" error")
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keyring/backend.py", line 95, in __str__
    keyring_class.__module__, keyring_class.__name__, keyring_class.priority
                                                      ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/jaraco/classes/properties.py", line 201, in __get__
    return self.fget.__get__(None, owner)()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keyring/backends/SecretService.py", line 43, in priority
    raise RuntimeError(
RuntimeError: The Secret Service daemon is neither running nor activatable through D-Bus

(protonvpn-app:2428): Gdk-CRITICAL **: 20:30:08.837: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed

after 2 minute, exactly 120 sec it works fine without error

molaeiali commented 4 months ago

@BIGBEASTISHANK you need to install one of these "optional" packages based on your DE/WM for the python-proton-keyring-linux package:

gnome-keyring - Gnome keyring support
kwallet5 – KDE keyring support
pass

the 120 seconds might be because the app is waiting for a secret service to be available and it times out after 120 seconds

BIGBEASTISHANK commented 4 months ago

need to install one of these

Just for records, i use brave which install kwallet5

the 120 seconds might be because the app is waiting for a secret service to be available and it times out after 120 seconds

i dont think you read the issue properly, it works fine efter 120 seconds, like if my pc boots up (login) and its been 30 seconds, i try to run proton it dont work, killall proton process, try after 120 seconds of total login time, it works

molaeiali commented 4 months ago

@BIGBEASTISHANK Sorry I've not read your comment carefully, so then there might be something wrong with other services in your system, I'm not familiar with kwallet enough, so can you do this command for kwallet and see if there is an issue there?

systemd-analyze --user critical-chain gnome-keyring-daemon.service

these are the results for me:

gnome-keyring-daemon.service @154ms
└─basic.target @151ms
  └─sockets.target @151ms
    └─dbus.socket @143ms +7ms
      └─app.slice @143ms
        └─-.slice @103ms

so it takes 154ms for it to be up and running, I'm guessing it's taking longer for you

BIGBEASTISHANK commented 4 months ago

these are the results for me:

╰─$ systemd-analyze --user critical-chain gnome-keyring-daemon.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

╭─ishank@ArchBeast /home/ishank  ‹system›
molaeiali commented 4 months ago

@BIGBEASTISHANK No, you don't have the "Gnome" keyring obviously, I don't know what's the wallet service name, do it for that

molaeiali commented 4 months ago

It might be plasma-kwallet-pam.service I'm not sure though

BIGBEASTISHANK commented 4 months ago

I searched the issue on chat gpt, it told me that their might be issue with dbus, somethign secrat service like that

╭─ishank@ArchBeast /home/ishank  ‹system›
╰─$ systemd-analyze --user critical-chain dbus.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

dbus-broker.service +10ms
└─dbus.socket @446ms +11ms
  └─app.slice @445ms
    └─-.slice @405ms
╭─ishank@ArchBeast /home/ishank  ‹system›
╰─$ systemd-analyze --user critical-chain kwallet5.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

╭─ishank@ArchBeast /home/ishank  ‹system›
╰─$ paru -S kwallet5
[sudo] password for ishank:
warning: kwallet5-5.115.0-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) kwallet5-5.115.0-1

Total Download Size:   0.57 MiB
Total Installed Size:  2.39 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] ^C
Interrupt signal received

╭─ishank@ArchBeast /home/ishank  ‹system›
╰─$ systemd-analyze --user critical-chain plasma-kwallet-pam.service                 ↵ 1
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
BIGBEASTISHANK commented 4 months ago

@BIGBEASTISHANK you need to install one of these "optional" packages based on your DE/WM for the python-proton-keyring-linux package:

gnome-keyring - Gnome keyring support
kwallet5 – KDE keyring support
pass

the 120 seconds might be because the app is waiting for a secret service to be available and it times out after 120 seconds

Got it fixed, the problem was kwallet5 is just slow and protonvpn works better with gnome-keyring

potential fix:

paru -S kwallet5
paru -S gnome-keyring pass

i have to install kwallet as i use ark which works on kwallet for some reason Thanks @molaeiali