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

Also return ES "caused_by" error message for failed searches #5681

Merged
merged 4 commits into from Jun 5, 2019

Conversation

@mpfz0r
Copy link
Member

commented Feb 13, 2019

If you search on a field that is mapped to a numeric,
you won't see the real reason on why this has failed.
I assume the error format has changed in recent ES versions,
and the info is now hidden in the caused_by field on shard failures.

For reference, this is the response:

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 64,
    "failures" : [
      {
        "shard" : 0,
        "index" : "graylog_0",
        "reason" : {
          "type" : "query_shard_exception",
          "reason" : "failed to create query: {\n [....]  }\n}",
          "index" : "graylog_0",
          "caused_by" : {
            "type" : "number_format_exception",
            "reason" : "For input string: \"foo\""
          }
        }
      }
    ]
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}
@dennisoelkers

This comment has been minimized.

Copy link
Member

commented Feb 18, 2019

Could you also add a test case for this?

mpfz0r added 3 commits Jan 25, 2019
Also return ES "caused_by" error message for failed searches
If you search on a field that is mapped to a numeric,
you won't see the real reason on why this has failed.
I assume the error format has changed in recent ES versions,
and the info is now hidden in the `caused_by` field on shard failures.

For reference, this is the response:
```
{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 64,
    "failures" : [
      {
        "shard" : 0,
        "index" : "graylog_0",
        "reason" : {
          "type" : "query_shard_exception",
          "reason" : "failed to create query: {\n [....]  }\n}",
          "index" : "graylog_0",
          "caused_by" : {
            "type" : "number_format_exception",
            "reason" : "For input string: \"foo\""
          }
        }
      }
    ]
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}
```

@mpfz0r mpfz0r force-pushed the return-es-caused-by-error branch from 2411ecc to e3063f1 Jun 4, 2019

@dennisoelkers

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

@mpfz0r: Only the license headers are missing, then we are good to go.

@dennisoelkers dennisoelkers merged commit 0cd893e into master Jun 5, 2019

4 checks passed

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

@dennisoelkers dennisoelkers deleted the return-es-caused-by-error branch Jun 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.