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

[libbeat] Don't swallow Kibana index pattern errors #20121

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jul 21, 2020

What does this PR do?

While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

Why is it important?

Errors with the Kibana index pattern were undetected. The only hint of an error is that the index pattern doesn't exist in Kibana after setup.

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.

Logs

2020-07-21T18:26:27.006-0400 ERROR instance/beat.go:935 Exiting: 1 error: error loading index pattern: returned 413 to import file: <nil>. Response: {"statusCode":413,"error":"Request Entity Too Large","message":"Payload content length greater than maximum allowed: 1048576"}

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 21, 2020
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.
@andrewkroh andrewkroh force-pushed the bugfix/kibana-dashboard-error branch from 62d5efc to b765766 Compare July 21, 2020 22:33
@andrewkroh andrewkroh added the Team:Services (Deprecated) Label for the former Integrations-Services team label Jul 21, 2020
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 21, 2020
@andrewkroh andrewkroh marked this pull request as ready for review July 21, 2020 22:34
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@andrewkroh
Copy link
Member Author

On a related note ./filebeat export index-pattern | wc -c returns a 1304593 byte document (1.24MiB).

@andrewkroh
Copy link
Member Author

Looks like the index pattern issue was reported in #19965.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20121 opened]

  • Start Time: 2020-07-21T22:34:07.298+0000

  • Duration: 75 min 8 sec

Test stats 🧪

Test Results
Failed 0
Passed 17739
Skipped 1902
Total 19641

@andrewkroh andrewkroh added the needs_backport PR is waiting to be backported to other branches. label Jul 21, 2020
@andrewkroh andrewkroh merged commit 7a7279f into elastic:master Jul 21, 2020
Copy link

@andrewstucki andrewstucki left a comment

Choose a reason for hiding this comment

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

do we have linter rules to look for unchecked errors? I'm assuming not because they're generally noisy and not always useful, but wondering if we should in the long-run b/c that for sure would have caught this.

@andrewkroh
Copy link
Member Author

None at this time. We've had a few in the past and they weren't removed for any good reason AFAIK. I think it was just that nobody was maintaining them. Previously we used Hound CI to comment, but it wasn't very configurable IIRC. And before that we had reviewdog running.

I use golangci-lint locally when I'm making changes. I'd be interested in trying out their Github action on PRs. https://github.com/marketplace/actions/run-golangci-lint

@andrewstucki
Copy link

that would be nice, I just ran it over the whole codebase, there are a good number of ineffectual assignments/lack off error checks it found: https://gist.github.com/andrewstucki/5cfc32b8024ac23bd4ae1edb2bbb4565

andrewkroh added a commit to andrewkroh/beats that referenced this pull request Jul 23, 2020
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

(cherry picked from commit 7a7279f)
@andrewkroh andrewkroh added v7.9.0 and removed needs_backport PR is waiting to be backported to other branches. labels Jul 23, 2020
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Jul 23, 2020
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

(cherry picked from commit 7a7279f)
andrewkroh added a commit that referenced this pull request Jul 23, 2020
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

(cherry picked from commit 7a7279f)
andrewkroh added a commit that referenced this pull request Jul 23, 2020
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

(cherry picked from commit 7a7279f)
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
)

While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

(cherry picked from commit 543349c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug libbeat Team:Services (Deprecated) Label for the former Integrations-Services team v7.9.0 v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants