Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

journal: do not leak internal error code #26496

Closed
yuwata opened this issue Feb 20, 2023 · 2 comments · Fixed by #26605
Closed

journal: do not leak internal error code #26496

yuwata opened this issue Feb 20, 2023 · 2 comments · Fixed by #26605
Labels
bug 🐛 Programming errors, that need preferential fixing journal
Milestone

Comments

@yuwata
Copy link
Member

yuwata commented Feb 20, 2023

systemd version the issue has been seen with

253

Used distribution

No response

Linux kernel version used

No response

CPU architectures issue was seen on

None

Component

systemd-journald

Expected behaviour you didn't see

No response

Unexpected behaviour you saw

From #26198 (comment)

[ 2988.374664] systemd-journald[328]: /var/log/journal/bd3be28df719f3499cdef198566abc2e/user-1000.journal: Montonic clock jumped backwards relative to last journal entry, rotating.
[ 2988.374673] systemd-journald[328]: Failed to write entry to /var/log/journal/bd3be28df719f3499cdef198566abc2e/user-1000.journal (28 items, 781 bytes), rotating before retrying: Not a XENIX named type file

C.f.
#26198 (comment)
#26198 (comment)

Steps to reproduce the problem

No response

Additional program output to the terminal or log subsystem illustrating the issue

No response

@neilromig
Copy link

I'm seeing this on my Arch system since systemd 253.

@JParkerWheeler
Copy link

I'm seeing this on my Arch system since systemd 253.

Arch as well and same message. Actually swapped out my BIOS battery thinking it might be the culprit! ;)

poettering added a commit to poettering/systemd that referenced this issue Feb 27, 2023
Let's log exactly at one place about failed writing of log lines to
journal file: in shall_try_append_again().

Then, if we decide to suppress a retry-after-vacuum because we already
vacuumed anyway then say this explicitly as "supressed rotation",
because that's what we do here.

This removes triplicate logging about the same error, and logs exactly
once, plus optional one "suppressed rotation" message. (plus more debug
output). The triplicate logging was bad in particular because it had no
understanding of the actual error codes and just showed generic UNIX
error strings ("Not a XENIX named type file"). By relying on
shall_try_append_again() to do all logging we now get very clean error
strings for all conditions.

Fixes: systemd#26496
poettering added a commit to poettering/systemd that referenced this issue Feb 28, 2023
Let's log exactly at one place about failed writing of log lines to
journal file: in shall_try_append_again().

Then, if we decide to suppress a retry-after-vacuum because we already
vacuumed anyway then say this explicitly as "supressed rotation",
because that's what we do here.

This removes triplicate logging about the same error, and logs exactly
once, plus optional one "suppressed rotation" message. (plus more debug
output). The triplicate logging was bad in particular because it had no
understanding of the actual error codes and just showed generic UNIX
error strings ("Not a XENIX named type file"). By relying on
shall_try_append_again() to do all logging we now get very clean error
strings for all conditions.

Fixes: systemd#26496
bluca pushed a commit to bluca/systemd that referenced this issue Mar 29, 2023
Let's log exactly at one place about failed writing of log lines to
journal file: in shall_try_append_again().

Then, if we decide to suppress a retry-after-vacuum because we already
vacuumed anyway then say this explicitly as "supressed rotation",
because that's what we do here.

This removes triplicate logging about the same error, and logs exactly
once, plus optional one "suppressed rotation" message. (plus more debug
output). The triplicate logging was bad in particular because it had no
understanding of the actual error codes and just showed generic UNIX
error strings ("Not a XENIX named type file"). By relying on
shall_try_append_again() to do all logging we now get very clean error
strings for all conditions.

Fixes: systemd#26496
(cherry picked from commit 0631aab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing journal
Development

Successfully merging a pull request may close this issue.

3 participants