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

[Filebeat] [HTTP Endpoint] Fix handling of input restart #35899

Closed
kcreddy opened this issue Jun 24, 2023 · 5 comments · Fixed by #35903
Closed

[Filebeat] [HTTP Endpoint] Fix handling of input restart #35899

kcreddy opened this issue Jun 24, 2023 · 5 comments · Fixed by #35903
Assignees
Labels

Comments

@kcreddy
Copy link
Contributor

kcreddy commented Jun 24, 2023

Every time when a policy is updated in Custom HTTP Endpoint Logs integration, agent stops listening on the specified port.
Steps to reproduce:

  1. Add Custom HTTP Endpoint Logs integration
  2. Perform a change to the integration policy (any parameter except Listen Address, Listen Port and URL) and save.
  3. Input fails to start with error:
Input 'http_endpoint' failed with: unable to start server due to error: pattern already exists for localhost:10002: / old=http_endpoint-http_endpoint.generic-1d4d4970-11f8-11ee-ba31-9398fe5d16ff new=http_endpoint-http_endpoint.generic-1d4d4970-11f8-11ee-ba31-9398fe5d16ff

Issue is due to missing cleanup steps when the input stops, to unregister the path from the server and to stop the server when there are 0 paths.

@kcreddy kcreddy added the Filebeat Filebeat label Jun 24, 2023
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 24, 2023
@kcreddy kcreddy changed the title [HTTP Endpoint] Fix handling of input restart [Filebeat] [HTTP Endpoint] Fix handling of input restart Jun 24, 2023
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 24, 2023
@kcreddy kcreddy added bug needs_team Indicates that the issue/PR needs a Team:* label labels Jun 24, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 24, 2023
@efd6 efd6 self-assigned this Jun 26, 2023
@andrewkroh
Copy link
Member

I'm not sure this bug is fully solved. This is based exclusively on reading the code so I'm not sure there is still and issue. But imagine this chain of events happening in Agent.

  1. Load Input 127.0.0.1:8080/a (to keep the server open)
  2. Load Input 127.0.0.1:8080/b
  3. Unload Input 127.0.0.1:8080/b
  4. Load Input 127.0.0.1:8080/b (I assume fails because /b is never unregistered, and it appears http.ServeMux doesn't support this.)

@ebeahan
Copy link
Member

ebeahan commented Jul 7, 2023

I'm not sure this bug is fully solved. This is based exclusively on reading the code so I'm not sure there is still and issue. But imagine this chain of events happening in Agent.

Should we reopen?

@andrewkroh
Copy link
Member

Let's have someone retest this using the latest agent snapshot with the fix. If the issue is solved then we can close it.

@andrewkroh andrewkroh reopened this Jul 7, 2023
@ebeahan
Copy link
Member

ebeahan commented Jul 10, 2023

Let's have someone retest this using the latest agent snapshot with the fix. If the issue is solved then we can close it.

Resolved in my testing on the latest 8.9-SNAPSHOT.

@ebeahan ebeahan closed this as completed Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants