Bug 83912

Summary: journalctl -r _SYSTEMD_UNIT=kdm.service missing entries
Product: systemd Reporter: Jonathan Liu <net147>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: major    
Priority: medium CC: amanduch, jjk, lnykryn, zbyszek
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=86855
https://bugs.freedesktop.org/show_bug.cgi?id=84867
Whiteboard:
i915 platform: i915 features:
Attachments: Test journal file

Description Jonathan Liu 2014-09-16 01:31:11 UTC
journalctl -r is missing some entries if _SYSTEMD_UNIT is used to show entries for a specific service.

$ journalctl _SYSTEMD_UNIT=kdm.service | wc -l
495
$ journalctl -r _SYSTEMD_UNIT=kdm.service | wc -l
488

Tested with journalctl from systemd 216.
Comment 1 Jonathan Liu 2014-09-23 08:36:52 UTC
Created attachment 106714 [details]
Test journal file

Test journal file attached.

To reproduce the bug:
$ tar zxvf system.journal.tar.gz
$ journalctl --file system.journal --verify
PASS: system.journal
$ journalctl --file system.journal _SYSTEMD_UNIT=test.service
-- Logs begin at Tue 2014-09-16 10:44:11 EST, end at Tue 2014-09-16 10:44:15 EST. --
Sep 16 10:44:11 systemd-test test[134]: Message 1 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 2 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 3 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 4 / 5
Sep 16 10:44:15 systemd-test test[134]: Message 5 / 5
$ journalctl --file system.journal -r _SYSTEMD_UNIT=test.service
-- Logs begin at Tue 2014-09-16 10:44:11 EST, end at Tue 2014-09-16 10:44:15 EST. --
Sep 16 10:44:11 systemd-test test[134]: Message 1 / 5
Comment 2 doak 2014-11-12 11:29:04 UTC
I can confirm this behaviour with given attachement.
Running Arch Linux on Intel machine (x86_64), systemd 217.
Comment 3 Andrej Manduch 2014-12-06 15:26:03 UTC
This looks like It's same problem as in https://bugs.freedesktop.org/show_bug.cgi?id=84867 and https://bugs.freedesktop.org/show_bug.cgi?id=86855 for which patch was alredy submitted.

However I can't confirm that 'cause I'm unable to reproduce this bug with given journal file.
Comment 4 Jonathan Liu 2014-12-07 05:09:26 UTC
(In reply to Andrej Manduch from comment #3)
> This looks like It's same problem as in
> https://bugs.freedesktop.org/show_bug.cgi?id=84867 and
> https://bugs.freedesktop.org/show_bug.cgi?id=86855 for which patch was
> alredy submitted.
> 
> However I can't confirm that 'cause I'm unable to reproduce this bug with
> given journal file.

The issue still occurs with systemd git master 8b5e2af10830d55b2032e6c79d0cd1f959bb5b7f.

$ ./journalctl --file system.journal -r _SYSTEMD_UNIT=test.service
-- Logs begin at Tue 2014-09-16 10:44:11 AEST, end at Tue 2014-09-16 10:44:15 AEST. --
Sep 16 10:44:11 systemd-test test[134]: Message 1 / 5

It is fixed after applying patch from http://lists.freedesktop.org/archives/systemd-devel/2014-December/026013.html

$ ./journalctl --file system.journal -r _SYSTEMD_UNIT=test.service
-- Logs begin at Tue 2014-09-16 10:44:11 AEST, end at Tue 2014-09-16 10:44:15 AEST. --
Sep 16 10:44:15 systemd-test test[134]: Message 5 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 4 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 3 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 2 / 5
Sep 16 10:44:11 systemd-test test[134]: Message 1 / 5

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.