snapd-桌面集成系统日志垃圾邮件

snapd-桌面集成系统日志垃圾邮件

在过去三天里,我们每隔几秒钟就会从几乎所有的机器上收到包含这些消息的日志垃圾邮件:

2 11:13:59 11:13:59 ZT1 user.5 snapd-desktop-i[2823704]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:00 11:14:00 ZT1 daemon.5 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:00 11:14:00 ZT1 daemon.4 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:01 11:14:01 PATG daemon.5 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:01 11:14:01 PATG daemon.4 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:01 11:14:01 E450 user.5 snapd-desktop-i[397538]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:02 11:14:02 ZT1 user.5 snapd-desktop-i[2823808]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:02 11:14:02 ZT1 daemon.5 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:02 11:14:02 ZT1 daemon.4 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:03 11:14:03 PATG daemon.5 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:03 11:14:03 PATG daemon.4 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:03 11:14:03 E450 user.5 snapd-desktop-i[397617]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:04 11:14:04 ZT1 user.5 snapd-desktop-i[2823937]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:05 11:14:05 ZT1 daemon.5 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:05 11:14:05 ZT1 daemon.4 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:05 11:14:05 PATG daemon.5 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:05 11:14:05 PATG daemon.4 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:06 11:14:06 E450 user.5 snapd-desktop-i[397694]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:06 11:14:06 ZT1 user.5 snapd-desktop-i[2824038]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:07 11:14:07 ZT1 daemon.5 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:07 11:14:07 ZT1 daemon.4 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:08 11:14:08 PATG daemon.4 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:08 11:14:08 E450 user.5 snapd-desktop-i[397779]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:08 11:14:08 ZT1 user.5 snapd-desktop-i[2824167]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:09 11:14:09 ZT1 daemon.5 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:09 11:14:09 ZT1 daemon.4 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:10 11:14:10 PATG daemon.5 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:10 11:14:10 PATG daemon.4 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:10 11:14:10 E450 user.5 snapd-desktop-i[397847]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:11 11:14:11 ZT1 user.5 snapd-desktop-i[2824261]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:11 11:14:11 ZT1 daemon.5 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:11 11:14:11 ZT1 daemon.4 systemd[1207]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:12 11:14:12 PATG daemon.5 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
2 11:14:12 11:14:12 PATG daemon.4 systemd[5140]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.
2 11:14:12 11:14:12 E450 user.5 snapd-desktop-i[397915]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
2 11:14:13 11:14:13 ZT1 user.5 snapd-desktop-i[2824373]:  Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.

在这些消息开始的时间段内,我们所应用的唯一更新是针对密码和登录的更新,因此我们将其撤消:

====================================================================

Aptitude 0.8.13: log report
Fri, Dec  2 2022 11:56:27 -0800

  IMPORTANT: this log only lists intended actions; actions which fail
  due to dpkg problems may not be completed.

Will install 1 packages, and remove 0 packages.
========================================
[DOWNGRADE] login:amd64 1:4.8.1-2ubuntu2.1 -> 1:4.8.1-2ubuntu2
========================================

Log complete.

=======================================================================

Aptitude 0.8.13: log report
Fri, Dec  2 2022 12:03:00 -0800

  IMPORTANT: this log only lists intended actions; actions which fail
  due to dpkg problems may not be completed.

Will install 1 packages, and remove 0 packages.
4096 B of disk space will be freed
========================================
[HOLD, DEPENDENCIES] login:amd64 1:4.8.1-2ubuntu2
[DOWNGRADE] passwd:amd64 1:4.8.1-2ubuntu2.1 -> 1:4.8.1-2ubuntu2
========================================

Log complete.

======================================================================

但这并没有什么区别。

我们还会看到类似这样的重复消息:


 2 12:39:17 12:39:16 E450 daemon.5 systemd[1022]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Main process exited, code=exited, status=1/FAILURE
 2 12:39:17 12:39:16 E450 daemon.4 systemd[1022]:  snap.snapd-desktop-integration.snapd-desktop-integration.service: Failed with result 'exit-code'.

因此我们猜测它可能是某些突然改变或更新的东西。

另一个用户也遇到了这种情况:

snapd-desktop-integration 泛洪系统日志

我们的系统都运行 Ubuntu 22.04。

如果能提供任何关于如何解决这个问题的提示我将不胜感激。

编辑:请参阅下面 Dan Christensen 的回答,以获得解决此问题的有用方法。

编辑于 2023 年 3 月 2 日:稳定版本 2023-02-21 (57) 似乎已经消除了重复的系统日志消息并解决了该问题。(请参阅下面的回答。)

答案1

目前,我已执行snap remove snapd-desktop-integration此操作,日志垃圾邮件消失了。我不确定该包有多重要,但如果需要它,我可以在问题解决后重新安装它。

答案2

编辑于 2023 年 2 月 28 日:稳定版本 2023-02-21 (57) 似乎已消除重复的系统日志消息。(请参阅 Sergio 的回答下的所有评论。)

修复后的版本信息如下:

~$ snap info snapd-desktop-integration
name:      snapd-desktop-integration
summary:   Desktop Integration for snapd
publisher: Canonical✓
store-url: https://snapcraft.io/snapd-desktop-integration
contact:   https://github.com/snapcore/snapd-desktop-integration
license:   unset
description: |
Provides a user session daemon used to provide a bridge between the user's session and snapd. 
Used for things like automatic theme installation.
services:
snapd-desktop-integration: simple, enabled, inactive
snap-id:      IrwRHakqtzhFRHJOOPxKVPU0Kk7Erhcu
tracking:     latest/stable
refresh-date: today at 15:17 PST
channels:
latest/stable:    0.1 2023-02-21 (57) 438kB -
latest/candidate: 0.1 2023-02-23 (59) 442kB -
latest/beta:      ↑                         
latest/edge:      0.1 2023-02-23 (59) 442kB -
installed:          0.1            (57) 438kB -`

编辑于 2023 年 1 月 21 日:当我们通过 ssh 连接到测试系统后安装候选版本 57 时,它会生成以下重复的系统日志消息:

21 10:11:52 10:11:52 ZT1 kern.5 kernel: [261316.069573] audit: type=1107 audit(1674324712.162:358): pid=830 uid=106 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.3" pid=1145400 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=881 peer_label="unconfined"

21 10:11:52 10:11:52 ZT1 kern.5 kernel: [261316.069573] exe="/usr/bin/dbus-daemon" sauid=106 hostname=? addr=? terminal=?'

21 10:11:52 10:11:52 ZT1 kern.5 kernel: [261316.069831] audit: type=1107 audit(1674324712.162:359): pid=830 uid=106 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="ListSessions" mask="send" name=":1.3" pid=1145400 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=881 peer_label="unconfined"

21 10:11:52 10:11:52 ZT1 kern.5 kernel: [261316.069831] exe="/usr/bin/dbus-daemon" sauid=106 hostname=? addr=? terminal=?'

21 10:11:54 10:11:54 ZT1 user.5 snapd-desktop-i[1145502]: Failed to do gtk init. Waiting for a new session with desktop capabilities.

21 10:11:54 10:11:54 ZT1 kern.5 kernel: [261318.318431] audit: type=1326 audit(1674324714.410:360): auid=1001 uid=1001 gid=1001 ses=152 subj=snap.snapd-desktop-integration.snapd-desktop-integration pid=1145502 comm="snapd-desktop-i" exe="/snap/snapd-desktop-integration/57/usr/bin/snapd-desktop-integration" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7fb4631a6a3d code=0x50000

21 10:11:54 10:11:54 ZT1 user.5 snapd-desktop-i[1145502]: Failed to get session list (check that login-session-observe interface is connected). Forcing a reload.

21 10:11:54 10:11:54 ZT1 kern.5 kernel: [261318.321048] audit: type=1107 audit(1674324714.410:361): pid=830 uid=106 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.3" pid=1145502 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=881 peer_label="unconfined"

21 10:11:54 10:11:54 ZT1 kern.5 kernel: [261318.321048] exe="/usr/bin/dbus-daemon" sauid=106 hostname=? addr=? terminal=?'

21 10:11:54 10:11:54 ZT1 user.5 snapd-desktop-i[1145502]: Loop exited. Forcing reload.

编辑于 2023 年 1 月 3 日:如果您正在测试候选版本 55,则可以通过运行以下命令来停止重复消息:

sudo snap connect snapd-desktop-integration:login-session-observe

请参阅下面 Sergio 的评论。目标是消除此步骤的需要并使其自动连接。

编辑于 2022 年 12 月 17 日:我们在两台通过 ssh 连接的机器上测试了候选版本 55。它修复了 atk-bridge 消息,但每隔几秒就会出现一组不同的消息:

17 10:42:52 10:42:52 PATG user.5 snapd-desktop-i[53867]: Failed to get session list (check that login-session-observe interface is connected). Forcing a reload.

17 10:42:52 10:42:52 PATG user.5 snapd-desktop-i[53867]: Loop exited. Forcing reload.

17 10:42:52 10:42:52 PATG kern.5 kernel: [246586.108424] audit: type=1107 audit(1671302572.982:370): pid=1182 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" memb er="GetAll" mask="send" name=":1.11" pid=53867 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=1280 peer_label="unconfined"

17 10:42:52 10:42:52 PATG kern.5 kernel: [246586.108424] exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'

17 10:42:52 10:42:52 PATG kern.5 kernel: [246586.108847] audit: type=1107 audit(1671302572.982:371): pid=1182 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" membe r="ListSessions" mask="send" name=":1.11" pid=53867 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=1280 peer_label="unconfined"

17 10:42:52 10:42:52 PATG kern.5 kernel: [246586.108847] exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'

17 10:42:55 10:42:55 PATG user.5 snapd-desktop-i[53945]: Failed to do gtk init. Waiting for a new session with desktop capabilities.

17 10:42:55 10:42:55 PATG kern.5 kernel: [246588.351735] audit: type=1326 audit(1671302575.223:372): auid=1000 uid=1000 gid=1000 ses=10 subj=snap.snapd-desktop-integration.snapd-desktop-integration pid=53945 comm="snapd-desktop-i" exe="/snap/snapd-desktop-integration/55/usr/bin/snapd-desktop-integration" sig= 0 arch=c000003e syscall=314 compat=0 ip=0x7f0aba0cda3d code=0x50000

17 10:42:55 10:42:55 PATG kern.5 kernel: [246588.355602] audit: type=1107 audit(1671302575.227:373): pid=1182 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" memb er="GetAll" mask="send" name=":1.11" pid=53945 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=1280 peer_label="unconfined"

17 10:42:55 10:42:55 PATG kern.5 kernel: [246588.355602] exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'

该序列每隔几秒重复一次,直到我们卸载该软件包。(如果这很重要的话,在我们进行测试时,两台机器都有用户登录到图形会话。)

编辑于 2022 年 12 月 12 日:候选版本 49 并未修复当您通过 ssh 连接到安装了 snapd-desktop-integration 的计算机时出现的重复“atk-bridge”消息,但它可能会修复来自 GDM 会话的消息:

https://github.com/snapcore/snapd-desktop-integration/pull/41#issuecomment-1344603344

2022 年 12 月 9 日编辑:这是测试候选版本 49 的结果:

https://github.com/snapcore/snapd-desktop-integration/pull/41#issuecomment-1344589269

编辑于 2022 年 12 月 7 日:以下是提交:

https://github.com/sergio-costas/snapd-desktop-integration/commit/a5652377cc5c8f20ea311a0dd28d44a63c4551c2

编辑于 2022 年 12 月 6 日:这是拉取请求:

https://github.com/snapcore/snapd-desktop-integration/pull/41

该软件包作者的建议是:

...按照拉取请求,当其合并时,它将在几个小时内自动发布到候选频道。

他们还补充道:

这是一个相当复杂的修复,有点冒险,所以需要几天时间才能得到适当的审查。但一旦彻底审查完毕,我们就会立即开始测试过程。

编辑于 2022 年 12 月 4 日:我给其中一位软件包作者发了电子邮件。他们有人正在处理这个问题,希望他们能在本周修复。

====

该问题肯定是由 2022 年 11 月 29 日左右的一次错误的快速升级引起的。

不幸的是,其中的信息snap changes已被覆盖。

2022 年 12 月 2 日格林威治标准时间 21:00 左右,我们所有机器上的重复消息都停止了,但今天(12 月 3 日)它们又重新启动了。

我们注意到,当我们通过 ssh 连接到任何一台机器时,“atk-bridge...请尝试不要加载它”消息就会再次开始。

我们在用户树视图中使用 htop 来终止任务,直到我们可以看到是“systemd --user”反复启动 atk-bridge。如果我们终止该 systemd 任务,atk-bridge 会停止重生,atk-bridge 系统日志消息也会停止(但其他消息不会停止)。

同时,我们应用了 Dan Christensen 的绕过方法(它也摆脱了 atk-bridge 消息),因此在 ssh 之后无需终止任何任务。

答案3

当 snapd-desktop-integration 以非图形模式运行时会发生这种情况。

为了解决这个问题,请使 snapd-desktop-integration 仅在图形模式(级别 5)下运行。

通过以下方式查找已安装的版本(这里是 43)

snap info snapd-desktop-integration 

然后编辑 /etc/systemd/system/snap-snapd\x2ddesktop\x2dintegration-43.mount

[Install]
WantedBy=graphical.target  # changed

然后

systemctl daemon-reload
systemctl disable snap-snapd\\x2ddesktop\\x2dintegration-43.mount
systemctl enable snap-snapd\\x2ddesktop\\x2dintegration-43.mount 

snap stop snapd-desktop-integration
systemctl isolate graphical.target
systemctl isolate multi-user.target 

Ubuntu 22.04.1

答案4

这些消息是由于 snapd 中的一个限制:守护进程在任何会话开始时都会启动。这意味着 snapd-desktop-integration 守护进程不仅在桌面会话中启动,还在 GDM 会话中启动(但由于 GDM 的 HOME 文件夹在 /home 之外,因此 snapd 不会启动它,显示错误)和远程 SSH 会话中启动(在这种情况下,snapd-desktop-integration 将无法连接到桌面,因为会话中没有桌面)。

当前稳定的 snapd-desktop-integration 修复了第一个错误消息,即来自 GDM 会话的错误消息。此外,目前还有另一个修复程序正在候选中,用于解决第二种情况。

无论如何,这些错误都不是关键错误,因为正如评论所说,它们发生在没有桌面来运行 snapd-desktop-integration 时。但是,当然,将它们记录在系统日志中会很麻烦。请确认修复是否有效。

相关内容