borgbase / vorta

Desktop Backup Client for Borg Backup
https://vorta.borgbase.com
GNU General Public License v3.0
1.93k stars 127 forks source link

Flatpak - Failed to connect to DBUS interface to detect sleep/resume events #1988

Closed andreaippo closed 2 months ago

andreaippo commented 2 months ago

Description

Warning message in logs at startup if system-bus socket is not made available to the flatpak, saying that it won't be possible to detect sleep/resume events

I was able to reproduce the issue.

Environment

Logs

Logs with system-bus not available to flatpak (WARNING appears at L2) - this is the default after installing vorta via flathub:

2024-04-10 19:04:31,127 - vorta.i18n - DEBUG - Loading translation failed for ['en-Latn-DK', 'en-DK'].
2024-04-10 19:04:31,129 - vorta.scheduler - WARNING - Failed to connect to DBUS interface to detect sleep/resume events
2024-04-10 19:04:31,173 - root - DEBUG - Not a private SSH key file: .directory
2024-04-10 19:04:31,193 - vorta.views.source_tab - DEBUG - Added item number 0 from 1
2024-04-10 19:04:31,476 - root - INFO - Using NetworkManagerMonitor NetworkStatusMonitor implementation.
2024-04-10 19:04:31,525 - vorta.borg.jobs_manager - DEBUG - Add job for site default
2024-04-10 19:04:31,525 - vorta.borg.jobs_manager - DEBUG - Start job on site: default
2024-04-10 19:04:31,530 - vorta.borg.borg_job - INFO - Running command /app/bin/borg --version
2024-04-10 19:04:31,790 - vorta.borg.jobs_manager - DEBUG - Finish job for site: default
2024-04-10 19:04:31,791 - vorta.scheduler - DEBUG - Refreshing all scheduler timers
2024-04-10 19:04:31,791 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: default
2024-04-10 19:04:31,793 - vorta.scheduler - INFO - Setting timer for profile 2
2024-04-10 19:04:31,794 - vorta.scheduler - DEBUG - Scheduling next run for 2024-04-11 10:00:00
2024-04-10 19:04:31,795 - vorta.scheduler - DEBUG - Scheduler for profile 3 is disabled.
2024-04-10 19:04:31,796 - vorta.scheduler - DEBUG - Scheduler for profile 4 is disabled.
2024-04-10 19:04:31,797 - vorta.scheduler - DEBUG - Scheduler for profile 5 is disabled.

Logs with system-bus made available to flatpak via flatseal (OK)

2024-04-10 19:00:38,399 - vorta.i18n - DEBUG - Loading translation failed for ['en-Latn-DK', 'en-DK'].
2024-04-10 19:00:38,454 - root - DEBUG - Not a private SSH key file: .directory
2024-04-10 19:00:38,472 - vorta.views.source_tab - DEBUG - Added item number 0 from 1
2024-04-10 19:00:38,747 - root - INFO - Using NetworkManagerMonitor NetworkStatusMonitor implementation.
2024-04-10 19:00:38,789 - vorta.borg.jobs_manager - DEBUG - Add job for site default
2024-04-10 19:00:38,790 - vorta.borg.jobs_manager - DEBUG - Start job on site: default
2024-04-10 19:00:38,793 - vorta.borg.borg_job - INFO - Running command /app/bin/borg --version
2024-04-10 19:00:39,164 - vorta.borg.jobs_manager - DEBUG - Finish job for site: default
2024-04-10 19:00:39,165 - vorta.scheduler - DEBUG - Refreshing all scheduler timers
2024-04-10 19:00:39,165 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: default
2024-04-10 19:00:39,167 - vorta.scheduler - INFO - Setting timer for profile 2
2024-04-10 19:00:39,168 - vorta.scheduler - DEBUG - Scheduling next run for 2024-04-11 10:00:00
2024-04-10 19:00:39,169 - vorta.scheduler - DEBUG - Scheduler for profile 3 is disabled.
2024-04-10 19:00:39,170 - vorta.scheduler - DEBUG - Scheduler for profile 4 is disabled.
2024-04-10 19:00:39,171 - vorta.scheduler - DEBUG - Scheduler for profile 5 is disabled.
SAMAD101 commented 2 months ago

Due to flatpak's sandboxing, Vorta is not able to connect with the system to function properly. I'd suggest installing Vorta from the source or using pip , or disable sandboxing in flatpaks.

I think vorta is not available in Zypper. @m3nu

andreaippo commented 2 months ago

It is available from zypper. But going back to the initial point, I would think that whoever creates the flatpak package can create it in such a way that the permission to the D-Bus socket is granted upon installation.

I haven't packaged flatpaks, but I guess there must be some descriptor file where you specify the permissions the app is going to get once the flatpak is installed by the user.

SAMAD101 commented 2 months ago

Is this possible @Hofer-Julian

@andreaippo Alternatively, you can try disabling the container feature of flatpaks https://www.reddit.com/r/flatpak/comments/t9hetq/how_do_i_remove_the_container_feature_from/

Parnassius commented 2 months ago

Adding the permission to talk to the org.freedesktop.login1 service should be enough to fix this, without opening the whole system bus. I've opened https://github.com/flathub/com.borgbase.Vorta/pull/159 to enable this by default

andreaippo commented 2 months ago

Thanks @Parnassius !

Do you need some help testing this, or have you already? Let me know if I can help 😊

Have a good one!

Edit: I thought I commented on the issue about the impossibility for flatpak Vorta to access ssh keys stored in kwallet (#1753), instead this is the other issue I opened. I guess this one's very quick to validate (although my offer still stands, of course)