Score:4

Discord, how can I make it stop flooding my logs?

au flag
j0h

I am on ubuntu 20.04 focal, and I have discord installed. While discord is active, I get loads of messages in dmesg from it.

[ 1242.218055] audit: type=1400 audit(1626585289.753:15781): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.208904] kauditd_printk_skb: 109 callbacks suppressed
[ 1252.208907] audit: type=1400 audit(1626585299.754:15891): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.208928] audit: type=1400 audit(1626585299.754:15892): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1221/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.208962] audit: type=1400 audit(1626585299.754:15893): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209060] audit: type=1400 audit(1626585299.754:15894): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1241/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.209067] audit: type=1400 audit(1626585299.754:15895): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209084] audit: type=1400 audit(1626585299.754:15896): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209193] audit: type=1400 audit(1626585299.754:15897): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1375/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.209200] audit: type=1400 audit(1626585299.754:15898): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209207] audit: type=1400 audit(1626585299.754:15899): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1451/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.209212] audit: type=1400 audit(1626585299.754:15900): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"

basically it makes getting any other information out of dmesg difficult. Im pretty sure its logging elsewhere as well.

$journalctl -f
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"

so then I looked at apparmor /var/lib/snapd/apparmor/profiles/snap.discord.discord, figuring i could deny ptrace, but this is already set-up.

I'm not sure why discord is trying to access ptrace, but I'm happy to not grant it any additional permissions. I would like the excessive logging to stop though. when discord is active, I might get dozens of requests logged per second. That has to be making a huge log file somewhere. How can I stop discord from flooding my logs?

Score:1
mz flag

The issue seems to be with Discord Snap only, since I use Discord's deb and can't reproduce the error logs. However, the problem and workaround are already mentioned in the Discord snap webpage. Quoting from there:

Snaps are confined, as such Discord may be unable to perform some of the tasks it typically does when unconfined. This may result in the system log getting spammed with apparmor errors. Granting access to the system-observe interface when in the snap will enable the features, and thus reduce the logging.

snap connect discord:system-observe

Adding to that, Discord snap is maintained by Snapcrafters, not by Discord itself. If you want to use official Discord, you can download deb archive from Discord's download page and install it using DPKG or APT.

Guy Luz avatar
pk flag
Didn't helped in KDE :(
Kulfy avatar
mz flag
@GuyLuz I don't use Snaps, but may be restarting discord or snap helps. Try `snap restart discord`. If that doesn't make any difference, try `systemctl restart snapd`.
Guy Luz avatar
pk flag
I think something just got wrong, removing discord `sudo snap remove --purge discord` and restart doesn't stop it.
Kulfy avatar
mz flag
@GuyLuz What error message do you get? I never suggested removing discord.
Guy Luz avatar
pk flag
`audit[3665]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=3665 comm="Discord" requested_mask="read" denied_mask="read" peer="snap.android-studio.android-studio"` I just now noticed that android-studio is written there as well.
Guy Luz avatar
pk flag
It have more versions `audit[3665]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=3665 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"` and `audit[3665]: AVC apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/2393/cmdline" pid=3665 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0` and more
Guy Luz avatar
pk flag
This is the command that I use to show the logs `journalctl --no-pager | grep DENIED`
j0h avatar
au flag
j0h
I have the Deb package installed, and it still floods the logs. discord is garbage, but everyone uses it. I dont want to grant additional permissions to discord, I just want it to shut up. maybe I'll write to the discord devs and ask for a STFU-discord version.
Kulfy avatar
mz flag
@j0h Are you sure the deb is also spamming the logs? As I said in my post, *"..since I use Discord's deb and can't reproduce the error logs"*.
Kulfy avatar
mz flag
@GuyLuz If you are still using snap version, can you try `snap connect discord:system-observe :system-observe; snap connect discord:unity7 :unity7`?
Guy Luz avatar
pk flag
@Kulfy didn't work, `journalctl -f` is quiet like before but from `journalctl --no-pager | grep DENIED` I keep getting the errors.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.