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

Beats running as a windows service randomly fail to restart #18914

Closed
adriansr opened this issue Jun 2, 2020 · 1 comment · Fixed by #18916
Closed

Beats running as a windows service randomly fail to restart #18914

adriansr opened this issue Jun 2, 2020 · 1 comment · Fixed by #18916
Labels
bug in progress Pull request is currently in progress. libbeat

Comments

@adriansr
Copy link
Contributor

adriansr commented Jun 2, 2020

For confirmed bugs, please report:

  • Version: 7.6.0+
  • Operating System: Windows
  • Discuss Forum URL: n/a
  • Steps to Reproduce:

Running the following powershell:

restart-service winlogbeat

(and possibly any other Beat running as a service) can result in a failure to start the service:

PS C:\Program Files\winlogbeat> restart-service winlogbeat
restart-service : Service 'winlogbeat (winlogbeat)' cannot be started due to
the following error: Cannot start service winlogbeat on computer '.'.
At line:1 char:1
+ restart-service winlogbeat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceControl
   ler:ServiceController) [Restart-Service], ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Comman
   ds.RestartServiceCommand

Logs contain the following error:

ERROR instance/beat.go:932 Exiting: data path already locked by another beat

@adriansr adriansr added bug in progress Pull request is currently in progress. libbeat labels Jun 2, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 2, 2020
@adriansr adriansr added Team:SIEM and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

adriansr added a commit to adriansr/beats that referenced this issue Jun 2, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Fixes elastic#18914
adriansr added a commit that referenced this issue Jun 5, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes #18914
adriansr added a commit to adriansr/beats that referenced this issue Jun 5, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes elastic#18914

(cherry picked from commit f3ab7c7)
adriansr added a commit to adriansr/beats that referenced this issue Jun 5, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes elastic#18914

(cherry picked from commit f3ab7c7)
adriansr added a commit to adriansr/beats that referenced this issue Jun 5, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes elastic#18914

(cherry picked from commit f3ab7c7)
adriansr added a commit that referenced this issue Jun 8, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes #18914

(cherry picked from commit f3ab7c7)
adriansr added a commit that referenced this issue Jun 8, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes #18914

(cherry picked from commit f3ab7c7)
adriansr added a commit that referenced this issue Jun 8, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes #18914

(cherry picked from commit f3ab7c7)
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this issue Oct 14, 2020
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes elastic#18914
leweafan pushed a commit to leweafan/beats that referenced this issue Apr 28, 2023
Update the Windows service handling logic so that the service doesn't
transition to the STOPPED state until the beater is terminated.

Before this patch, a Beats service would report to be STOPPED as soon
as it received the stop request. This causes some problems during service
restarts, as the new service would start while the old one was still cleaning
up.

Fixes elastic#18914

(cherry picked from commit 78e355b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in progress Pull request is currently in progress. libbeat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants