Repository navigation
[9.4](backport #54612) ci: don't fail Windows winlogbeat jobs when the Sysmon temp folder can't be removed - #54626
Merged
Merged
Conversation
…n't be removed (#54612) install_sysmon.ps1 ends by deleting the folder it downloaded Sysmon64.exe into. On a Win 2016 agent that delete failed with "Access to the path 'Sysmon64.exe' is denied", likely because the file was still open (for example by antivirus) right after Sysmon64.exe -m exited. The error failed the step before mage build unitTest ran, so a job with nothing wrong in it went red. Retry the delete a few times, two seconds apart, and if the folder still can't be removed, log a warning and carry on: nothing uses it afterwards. Assisted-By: Claude Code (cherry picked from commit 79b438c)
Contributor
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
Contributor
Author
|
This pull request is merged. |
Contributor
|
Dependency review finished without posting an analysis comment. If you expected a review, push a new commit to this pull request (or close and reopen it) to try again. Workflow run: https://github.com/elastic/beats/actions/runs/43021351053 |
marc-gr
approved these changes
Nov 12, 2026
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
install_sysmon.ps1ends by deleting the temp folder it downloadedSysmon64.exeinto. On a Win 2016 agent that delete failed with "Access tothe path 'Sysmon64.exe' is denied", most likely because the file was still
open (for example by antivirus) right after
Sysmon64.exe -mexited. Theerror failed the step before
mage build unitTestran, so a job with nothingwrong in it went red.
Retry the delete up to five times, two seconds apart, and if the folder still
can't be removed, log a warning and carry on: nothing uses it afterwards. The
download and the manifest installation are unchanged, and a failed download
still fails the job.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature works. Where relevant, I have used thestresstest.shscript to run them under stress conditions and race detector to verify their stability.I have added an entry in./changelog/fragmentsusing the changelog tool.Disruptive User Impact
None. This only changes a CI setup script.
How to test this PR locally
The script only runs on the Buildkite Windows agents, through the
x-pack/winlogbeat Windows unit test jobs in
.buildkite/x-pack/pipeline.xpack.winlogbeat.yml. Those jobs on this PRexercise the normal path.
The new cleanup block was also run on its own in Windows PowerShell 5.1 with
$ErrorActionPreference = 'Stop':Sysmon64.exeheld open, it retried, logged the warning after about8 seconds, and finished without an error.
Related issues
x-pack/winlogbeat: Win 2016 Unit Testsjob failed in this script before any test ran.Logs
🤖 Generated with Claude Code
This is an automatic backport of pull request #54612 done by [Mergify](https://mergify.com).