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

Revisit how we return ES error in the <SectionError /> #77165

Closed
sebelga opened this issue Sep 10, 2020 · 1 comment · Fixed by #84184
Closed

Revisit how we return ES error in the <SectionError /> #77165

sebelga opened this issue Sep 10, 2020 · 1 comment · Fixed by #84184
Labels
enhancement New value added to drive a business result Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@sebelga
Copy link
Contributor

sebelga commented Sep 10, 2020

In index template, after the upgrade to composable template, we don't get useful errors coming back from ES when the template is invalid. Instead we get a

[illegal_argument_exception] composable template [abc] template after composition is invalid

Screenshot 2020-09-10 at 15 11 25

Which is really not that great to fix the template.

The reason is that ES returns the reason under a caused_by, which we strip in our <SectionError /> component. We need to retrieve recursively all the leaves of caused_by.reason to get meaningful error messages.

This is the complete error returned by ES not surfaced in the UI

{
  "msg": "[illegal_argument_exception] composable template [abc] template after composition is invalid",
  "path": "/_index_template/abc",
  "query": {},
  "body": {
    ...
  },
  "statusCode": 400,
  "response": {
    "error": {
      "root_cause": [
        {
          "type": "illegal_argument_exception",
          "reason": "composable template [abc] template after composition is invalid"
        }
      ],
      "type": "illegal_argument_exception",
      "reason": "composable template [abc] template after composition is invalid",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "invalid composite mappings for [abc]",
        "caused_by": {
          "type": "mapper_parsing_exception",
          "reason": "Failed to parse mapping: analyzer [customAnalyzer_1] not found for field [test]",
          "caused_by": {
            "type": "mapper_parsing_exception",
            "reason": "analyzer [customAnalyzer_1] not found for field [test]"
          }
        }
      }
    },
    "status": 400
  }
}
@sebelga sebelga added enhancement New value added to drive a business result Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Sep 10, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants