slgobinath / SafeEyes

Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder
http://slgobinath.github.io/SafeEyes/
1.41k stars 158 forks source link

Flatpak: Sometimes it fails to show the break screen #595

Closed XargonWan closed 2 days ago

XargonWan commented 2 weeks ago

Describe the bug Not very clear when, but sometimes is showing the break screen and sometimes it fails. Maybe related to suspension.

To Reproduce Steps to reproduce the behavior:

  1. Install SafeEyes
  2. Wait or trigger a break
  3. Sometimes works, sometimes not
  4. Next break is showing for example 10:50 hence is 10:54
  5. Quitting and restarting the application is changing the next break text but not resume it working condition

Expected behavior The break screen is always showing

Desktop (please complete the following information):

Debug Log

flatpak run io.github.slgobinath.SafeEyes --debug
2024-07-02 10:47:52,509 [DEBUG]:[MainThread] Initialize the platform
2024-07-02 10:47:52,513 [INFO]:[MainThread] Starting Safe Eyes
2024-07-02 10:47:52,535 [INFO]:[MainThread] Initialize the break screen
2024-07-02 10:47:52,535 [INFO]:[MainThread] Load all the plugins
2024-07-02 10:47:52,535 [INFO]:[MainThread] Initialize the core
2024-07-02 10:47:52,536 [INFO]:[MainThread] Successfully loaded <module 'donotdisturb.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/donotdisturb/plugin.py'>
2024-07-02 10:47:52,536 [INFO]:[MainThread] Successfully loaded <module 'notification.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/notification/plugin.py'>
2024-07-02 10:47:52,537 [INFO]:[MainThread] Successfully loaded <module 'audiblealert.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/audiblealert/plugin.py'>
2024-07-02 10:47:52,537 [INFO]:[MainThread] Successfully loaded <module 'trayicon.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/trayicon/plugin.py'>
2024-07-02 10:47:52,538 [INFO]:[MainThread] Successfully loaded <module 'smartpause.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/smartpause/plugin.py'>
2024-07-02 10:47:52,538 [INFO]:[MainThread] Successfully loaded <module 'screensaver.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/screensaver/plugin.py'>
2024-07-02 10:47:52,542 [INFO]:[MainThread] Successfully loaded <module 'healthstats.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/healthstats/plugin.py'>
2024-07-02 10:47:52,542 [INFO]:[MainThread] Successfully loaded <module 'mediacontrol.plugin' from '/app/lib/python3.11/site-packages/safeeyes/plugins/mediacontrol/plugin.py'>
2024-07-02 10:47:52,542 [DEBUG]:[MainThread] Initialize Skip Fullscreen plugin
2024-07-02 10:47:52,542 [DEBUG]:[MainThread] Initialize Notification plugin
2024-07-02 10:47:52,542 [DEBUG]:[MainThread] Initialize Audible Alert plugin
2024-07-02 10:47:52,542 [DEBUG]:[MainThread] Initialize Tray Icon plugin
2024-07-02 10:47:52,545 [DEBUG]:[MainThread] Initialize Smart Pause plugin
2024-07-02 10:47:52,545 [DEBUG]:[MainThread] Initialize Screensaver plugin
2024-07-02 10:47:52,545 [DEBUG]:[MainThread] Initialize Health Stats plugin
2024-07-02 10:47:52,545 [DEBUG]:[MainThread] Health stats will be reset at 2024-07-03 00:00:00
2024-07-02 10:47:52,545 [INFO]:[MainThread] Setting up an RPC server on port 7200
2024-07-02 10:47:52,546 [INFO]:[MainThread] Start the RPC server
2024-07-02 10:47:52,546 [DEBUG]:[MainThread] Start Smart Pause plugin
2024-07-02 10:47:52,546 [INFO]:[MainThread] Start Safe Eyes core
2024-07-02 10:47:52,547 [INFO]:[WorkThread] Waiting for 20 minutes until next break
2024-07-02 10:47:52,550 [INFO]:[MainThread] Update next break information
2024-07-02 10:47:58,621 [INFO]:[WorkThread] Take a break due to external request
2024-07-02 10:47:58,621 [INFO]:[WorkThread] Stop the scheduler
2024-07-02 10:47:58,621 [INFO]:[WorkThread] Pre-break waiting is over
2024-07-02 10:47:59,622 [INFO]:[MainThread] Close pre-break notification
2024-07-02 10:47:59,626 [ERROR]:[MainThread] Introspect error on :1.263:/org/mpris/MediaPlayer2: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.26198" (uid=1000 pid=562792 comm="xdg-dbus-proxy --args=43" label="flatpak (unconfined)") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.263" (uid=1000 pid=7987 comm="/snap/firefox/4451/usr/lib/firefox/firefox" label="snap.firefox.firefox (enforce)")
2024-07-02 10:47:59,626 [DEBUG]:[MainThread] Executing introspect queue due to error
Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/safeeyes/utility.py", line 106, in <lambda>
    GLib.idle_add(lambda: target_function(*args, **kwargs))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/safeeyes/core.py", line 275, in __fire_start_break
    self.start_break.fire(break_obj)
  File "/app/lib/python3.11/site-packages/safeeyes/model.py", line 291, in fire
    if not handler(*args, **keywargs):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/safeeyes/safeeyes.py", line 268, in start_break
    actions = self.plugins_manager.get_break_screen_tray_actions(break_obj)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/safeeyes/plugin_manager.py", line 206, in get_break_screen_tray_actions
    action = plugin['module'].get_tray_action(break_obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/safeeyes/plugins/mediacontrol/plugin.py", line 73, in get_tray_action
    players = __active_players()
              ^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/safeeyes/plugins/mediacontrol/plugin.py", line 46, in __active_players
    status = str(interface.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus')).lower()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.26198" (uid=1000 pid=562792 comm="xdg-dbus-proxy --args=43" label="flatpak (unconfined)") interface="org.freedesktop.DBus.Properties" member="Get" error name="(unset)" requested_reply="0" destination=":1.263" (uid=1000 pid=7987 comm="/snap/firefox/4451/usr/lib/firefox/firefox" label="snap.firefox.firefox (enforce)")
archisman-panigrahi commented 2 weeks ago

Please switch to the official Safe Eyes PPA and let us know if the behavior is reproducible.

sudo add-apt-repository ppa:safeeyes-team/safeeyes
sudo apt update
sudo apt install safeeyes
archisman-panigrahi commented 2 weeks ago

Recent changes of Apparmor in Ubuntu is breaking a lot of applications. Please let us know if following this method solves the issue https://askubuntu.com/a/1511655/124466. It also includes a link to make the method permanent

archisman-panigrahi commented 2 days ago

Closing due to inactivity. Please have a look at the comments above, and if the problem still persists, then reopen the issue.