-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Promtail fails to read journal silently #3779
Comments
Hey @jfolz Could you please try running promtail with |
@dannykopping thanks for the hint. Unfortunately promtail's output seems identical to me. Meanwhile messages are indeed popping up in
|
OK, that's a pity. Next thing to try: sudo lsof -p <pid> |& grep /var/log/journal
# or sudo lsof -p <pid> 2>&1 | grep /var/log/journal if |& doesn't work in your shell This will show if the promtail process has any file handles to the journal. If not, then something is not working as expected. |
No open files :(
Just to be sure
|
Here's what the web interface says about the journal target:
The other machine where it's working shows this:
|
Does your positions file exist, and can promtail write to it? |
As per config shown above it should put it in the current directory, but there is none. Changing to an absolute path has no effect, as does changing it to the example path The promtail process running as a service does write to its configured |
Please provide a little more info on how you're running promtail... |
Apart from the setup given in the first post that I used for manual testing (starting the promtail binary from the command line), there's another promtail running as a systemd unit, which is happily pushing everything to Loki as configured - apart from journal logs. I just stopped this service in case it somehow interfered with my manual testing, but there was no difference. Config:
Unit file:
|
OK, thanks for that detail. I'm guessing there's some permission issue here that's being swallowed up. |
I think this will be much easier if I just provide There is only one mention of
It also does appear to repeatedly open the journal files, but closes them immediately after. |
I thought you might want to keep the rest private as I assume it's trying to recreate the file each time? Seeing |
Looking at the source, I've got another hunch: |
Oh well, I did a quick search and couldn't find anything too spicy, but I may remove it later ;) After
File is empty afterwards. Note: Edit: with
|
Looks like the file was created now at least? You're getting an Let's try use a non-tmpfs location for the promtail target ( If that doesn't work, I may have to defer to one of my colleagues who are more familiar with promtail than I am. |
I did
Then with
|
Just to double-check: |
Yes, no output from Edit: I wasn't sure what the expected behavior here is, so I removed
|
Ha! Did you have |
Yes... sorry that wasn't clear. I've been using the same command from the initial report (with things options added along the way). At least that explains the mystery of the untouched positions file. What remains is why promtail looks at the journal, but doesn't read anything from it :/ |
No problem! Please repeat all the debugging steps ( |
Nothing in When it's not working:
VS when it's working:
So it's looking at |
Are you running promtail as a privileged user in the case that it isn't working? |
Yes, all commands are run as root:
|
Thanks @jfolz. It's looking fine to me. I suspect this issue is down to a quirk of your local system since, from your statements above, you already have a working instance running as a systemd unit. I'd recommend creating another systemd unit for this second instance and see if that works. |
Sorry for taking up so much of your time, but I have to clarify that compared to the original report nothing has changed really. |
Just so I understand correctly (not being passive-aggressive here): you already have a working promtail running in a systemd unit on this same machine that you're having trouble with, correct? |
No we did not, but we do now, finally. After staring at the strace of the working machine for a long time I figured it out. Promtail is looking for Anyway, thanks again for the big help. In the end the strace did the trick ;) My only suggestion would be some more debug logging around the journal scraper. Right now it looks like it never outputs anything even when working as intended. |
That's awesome, great find @jfolz! 🎉 I'll keep this issue open and modify it slightly to reflect your findings. |
@jfolz one more thing: can I ask you to please send the output of |
Sure thing:
|
Hello, I'm seeing this, or a similar issue, on RHEL8. In my case, Promtail's journal scraping silently fails when run it as a non-privileged user. When I run it as root, it initially sends journald logs, but then no other logs are sent until I restart the process. RHEL 8.3 (Ootpa)
|
Wow, this was a read! I'm not sure what we can do about this issue, but we can keep an eye open for potential cases where we swallow related errors and try to make them more visible. |
Hi, I also see promtail not sending journal logs at all (at #9922). I am using promtail inside docker (indeed inside Kubernetes DaemonSet pod), so I guess there is no such version problem? |
Describe the bug
I found that one machine was sending logs from
/var/logs/*.log
, but nothing was coming in from its journal.journalctl --since today
spits lots of messages, but promtail is silent.Meanwhile on another machine running the same OS, the same kernel, ... it works as expected.
I'm having a hard time figuring out what could possibly be different about these machine that it wouldn't work on one of them.
To Reproduce
Use the official promtail 2.2.1 binary downloaded from here and this config:
Run promtail in dry-run mode. It starts without error but no logs are printed:
Expected behavior
Logs start spewing out like crazy ;)
Environment:
If it's of any help the affected machine is running Ubuntu 18.04 (NVIDIA DGX-1 Version 4.7.0) and all default for
journald.conf
.Some more details:
The text was updated successfully, but these errors were encountered: