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

Beat log rotation error while running under Agent on Windows #33631

Open
andrewkroh opened this issue Nov 9, 2022 · 5 comments
Open

Beat log rotation error while running under Agent on Windows #33631

andrewkroh opened this issue Nov 9, 2022 · 5 comments
Labels
Stalled Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team :Windows

Comments

@andrewkroh
Copy link
Member

andrewkroh commented Nov 9, 2022

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.

  • Version: 8.4.3
  • Operating System: Windows
  • Username: NT AUTHORITY\SYSTEM (S-1-5-18)

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:

@andrewkroh andrewkroh added :Windows Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Nov 9, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@cmacknz
Copy link
Member

cmacknz commented Nov 9, 2022

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?

@botelastic
Copy link

botelastic bot commented Nov 9, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Nov 9, 2023
@cmacknz
Copy link
Member

cmacknz commented Nov 28, 2023

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

@botelastic botelastic bot removed the Stalled label Nov 28, 2023
@botelastic
Copy link

botelastic bot commented Nov 27, 2024

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stalled Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team :Windows
Projects
None yet
Development

No branches or pull requests

3 participants