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

Ignore deprecated "default" field in IndexSetConfig #3329

Merged
merged 1 commit into from Jan 10, 2017

Conversation

Projects
None yet
2 participants
@joschi
Contributor

joschi commented Jan 10, 2017

Due to the object graph construction in Guice, the migration removing the "default"
message field (V20161215163900_MoveIndexSetDefaultConfig) is being run after the
IndexSetConfig class has been created and some MongoDB queries have been run.

Since MongoJack is strict on the document fields, it will thus fail with an error
message such as:

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "default" (class org.graylog2.indexer.indexset.AutoValue_IndexSetConfig), not marked as ignorable (17 known properties: "index_optimization_disabled", "index_template_name", "index_wildcard", "index_match_pattern", "rotation_strategy_class", "creation_date", "index_analyzer", "rotation_strategy", "shards", "title", "index_optimization_max_num_segments", "_id", "replicas", "description", "index_prefix", "retention_strategy_class", "retention_strategy"])
  at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@deadbeef; pos: 683] (through reference chain: org.graylog2.indexer.indexset.AutoValue_IndexSetConfig["default"])

Fixes #3267

Ignore deprecated "default" field in IndexSetConfig
Due to the object graph construction in Guice, the migration removing the "default"
message field (V20161215163900_MoveIndexSetDefaultConfig) is being run *after* the
IndexSetConfig class has been created and some MongoDB queries have been run.

Since MongoJack is strict on the document fields, it will thus fail with an error
message such as:

    Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "default" (class org.graylog2.indexer.indexset.AutoValue_IndexSetConfig), not marked as ignorable (17 known properties: "index_optimization_disabled", "index_template_name", "index_wildcard", "index_match_pattern", "rotation_strategy_class", "creation_date", "index_analyzer", "rotation_strategy", "shards", "title", "index_optimization_max_num_segments", "_id", "replicas", "description", "index_prefix", "retention_strategy_class", "retention_strategy"])
      at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@deadbeef; pos: 683] (through reference chain: org.graylog2.indexer.indexset.AutoValue_IndexSetConfig["default"])

Fixes #3267

@joschi joschi added this to the 2.2.0 milestone Jan 10, 2017

@bernd bernd self-assigned this Jan 10, 2017

@bernd

bernd approved these changes Jan 10, 2017

@bernd

This comment has been minimized.

Member

bernd commented Jan 10, 2017

LGTM 👍 - I will merge it once the tests are green

@bernd bernd merged commit 1517263 into master Jan 10, 2017

4 checks passed

ci-web-linter Jenkins build graylog-pr-linter-check 1259 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details

@bernd bernd deleted the issue-3267 branch Jan 10, 2017

@bernd bernd removed the ready-for-review label Jan 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment