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

filestream: fix 'requires pointer' error #33956

Merged
merged 7 commits into from
Dec 14, 2022

Conversation

belimawr
Copy link
Contributor

@belimawr belimawr commented Dec 6, 2022

What does this PR do?

This PR fixes the 'requires pointer' error log issued by filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file indentifier from the prospector instead of the metadata, so the log message is downgraded to warn and contains more details about what happened.

Why is it important?

It fixes a bug and removes a log error that was somehow misleading.

Checklist

  • My code follows the style guidelines of this project
    - [ ] I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

## Author's Checklist

How to test this PR locally

  1. Setup filestream to harvest any file
  2. Rename the file
  3. You should not see any log error

## Related issues
## Use cases
## Screenshots
## Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 6, 2022
@mergify
Copy link
Contributor

mergify bot commented Dec 6, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @belimawr? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

This commit fixes the 'requires pointer' error log issued by
filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file
indentifier from the prospector instead of the metadata, so the log
message is downgraded to warn and contains more details about what
happened.
@belimawr belimawr force-pushed the fix-filestream-on-remame-meta-error branch from 7b7ddbe to 22319bd Compare December 6, 2022 09:47
@belimawr belimawr marked this pull request as ready for review December 6, 2022 09:47
@belimawr belimawr requested a review from a team as a code owner December 6, 2022 09:47
@belimawr belimawr requested review from cmacknz and leehinman and removed request for a team December 6, 2022 09:47
@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 6, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-12-13T17:42:23.727+0000

  • Duration: 70 min 36 sec

Test stats 🧪

Test Results
Failed 0
Passed 7161
Skipped 738
Total 7899

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@belimawr belimawr added bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Dec 6, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 6, 2022
@elasticmachine
Copy link
Collaborator

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

@belimawr belimawr added needs_team Indicates that the issue/PR needs a Team:* label backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.6.0 Automated backport with mergify labels Dec 6, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 6, 2022
@mergify
Copy link
Contributor

mergify bot commented Dec 6, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b fix-filestream-on-remame-meta-error upstream/fix-filestream-on-remame-meta-error
git merge upstream/main
git push upstream fix-filestream-on-remame-meta-error

@cmacknz cmacknz requested a review from rdner December 6, 2022 19:16
@mergify
Copy link
Contributor

mergify bot commented Dec 7, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b fix-filestream-on-remame-meta-error upstream/fix-filestream-on-remame-meta-error
git merge upstream/main
git push upstream fix-filestream-on-remame-meta-error

@belimawr belimawr force-pushed the fix-filestream-on-remame-meta-error branch from 04f469f to 2b9a935 Compare December 7, 2022 11:55
Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the new tests!

@belimawr
Copy link
Contributor Author

belimawr commented Dec 8, 2022

Folks, I'll take a little longer to merge this PR. I'm not completely happy with my tests, I'm questioning whether I'm just testing a pointer is passed on that method call or I'm testing the correct behaviour/changes in the registry.

I might be going a bit too deep in the rabbit hole here 😅

@belimawr belimawr force-pushed the fix-filestream-on-remame-meta-error branch from 1acc9be to cc21c51 Compare December 13, 2022 14:18
@sonarcloud
Copy link

sonarcloud bot commented Dec 13, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.2% 1.2% Duplication

@belimawr
Copy link
Contributor Author

/test

@belimawr belimawr merged commit 2263f3e into elastic:main Dec 14, 2022
mergify bot pushed a commit that referenced this pull request Dec 14, 2022
This commit fixes the 'requires pointer' error log issued by
filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file
identifier from the prospector instead of the metadata, so the log
message is downgraded to warn and contains more details about what
happened.

(cherry picked from commit 2263f3e)
mergify bot pushed a commit that referenced this pull request Dec 14, 2022
This commit fixes the 'requires pointer' error log issued by
filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file
identifier from the prospector instead of the metadata, so the log
message is downgraded to warn and contains more details about what
happened.

(cherry picked from commit 2263f3e)
belimawr added a commit that referenced this pull request Dec 15, 2022
This commit fixes the 'requires pointer' error log issued by
filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file
identifier from the prospector instead of the metadata, so the log
message is downgraded to warn and contains more details about what
happened.

(cherry picked from commit 2263f3e)

Co-authored-by: Tiago Queiroz <[email protected]>
belimawr added a commit that referenced this pull request Dec 20, 2022
)

This commit fixes the 'requires pointer' error log issued by
filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file
identifier from the prospector instead of the metadata, so the log
message is downgraded to warn and contains more details about what
happened.

(cherry picked from commit 2263f3e)

Co-authored-by: Tiago Queiroz <[email protected]>
Co-authored-by: Denis <[email protected]>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
This commit fixes the 'requires pointer' error log issued by
filestream when a file being harvested is renamed.

Filebeat already recovers from this error by using the file
identifier from the prospector instead of the metadata, so the log
message is downgraded to warn and contains more details about what
happened.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.6.0 Automated backport with mergify bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants