config icon indicating copy to clipboard operation
config copied to clipboard

flatpak-system-update.service fails to start: Cannot autolaunch D-Bus without X11 $DISPLAY

Open 1player opened this issue 1 year ago • 7 comments
trafficstars

Dec 04 11:06:17 tranquility systemd[1]: Starting flatpak-system-update.service - Flatpak Automatic Update...
Dec 04 11:06:17 tranquility flatpak[423203]: These runtimes in installation 'system' are pinned and won't be removed; see flat>
Dec 04 11:06:17 tranquility flatpak[423203]:   runtime/org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/23.08
Dec 04 11:06:17 tranquility flatpak[423203]: Nothing unused to uninstall
Dec 04 11:06:18 tranquility flatpak[423210]: error: Cannot autolaunch D-Bus without X11 $DISPLAY
Dec 04 11:06:18 tranquility systemd[1]: flatpak-system-update.service: Main process exited, code=exited, status=1/FAILURE
Dec 04 11:06:18 tranquility systemd[1]: flatpak-system-update.service: Failed with result 'exit-code'.
Dec 04 11:06:18 tranquility systemd[1]: Failed to start flatpak-system-update.service - Flatpak Automatic Update.

Looks like https://github.com/flatpak/flatpak/issues/3847

Of course it works when I execute the commands manually. I'm pretty sure it used to work months ago, and it's only recently that I find that my Flatpaks are not updating automatically anymore.

1player avatar Dec 07 '23 10:12 1player

I will (probably) take a look at that tomorrow or in the next few days at least. Was the upstream issue ever resolved? The one you linked doesn't seem so

ArtikusHG avatar Dec 07 '23 22:12 ArtikusHG

Unfortunately I cannot reproduce the issue on my machine, the service runs fine for me. Can you provide a bit more details about your system, what image you're using, etc.?

ArtikusHG avatar Dec 08 '23 09:12 ArtikusHG

I'm on ostree-image-signed:docker://ghcr.io/ublue-os/kinoite-main:39

I've also slightly tweaked the timer because it used to fire when the network was still offline, and kept failing, but nothing that should affect correct operation. Here is the override applied to the timer (with systemctl edit):

[Unit] After=network-online.target

[Timer] OnCalendar=--* 11:00:00 OnUnitInactiveSec=6h

This setup used to work for months until recently.

On Fri, 8 Dec 2023, at 09:25, ArtikusHG wrote:

Unfortunately I cannot reproduce the issue on my machine, the service runs fine for me. Can you provide a bit more details about your system, what image you're using, etc.?

— Reply to this email directly, view it on GitHub https://github.com/ublue-os/config/issues/168#issuecomment-1846845029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFIPSAIZCIMYCBRU23CFKLYILMH5AVCNFSM6AAAAABAKY4BJOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBWHA2DKMBSHE. You are receiving this because you authored the thread.Message ID: @.***>

1player avatar Dec 08 '23 10:12 1player

I'm on silverblue and I don't get this, the fact that it's different on kinoite is weird. Does the same error pop up when calling the daemon manually? (not the command - the daemon, by running systemctl start flatpak-system-update.service)

ArtikusHG avatar Dec 08 '23 11:12 ArtikusHG

Just fixed this annoying issue by prepending /usr/bin/dbus-launch to each flatpak invocation in the systemd unit, as suggested by https://github.com/flatpak/flatpak/issues/3847

Snip:

ExecStart=/usr/bin/dbus-launch /usr/bin/flatpak --system uninstall --unused -y --noninteractive ; /usr/bin/dbus-launch  /usr/bin/flatpak --system update -y --noninteractive ; /usr/bin/dbus-launch /usr/bin/flatpak --system repair

To answer your previous question, yes the issue was easily reproducible by running systemctl start flatpak-system-update.service

1player avatar Jan 14 '24 09:01 1player

Hi I get exactly the same error on kinoite. The fix from 1player solves the problem for me. Maybe GNOME starts something in the background which is not started by KDE? I installed kinoite in january and the flatpak-system-update.service never worked for me.

nicorum avatar Mar 26 '24 13:03 nicorum

Keep in mind that recent Fedora versions have adopted dbus-broker, so /usr/bin/dbus-launch doesn't exist any more but should instead be replaced with /usr/bin/dbus-run-session

I noticed a few days ago that my flatpaks were not being updated any more because of this. This is my current ExecStart line for reference:

ExecStart=/usr/bin/dbus-run-session /usr/bin/flatpak --system uninstall --unused -y --noninteractive ; /usr/bin/dbus-run-session  /usr/bin/flatpak --system update -y --noninteractive ; /usr/bin/dbus-run-session /usr/bin/flatpak --system repair

Also, I'm back on GNOME/Silverblue and still was able to reproduce the DBus issue, so it does not strictly affect KDE.

1player avatar Mar 26 '24 14:03 1player