Bug 90074 - journalctl does not show log past an invalid entry
Summary: journalctl does not show log past an invalid entry
Status: RESOLVED MOVED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-17 14:02 UTC by zebulon
Modified: 2019-08-22 11:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
a quick fix that skip on bad message error (497 bytes, patch)
2015-04-17 20:47 UTC, zebulon
Details | Splinter Review
skip bad entries with a new command line switch in journalctl (2.83 KB, patch)
2015-04-18 19:12 UTC, zebulon
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description zebulon 2015-04-17 14:02:38 UTC
From what I understand, journalctl is supposed to show all the log in /var/log/journal/<machine-uuid>/system*.journal ?

But I have a file that is reported corrupted by journalctl --verify with an invalid entry (most likely the last one) caused by a hard-reboot without fsck

# journalctl --verify
[...]
8a8ef0: invalid entry item (13/22 offset: 000000                                                                 
8a8ef0: invalid object contents: Bad message                                                                     
File corruption detected at /var/log/journal/<mymachine-uuid>/system@000xxxxxxxxx-xxxxxxxxxxxxxx.journal~:8a8ef0 (of 16777216 bytes, 54%).
FAIL: /var/log/journal/<mymachine-uuid>/system@000xxxxxxxxxxxx-xxxxxxxxxx.journal~ (Bad message)
[...]


and journalctl does not show log past/after that invalid entry i.e. it shows log from the first 2 system@*.journal~ files, but no log from the other files, where the last shown log file is from the one corrupted.

I have to access each file individualy with journalctl --file=<name-of-file>

using systemd 219 on ubuntu 15.04 beta 2

a similar story on archlinux forum https://bbs.archlinux.org/viewtopic.php?id=188157

p.s: where is the tool to repair corrupted log ?
Comment 1 zebulon 2015-04-17 14:09:01 UTC
It's not even the log from the same corrupted file) that are not shown but the logs from the other uncorrupted file
Comment 2 zebulon 2015-04-17 20:47:19 UTC
Created attachment 115167 [details] [review]
a quick fix that skip on bad message error

This is an attempt to fix that error. It does not exit on bad message when parsing entry and continue to process log.

However I doubt it is generic enough to deal with all errors

It could be desirable to even not return at all if output_journal gives an error but attempt to continue anyway ??
Comment 3 zebulon 2015-04-18 19:12:02 UTC
Created attachment 115178 [details] [review]
skip bad entries with a new command line switch in journalctl

Add a command line switch (--skip-entries) (--skip-bad-entries was too long) to skip bad or currupted entries in the journal.

This simply ignore errors returned by output_journal to continue processing the journal. Is it right to do it that way ?
Comment 4 Zbigniew Jedrzejewski-Szmek 2019-08-22 11:07:52 UTC
There have been many fixes in this area. We now try to skip invalid entries much better. If this is still an issue, please submit a patch or issue on the new bugtracker on https://github.com/systemd/systemd.


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.