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

Give useful message on default grok patterns fail #5629

Merged
merged 2 commits into from May 13, 2019

Conversation

@kmerz
Copy link
Member

commented Jan 31, 2019

Prior to this change, when a user had modfied the a default
grok pattern, the installation would fail. With a cryptic
error message.

This change catches the error and prints a hopefully more useful
error message.

Also: do not use new Error which is not catched.
Also: we will write the clusterConfig to avoid running into a already found content pack after every restart.
Fixes #5626

How Has This Been Tested?

  • Removed Content Pack Installation
  • Removed Content Pack
  • Removed corresponding cluster config
  • Edited one default grok pattern
  • Restarted server and looked for the warning message

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@kmerz kmerz added this to the 3.0.1 milestone Jan 31, 2019

Give usefull message on default grok patterns fail
Prior to this change, when a user had modfied the a default
grok pattern, the installation would fail. With a cryptic
error message.

This change catches the error and prints a hopefully more useful
error message.

Also: do not use `new Error` which is not catched.

@kmerz kmerz force-pushed the issue-5626 branch from 7488534 to ffd939a Feb 1, 2019

contentPackService.installContentPack(pack, Collections.emptyMap(), "Add default Grok patterns", "admin");
} catch(ContentPackException e) {
LOG.warn("Could not install default grok patterns: the installation found some modified default grok" +
"patterns in your setup and did not update them. If you wish to use to the default grok" +

This comment has been minimized.

Copy link
@edmundoa

edmundoa Feb 1, 2019

Member

Small typo here

Suggested change
"patterns in your setup and did not update them. If you wish to use to the default grok" +
"patterns in your setup and did not update them. If you wish to use the default grok" +
} catch(ContentPackException e) {
LOG.warn("Could not install default grok patterns: the installation found some modified default grok" +
"patterns in your setup and did not update them. If you wish to use to the default grok" +
"patterns we provide, please delete the grok pattern and install the 'Default grok" +

This comment has been minimized.

Copy link
@edmundoa

edmundoa Feb 1, 2019

Member

Can we show which grok pattern caused troubles in there? Otherwise we need to rephrase this:
(...) please delete the grok pattern (...)

@bernd
bernd approved these changes May 13, 2019

@bernd bernd merged commit 3cb26d0 into master May 13, 2019

4 checks passed

ci-web-linter Jenkins build graylog-pr-linter-check 3332 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
graylog-project/pr Jenkins build graylog-project-pr-snapshot 3009 has succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@bernd bernd deleted the issue-5626 branch May 13, 2019

kmerz added a commit that referenced this pull request May 13, 2019
Give useful message on default grok patterns fail (#5629)
Prior to this change, when a user had modified the a default
grok pattern, the installation would fail. With a cryptic
error message.

This change catches the error and prints a hopefully more useful
error message.

Also: do not use "new Error" which is not caught.

@kmerz kmerz changed the title Give usefull message on default grok patterns fail Give useful message on default grok patterns fail May 13, 2019

bernd added a commit that referenced this pull request May 13, 2019
Give useful message on default grok patterns fail (#5629) (#5938)
Prior to this change, when a user had modified the a default
grok pattern, the installation would fail. With a cryptic
error message.

This change catches the error and prints a hopefully more useful
error message.

Also: do not use "new Error" which is not caught.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.