-
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
Beat log rotation error while running under Agent on Windows #33631
Comments
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
I have seen this in Windows agent logs before but don't have a great idea of what causes it. Did you reproduce this yourself, or is this something you saw investigating user problem? |
Hi! We're labeling this issue as |
I suspect this happens because we attempt to delete the file while it is still being written (or at least still open). We see similar behavior in agent when uninstalling it, occasionally some of the log files get left behind. elastic/elastic-agent#3342 |
Hi! We're labeling this issue as |
Filebeat running as a subprocess of Agent (with monitoring enabled) is unable rotate its log file. I don't know what would cause the
os.Stat
call to fail. It fails intermittently based on the attached log. I don't think it affects functionality because the logger can still continue, but the old file(s) might not get purged immediately. They will get purged on the next successful purge.Error from Agent log:
filebeat stderr: "2022-10-31 09:00:00.0004948 -0400 EDT m=+422052.451213201 write error: error file rotating files reason: time interval: failed on C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-90167b\\logs\\default\\filebeat-20221031-964.ndjson during rotation: CreateFile C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-90167b\\logs\\default\\filebeat-20221031-964.ndjson: Access is denied.\n"
agent-8.4.3-log-filtered.txt
Related code:
os.Stat
call on the files to be deleted fails with "Access is denied."The text was updated successfully, but these errors were encountered: