Sample Header Ad - 728x90

unit name in journalctl empty when filtering using -u flag for flatpaks

0 votes
0 answers
42 views
journalctl shows logs in the following format
Whenever I needed to get logs from a single unit I added -u flag journalctl -u . This works for most cases, but not for Flatpaks. Important to note that a "solution" with grep or awk is not accepted as it sends the entire log from all units to a simple text filter. This requres the user to create a more complicated filter so that no other logs from other applications are extracted. An explenation on why displayed names in the logs cannot always be used with -u flag would also be appreciated. Example:
> journalctl -b -1 -xe
...
Dec 29 18:05:51 hostname io.github.mrvladus.List.desktop: [DEBUG] Notifications: Check
Dec 29 18:05:51 hostname io.github.mrvladus.List.desktop: [DEBUG] Notifications: Check
Dec 29 18:05:51 hostname io.github.mrvladus.List.desktop: [DEBUG] Notifications: Check
Dec 29 18:05:51 hostname io.github.mrvladus.List.desktop: [DEBUG] Notifications: Check
...
> journalctl -b -1 -u io.github.mrvladus.List.desktop
Failed to add filter for units: No data available
> journalctl -b -1 -u io.github.mrvladus.List.desktop
-- No entries --
> journalctl -b -1 -u List.desktop
-- No entries --
> journalctl -b -1 -u flatpak-app-io.github.mrvladus.List.desktop
-- No entries --
> journalctl -b -1 -u flatpak-app-io.github.mrvladus.List.scope
-- No entries --
from https://unix.stackexchange.com/a/170396/416910 I found that
systemctl list-unit-files --all
would list all units that could generate logs. That output does not contain anything that is similar to io.github.mrvladus.List in my case. So how can it generate logs if it's not in that list? This question is similar to https://unix.stackexchange.com/questions/416548/why-journalctl-does-not-display-log-message-if-i-use-filtering-by-unit , but OP claims that it was a bug which was fixed in version 236. He never clarified whether upgrading actually fixed his issue.
> journalctl --version
systemd 257 (257.1-1-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +IPE +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF +XKBCOMMON +UTMP -SYSVINIT +LIBARCHIVE
Asked by Pavel Skipenes (235 rep)
Dec 29, 2024, 07:30 PM