Remove ID from list when Filestream inputs fail to be created#44697
Merged
belimawr merged 6 commits intoelastic:mainfrom Jun 10, 2025
Merged
Remove ID from list when Filestream inputs fail to be created#44697belimawr merged 6 commits intoelastic:mainfrom
belimawr merged 6 commits intoelastic:mainfrom
Conversation
Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case.
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
belimawr
commented
Jun 6, 2025
Contributor
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
leehinman
reviewed
Jun 9, 2025
While duplicated IDs should never happen, we need to allow it for legacy reasons, so when handling a failed input we need to consider that there might be another input with the same ID running. When we check if the ID is already in use we set flag, `idAlreadyInUse` and we only remove the ID in a failure scenario if the flag is false.
leehinman
approved these changes
Jun 9, 2025
AndersonQ
approved these changes
Jun 10, 2025
filebeat/input/filestream/internal/input-logfile/manager_test.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Anderson Queiroz <me@andersonq.me>
Contributor
Author
|
I've enabled auto-merge. Thanks for the quick review folks! |
mauri870
approved these changes
Jun 10, 2025
Contributor
|
@Mergifyio backport 8.17 8.18 8.19 9.0 |
Contributor
✅ Backports have been createdDetails
|
mergify bot
pushed a commit
that referenced
this pull request
Jun 10, 2025
Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go # filebeat/input/filestream/internal/input-logfile/manager_test.go
mergify bot
pushed a commit
that referenced
this pull request
Jun 10, 2025
Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go # filebeat/input/filestream/internal/input-logfile/manager_test.go
4 tasks
mergify bot
pushed a commit
that referenced
this pull request
Jun 10, 2025
Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go # filebeat/input/filestream/internal/input-logfile/manager_test.go
This was referenced Jun 10, 2025
mergify bot
pushed a commit
that referenced
this pull request
Jun 10, 2025
Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go
4 tasks
belimawr
added a commit
that referenced
this pull request
Jun 10, 2025
…l to be created (#44740) Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go * fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
belimawr
added a commit
that referenced
this pull request
Jun 10, 2025
…il to be created (#44738) Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go # filebeat/input/filestream/internal/input-logfile/manager_test.go * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
belimawr
added a commit
that referenced
this pull request
Jun 10, 2025
…il to be created (#44737) Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go # filebeat/input/filestream/internal/input-logfile/manager_test.go * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
belimawr
added a commit
that referenced
this pull request
Jun 10, 2025
…il to be created (#44739) Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case. This commit fixes it by removing the ID from a failed input. --------- Co-authored-by: Anderson Queiroz <me@andersonq.me> (cherry picked from commit 017cc4f) # Conflicts: # filebeat/input/filestream/internal/input-logfile/manager.go # filebeat/input/filestream/internal/input-logfile/manager_test.go * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
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
Filestream was not removing the ID from inputs that failed to start, that made re-starting the same input with a valid configuration to fail with a duplicated ID error. This affects any configuration mode that can be reloaded, Elastic-Agent being the main use case.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
## Author's ChecklistHow to test this PR locally
1. Create the following files
filebeat.yml
inputs.d/filestream.yml
/tmp/flog.log
2. Build and Start Filebeat
go build . ./filebeatWait for the log error:
3. Edit
inputs.d/filestream.ymlso it is validRemove the first, invalid, path and uncomment the second one.
pathssection so it looks like this:Save the file and wait to see the ingested events in the console.
## Related issues## Use cases## Screenshots## Logs