-
Notifications
You must be signed in to change notification settings - Fork 379
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
mtail doesn't follow log rotation when running under WSL and docker #531
Comments
The INFO log should help explain what `mtail` is doing at log rotation, and
if you need more details, add `-vmodule=tail=2` to the command line.
Perhaps you can share the first lines of the INFO log and the section where
the rotation occurs.
What's VSL stand for?
…On Fri, 21 May 2021, 16:12 Jason, ***@***.***> wrote:
I am using prometheus and mtail to gather information from chia logs. It
is working fine until the log file size is 20MB and new file log file is
created, mtail then receives random data.
I have to recompose the program to fix the issue but the same problem
occurs when another log file is created.
I am using docker, VSL and prometheus. I do have mtail installed locally
aswell but no idea how to implement it.
any help on how can i remedy it.
[image: image]
<https://user-images.githubusercontent.com/83615043/119090547-6ca81880-ba14-11eb-8796-3ebc96346742.png>
[image: image]
<https://user-images.githubusercontent.com/83615043/119090681-982b0300-ba14-11eb-8286-941d0a681539.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#531>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXFX63LOERHJAEHYJHQHCLTOX2ULANCNFSM45IPPV7A>
.
|
I am seeing the same issue with the same app. When the logrotate takes place mtail seems to re-ingest the original file, exploding the counters. This may be related on the implementation of the windows subsystem for Linux (WSL) that docker desktop uses to expose the log to the container as I run exectly the same setup under linux and the issue does not occur. When running mtail directly on the windows host it works ... kind of as there mtail seems to simply prevent the logrotate of taking place in the first place :-) I'am currently running mtail with the -v=2 and so i can post results when the rotate takes place. |
This isn't great at all! I assume that it's because I don't understand windows file semantics, and would appreciate help! Sounds like we have two problems here, one is the pinning of closed files in windows itself, and the other is the behaviour when running under wsl. If you all can get me verbose INFO logs per above that might help start the debugging process. |
Here is the log of the exact moment the log was rotated:
The rest of the logfile is a repetion 25xsendline, a read 4096 and a decode, seems like mtail went in a loop here for the next 45 gb of logfile. CPU for the mtail container was also at 100%. This went on on until the docker desktop host ran out of memory due to of trying to log 45gb :-) It could be related to how docker desktop (windows) interact with the windows filesystem trought the WSL subsystem. However another container running promtail that was watching the same file had no issue with the rotate as seen in its log:
If we look at the code of promtail of that warning https://github.com/grafana/tail/blob/master/tail.go It seems that the for some reason at logrotate the old file is still returned somehow and mtail goes into a loop. This might all be related to the implementation of docker desktop and its interaction with the local filesystem via WSL. WSL seems to use Plan9 for this. I am currently looking into other ways of mounting the log file to the container under windows. Regardless of the filesystem thing there may be a way to fix how mtail handles this, at least looking at the comments in the code for promtail there is something going on with logrotate and the old file being returned. |
I am using prometheus and mtail to gather information from chia logs. It is working fine until the log file size is 20MB and new file log file is created, mtail then receives random data.
I have to recompose the program to fix the issue but the same problem occurs when another log file is created.
I am using docker, VSL and prometheus. I do have mtail installed locally aswell but no idea how to implement it.
any help on how can i remedy it.
The text was updated successfully, but these errors were encountered: