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

Service snapd-desktop-integration reloads every 2 seconds #71

Open
hvbakel opened this issue Aug 13, 2023 · 24 comments
Open

Service snapd-desktop-integration reloads every 2 seconds #71

hvbakel opened this issue Aug 13, 2023 · 24 comments

Comments

@hvbakel
Copy link

hvbakel commented Aug 13, 2023

On an up to date Ubuntu 22.04.3 installation the snapd-desktop-integration service reloads every 2 seconds, spamming journalctl with the following messages:

Aug 12 08:45:11 hostname systemd[4446]: snap.snapd-desktop-integration.snapd-desktop-integration.service: Scheduled restart job, restart counter is at 169.
Aug 12 08:45:11 hostname systemd[4446]: Stopped Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Aug 12 08:45:11 hostname systemd[4446]: Started Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Aug 12 08:45:11 hostname snapd-desktop-i[1704533]: Failed to do gtk init. Waiting for a new session with desktop capabilities.
Aug 12 08:45:11 hostname snapd-desktop-i[1704533]: Checking session /org/freedesktop/login1/session/_3272...
Aug 12 08:45:11 hostname snapd-desktop-i[1704533]: Is a desktop session! Forcing a reload.
Aug 12 08:45:11 hostname snapd-desktop-i[1704533]: Loop exited. Forcing reload.

Based on forum threads I could find (e.g. https://askubuntu.com/questions/1443676/snapd-desktop-integration-syslog-spam) it looks like this issue should be solved with the version released earlier this year, but with v0.9 from the stable or candidate channel the issue seems to persist even when running in a graphical desktop session.

@Ziris85
Copy link

Ziris85 commented Mar 2, 2024

Marking myself as affected by this too. For me, it seems to crop up specifically if I choose Ubuntu on Xorg during login (which is necessary in my case because xscreensaver doesn't seem to work properly on wayland at present). I found this reddit post about an issue with firefox that I was having that seemed to be related to this, and the suggested fix there was to restart the machine after selecting the Xorg option. Sure enough, after rebooting my system, both those repeated integration error messages stopped and firefox started working again. That sort of leads me to believe that the issue isn't with this or any one particular snap, but maybe with snapd in general on Xorg displays?

@sergio-costas
Copy link
Collaborator

Mmm... good point the Ubuntu on Xorg detail... checking it...

@sergio-costas
Copy link
Collaborator

I'm still unable to reproduce this bug. Can you check the logs? (open a terminal and type sudo journalctl, then go to the end -it will take a while- and check what shows when it is relaunched; or another way is to type sudo journalctl -f, which will show in realtime the new events... see if it shows something related to snapd-desktop-integration when it relaunches).

@guruevi
Copy link

guruevi commented Jul 31, 2024

Still happens on Ubuntu 22.04.4 LTS. This just repeat endlessly, there are no other logs between. This happens after a desktop is launched. Here are all the logs when this begins:

[code]
Jul 31 10:15:20 nsc-sidon-vm gsd-media-keys[3665]: Failed to grab accelerator for keybinding settings:screen-brightness-down
Jul 31 10:15:21 nsc-sidon-vm gsd-media-keys[3665]: Unable to inhibit keypresses: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied
Jul 31 10:15:21 nsc-sidon-vm gnome-shell[3449]: GNOME Shell started at Wed Jul 31 2024 10:15:20 GMT-0400 (EDT)
Jul 31 10:15:21 nsc-sidon-vm gnome-shell[3449]: Registering session with GDM
Jul 31 10:15:21 nsc-sidon-vm systemd[2982]: snap.snapd-desktop-integration.snapd-desktop-integration.service: Scheduled restart job, restart counter is at 1.
Jul 31 10:15:21 nsc-sidon-vm systemd[2982]: Stopped Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Jul 31 10:15:21 nsc-sidon-vm systemd[2982]: Started Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Jul 31 10:15:21 nsc-sidon-vm snapd-desktop-i[3929]: Failed to do gtk init. Waiting for a new session with desktop capabilities.
Jul 31 10:15:21 nsc-sidon-vm snapd-desktop-i[3929]: Checking session /org/freedesktop/login1/session/_32...
Jul 31 10:15:21 nsc-sidon-vm snapd-desktop-i[3929]: Checking session /org/freedesktop/login1/session/c1...
Jul 31 10:15:21 nsc-sidon-vm snapd-desktop-i[3929]: Checking session /org/freedesktop/login1/session/c2...
Jul 31 10:15:21 nsc-sidon-vm snapd-desktop-i[3929]: Is a desktop session! Forcing a reload.
Jul 31 10:15:21 nsc-sidon-vm snapd-desktop-i[3929]: Loop exited. Forcing reload.
Jul 31 10:15:21 nsc-sidon-vm NetworkManager[996]: [1722435321.6087] agent-manager: agent[be451185c8a432e0,:1.124/org.gnome.Shell.NetworkAgent/1316130666]: agent registered
Jul 31 10:15:21 nsc-sidon-vm systemd[1]: Started crash report submission.
Jul 31 10:15:21 nsc-sidon-vm sssd_nss[1153]: Enumeration requested but not enabled
Jul 31 10:15:21 nsc-sidon-vm whoopsie[3935]: [10:15:21] Using lock path: /var/lock/whoopsie/lock
Jul 31 10:15:21 nsc-sidon-vm systemd[1]: whoopsie.service: Deactivated successfully.
Jul 31 10:15:22 nsc-sidon-vm gsd-color[3684]: failed to create device: could not check org.freedesktop.color-manager.create-device for auth: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Jul 31 10:15:22 nsc-sidon-vm systemd[1]: Started crash report submission.
Jul 31 10:15:22 nsc-sidon-vm systemd[1]: polkit.service: Main process exited, code=dumped, status=11/SEGV
Jul 31 10:15:22 nsc-sidon-vm systemd[1]: polkit.service: Failed with result 'core-dump'.
Jul 31 10:15:22 nsc-sidon-vm systemd[1]: polkit.service: Consumed 1.680s CPU time.
Jul 31 10:15:22 nsc-sidon-vm whoopsie[3938]: [10:15:22] Using lock path: /var/lock/whoopsie/lock
Jul 31 10:15:22 nsc-sidon-vm systemd[1]: whoopsie.service: Deactivated successfully.
Jul 31 10:15:22 nsc-sidon-vm geoclue[2569]: Service not used for 60 seconds. Shutting down..
Jul 31 10:15:22 nsc-sidon-vm systemd[1]: geoclue.service: Deactivated successfully.
Jul 31 10:15:23 nsc-sidon-vm systemd[1]: realmd.service: Deactivated successfully.
Jul 31 10:15:23 nsc-sidon-vm systemd[2982]: snap.snapd-desktop-integration.snapd-desktop-integration.service: Scheduled restart job, restart counter is at 2.
Jul 31 10:15:23 nsc-sidon-vm systemd[2982]: Stopped Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Jul 31 10:15:23 nsc-sidon-vm systemd[2982]: Started Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Jul 31 10:15:23 nsc-sidon-vm snapd-desktop-i[3993]: Failed to do gtk init. Waiting for a new session with desktop capabilities.
Jul 31 10:15:23 nsc-sidon-vm snapd-desktop-i[3993]: Checking session /org/freedesktop/login1/session/_32...
Jul 31 10:15:23 nsc-sidon-vm snapd-desktop-i[3993]: Checking session /org/freedesktop/login1/session/c1...
Jul 31 10:15:23 nsc-sidon-vm snapd-desktop-i[3993]: Checking session /org/freedesktop/login1/session/c2...
Jul 31 10:15:23 nsc-sidon-vm snapd-desktop-i[3993]: Is a desktop session! Forcing a reload.
Jul 31 10:15:23 nsc-sidon-vm snapd-desktop-i[3993]: Loop exited. Forcing reload.
Jul 31 10:15:24 nsc-sidon-vm kernel: [ 119.937484] [UFW BLOCK] IN=enp6s18 OUT= MAC=01:00:5e:00:00:01:00:de:fb:41:bf:42:08:00 SRC=10.221.129.251 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=41883 PROTO=2
Jul 31 10:15:25 nsc-sidon-vm dbus-daemon[3080]: [session uid=1316130666 pid=3078] Activating service name='org.gnome.Terminal' requested by ':1.68' (uid=1316130666 pid=4033 comm="/usr/bin/gnome-terminal.real " label="unconfined")
Jul 31 10:15:25 nsc-sidon-vm dbus-daemon[3080]: [session uid=1316130666 pid=3078] Successfully activated service 'org.gnome.Terminal'
Jul 31 10:15:25 nsc-sidon-vm systemd[2982]: snap.snapd-desktop-integration.snapd-desktop-integration.service: Scheduled restart job, restart counter is at 3.
Jul 31 10:15:25 nsc-sidon-vm systemd[2982]: Stopped Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Jul 31 10:15:25 nsc-sidon-vm systemd[2982]: Started Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Jul 31 10:15:26 nsc-sidon-vm kernel: [ 121.570750] kauditd_printk_skb: 16 callbacks suppressed
Jul 31 10:15:26 nsc-sidon-vm kernel: [ 121.570752] audit: type=1400 audit(1722435326.003:2321): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=4079 comm="snap-confine" capability=12 capname="net_admin"
Jul 31 10:15:26 nsc-sidon-vm kernel: [ 121.570758] audit: type=1400 audit(1722435326.003:2322): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=4079 comm="snap-confine" capability=38 capname="perfmon"
Jul 31 10:15:26 nsc-sidon-vm snapd-desktop-i[4141]: Failed to do gtk init. Waiting for a new session with desktop capabilities.
Jul 31 10:15:26 nsc-sidon-vm snapd-desktop-i[4141]: Checking session /org/freedesktop/login1/session/_32...
Jul 31 10:15:26 nsc-sidon-vm snapd-desktop-i[4141]: Checking session /org/freedesktop/login1/session/c1...
Jul 31 10:15:26 nsc-sidon-vm snapd-desktop-i[4141]: Checking session /org/freedesktop/login1/session/c2...
Jul 31 10:15:26 nsc-sidon-vm snapd-desktop-i[4141]: Is a desktop session! Forcing a reload.
Jul 31 10:15:26 nsc-sidon-vm snapd-desktop-i[4141]: Loop exited. Forcing reload.
Jul 31 10:15:28 nsc-sidon-vm systemd[2982]: snap.snapd-desktop-integration.snapd-desktop-integration.service: Scheduled restart job, restart counter is at 4.[/code]

@sergio-costas
Copy link
Collaborator

Mmm... it is failing to initialize gtk... that's odd...

@sergio-costas
Copy link
Collaborator

Do you have the last version of snapd? (sudo snap refresh snapd) Can you check if all the interfaces in snapd-desktop-integration are connected? (sudo snap connections snapd-desktop-integration)

@guruevi
Copy link

guruevi commented Jul 31, 2024

snapd says it is up-to-date.

The only one that doesn't have a plug:
dbus - snapd-desktop-integration:snapd-desktop-integration -

The rest is fine (it won't format properly here)
Interface Plug Slot Notes content[gnome-42-2204] snapd-desktop-integration:gnome-42-2204 gnome-42-2204:gnome-42-2204 - content[gtk-3-themes] snapd-desktop-integration:gtk-3-themes gtk-common-themes:gtk-3-themes - content[icon-themes] snapd-desktop-integration:icon-themes gtk-common-themes:icon-themes - content[sound-themes] snapd-desktop-integration:sound-themes gtk-common-themes:sound-themes - dbus - snapd-desktop-integration:snapd-desktop-integration - desktop snapd-desktop-integration:desktop :desktop - desktop-legacy snapd-desktop-integration:desktop-legacy :desktop-legacy - gsettings snapd-desktop-integration:gsettings :gsettings - login-session-observe snapd-desktop-integration:login-session-observe :login-session-observe - opengl snapd-desktop-integration:opengl :opengl - snap-themes-control snapd-desktop-integration:snap-themes-control :snap-themes-control - system-files snapd-desktop-integration:snap :system-files - wayland snapd-desktop-integration:wayland :wayland - x11 snapd-desktop-integration:x11 :x11 -

@sergio-costas
Copy link
Collaborator

Ok, I can reproduce it in a virtual machine... odd...

@sergio-costas
Copy link
Collaborator

Odd... I rebooted the VM and now it does work fine...

@sergio-costas
Copy link
Collaborator

Can you try this from a terminal?

systemctl --user stop snap.snapd-desktop-integration.snapd-desktop-integration.service
systemctl --user start snap.snapd-desktop-integration.snapd-desktop-integration.service

and see if that fixes it, at least for the current session?

@AlexBurdu
Copy link

AlexBurdu commented Aug 4, 2024

Restarting doesn't do the trick for me. It seems to restart itself anyway

Aug  4 16:16:34 burdu systemd[4625]: Stopped Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Aug  4 16:16:34 burdu systemd[4625]: Started Service for snap application snapd-desktop-integration.snapd-desktop-integration.
Aug  4 16:16:34 burdu chrome-remote-desktop[23063]: 2024-08-04 16:16:34,313:INFO:wait() returned (32930,256)
Aug  4 16:16:34 burdu chrome-remote-desktop[23063]: 2024-08-04 16:16:34,313:INFO:Waiting before relaunching
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Failed to do gtk init. Waiting for a new session with desktop capabilities.
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Checking session /org/freedesktop/login1/session/c5...
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Is a desktop session! Forcing a reload.
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Checking session /org/freedesktop/login1/session/_39...
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Checking session /org/freedesktop/login1/session/c2...
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Checking session /org/freedesktop/login1/session/_38...
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Checking session /org/freedesktop/login1/session/_35...
Aug  4 16:16:34 burdu snapd-desktop-i[32983]: Loop exited. Forcing reload.

I am connecting remotely to the machine and was trying to set up chrome remote desktop, which doesn't seem to work and I'm guessing the 2 issues are related.

uname -a

Linux burdu 6.5.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 15 16:40:02 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

@sergio-costas
Copy link
Collaborator

Oh, ok... so you are connecting remotely... Can you specify how are you connecting? SSH with -X? Other...?

@berdario
Copy link

berdario commented Sep 1, 2024

FYI, I see this error with Sway (I upgraded to Ubuntu 24.04.1, but I installed Sway ex novo, so it's a default Sway configuration)

For now, I'm just sticking with i3 (while I keep using Sway on Nixos)

@guruevi
Copy link

guruevi commented Sep 1, 2024

I see the error while using XRDP (which is X + VNC) or X2Go (uses SSH). Both can be installed natively and work pretty much out of the box. Although I don’t see how that would be a problem as XRDP is just rendering the desktop locally and has nothing to do with snaps.

@sergio-costas
Copy link
Collaborator

snapd-desktop-integration is a systemd user daemon that needs to have access to the screen (it uses Gtk). To avoid having it relaunching over and over again when a ssh connection is made, it checks if the current session is graphical. If not, it waits until the user opens a graphical session. And when there is a graphical session, it launches a child that does gtk_init(). For some reason, the daemon recognizes Sway as a graphical session, but can't launch a graphical instance on it. The same for XRDP.

@fedkad
Copy link

fedkad commented Nov 13, 2024

This problem started after upgrading to Ubuntu 24.10 from 24.04. Version: latest/stable: 0.9 2024-10-11

@esapulkkinen
Copy link

For me, I can see also errors from apparmor:

2024-12-23T09:33:32.779583+02:00 categorical systemd[3622]: Started snap.snapd-desktop-integration.snapd-desktop-integration.service - Service for snap application snapd-desktop-integration.snapd-desktop-integration.
2024-12-23T09:33:32.835150+02:00 categorical kernel: audit: type=1400 audit(1734939212.833:1306614): apparmor="DENIED" operation="open" class="file" profile="snap-update-ns.snapd-desktop-integration" name="/proc/1623296/maps" pid=1623296 comm="5" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
2024-12-23T09:33:32.905462+02:00 categorical snapd-desktop-i[1623328]: Failed to do gtk init. Waiting for a new session with desktop capabilities.

Is it somehow trying to read some other processes' proc filesystem data?

@sergio-costas
Copy link
Collaborator

@esapulkkinen But does that error appear over and over again? Or is it just a one-shot error? The later is the expected behavior.

@esapulkkinen
Copy link

@sergio-costas It happens once every 2 seconds. So very verbose in terms of syslog logging.

@sergio-costas
Copy link
Collaborator

@esapulkkinen But how are you login into? As a normal, local, graphical user? As a remote graphical user using VNC/whatever? As a remote text user (SSH)?

@esapulkkinen
Copy link

@sergio-costas Normal local graphical user, This is an Ubuntu 24.04 LTS desktop with wayland.

@sergio-costas
Copy link
Collaborator

Can you check the installed version? (snap list snapd-desktop-integration). It should be 0.9 and be installed from latest/stable...

@esapulkkinen
Copy link

@sergio-costas Yes it is. 0.9, Rev 253. from latest/stable/ubuntu-24.04.
I not sure if this is same as latest/stable?

@sergio-costas
Copy link
Collaborator

@esapulkkinen It's not the latest, but it should be latest enough... Maybe there are unconnected plugs? Can you check it with snap connections snapd-desktop-integration ?

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

8 participants