-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Journalbeat Stops Reading Journals on Journald Rotation #9533
Comments
Also seeing same issue with
|
I'm able to reproduce using master with 952d922 as the newest commit. This has been causing us lots of issues since we are processing around 10 million records a day. The "workaround" is to restart journalbeat every 5 minutes. |
Possibly related to this: coreos/go-systemd#233 If that's the case, they were waiting on the 1.11 release of golang earlier this year and they may be able to merge their pending fix. I bumped the upstream maintainers just to see. |
Previously sd_journal_wait was not used. From now on all changes to journals are detected. I also added custom seccomp policy to Journalbeat. Closes #9533
Previously sd_journal_wait was not used. From now on all changes to journals are detected. I also added custom seccomp policy to Journalbeat. Closes elastic#9533 (cherry picked from commit cead4b6)
Currently testing this as a workaround, installed in #!/bin/sh
set -ue
SYSTEM_JOURNAL_FILE_ID=$(journalctl --file /var/log/journal/*/system.journal --header | awk -F ': ' '/File ID/ { print $2 }')
if [ ! -e /var/lib/journalbeat/system-journal.id ] || [ "$SYSTEM_JOURNAL_FILE_ID" != "$(cat /var/lib/journalbeat/system-journal.id)" ]; then
systemctl try-restart journalbeat && echo "$SYSTEM_JOURNAL_FILE_ID" > /var/lib/journalbeat/system-journal.id
fi |
After testing journalbeat on several systemd versions, it turns out that it is not a journalbeat bug. The beat was affected by the same issue as journalctl as it uses the same C API: systemd/systemd#474 |
We are experiencing this or some other issue that causes journalbeat to stop sending logs on Ubuntu 18.04 which uses systemd v237. Like the other posts, restarting journalbeat causes it to move along again. |
Same issue here with systemd v238. Restarting journalbeat "solves" the issue. |
@JustinHead @mickymiek Do you know what triggers the stopping of shipping logs (e.g. rotate, vacuum)? |
Hello @kvch , @mickymiek and I are now investigating the case. We believe it could be related to rotate but have no evidence yet. During investigations, and probably after deleting journal files, then running |
This might be due to incorrect seccomp policy. Could you please try to turn seccomp policy to test this theory?
|
This removes the journalbeat restart cron job for prometheus only. My goal is to let it run for a bit and observe if we're actually hitting this issue: elastic/beats#9533 ie I plan to see if we stop sending logs, and see if it coincides with journal rotation I picked prometheus for this because a) it has a different cloudinit file, and b) it's less critical than everything else
I'm experiencing this issue. I'm running ubuntu 18.04.2 (systemd v237). Could the issue be that the journalbeat binaries are built on a debian stretch image, and stretch has libsystemd v232? I wonder if it might be possible to use libsystemd from backports (which is v239) to get the fixed version? |
I'm having the same trouble with Journalbeat 6.6.1 on Ubuntu 16.04. Setting "seccomp.enabled: false" has made no difference for me unfortunately. The debug logs show nothing useful, but the journal timestamps indicate that this is happening whenever the journal is rotated. |
What do you mean by same issue? In this issue, two problem is reported. |
I have opened an issue to track the two problems in different issues: #11110 |
Sorry, but my question was about the bug in API systemd <=v232 using by journalbeat. |
This is the issue to track that problem. It is definitely something we want to fix in an upcoming release. |
So, its status shouldn't be closed. |
Reopened. |
It looks like that: coreos/go-systemd#279 is fixing this problem. |
How did you apply the patch? We use |
Also, what's your systemd version? |
@kvch I was just replaced whole
|
Agree. This fix is working fine for me!
|
systemd version is:
|
When will this be available through the official elastic repo? |
Does it mean the fix consists to recompile journald ? The patch you mentioned is only related to github.com/coreos/go-systemd/journal (for writing to systemd's logging service, journald), journalbeat uses github.com/coreos/go-systemd/sdjournal (for reading from journald by wrapping its C API). Please, can you clarify ? |
@hamelg yes it is, you just need to recompile journalbeat with updated go-systemd |
@kvaps I feel a little confused. Why it can work when updating the package that has not been depended by journalbeat? |
This is what I am investigating. My hunch is that the |
I did more investigation on the matter. It turns out that the problem was fixed in Journalbeat not in its dependency Do you mind verifying my findings once the release is available? |
Take the liberty to ask, when is the 6.7 and 7.0.0-rc release date ? |
6.7 has just been released. |
the release of 6.7 works fine for me on ubuntu 16.04 with systemd version 229. But I found some erros as follows:
Does anyone have ideas ? My feeling is that it happened when rotating. |
I confirm 6.7 has fixed the issue on centos 7.6 with systemd version 219. |
The same here, I see this error each time the journal is rotating. |
@hamelg Do you mind opening a separate issue for that? Thanks for the confirmation. |
Fixed in 6.7 and on master. |
This should no longer be necessary with the 6.7.0 release, per elastic/beats#9533.
Previously sd_journal_wait was not used. From now on all changes to journals are detected. I also added custom seccomp policy to Journalbeat. Closes elastic#9533
…ournal entries change (elastic#10485) Cherry-pick of PR elastic#9994 to 6.x branch. Original message: Previously sd_journal_wait was not used. From now on all changes to journals are detected. I also added custom seccomp policy to Journalbeat. Closes elastic#9533
I've been evaluating journalbeat to send data to logstash, and journalbeat stops sending data daily, which I am assuming is tied to when journald is rotating journals. A quick restart of journalbeat gets data sending again.
My journald storage mode is set to auto, and I've tried it both with setting up the persistent storage, and without. I've also tried it where I specified the journal location in journalbeat and without.
The text was updated successfully, but these errors were encountered: