Skip to content

Conversation

@r00tu53r
Copy link
Contributor

@r00tu53r r00tu53r commented Dec 8, 2021

Return root cause (if available) for errors returned from Elasticsearch. This helps debugging errors with respect to ingest pipelines or other errors reported when interacting with Elasticsearch. Example -

Before:

$ elastic-package test pipeline
Run pipeline tests for the package
Error: error running package pipeline tests: could not complete test run: installing ingest pipelines failed: installing pipelines failed: unexpected response status for PutPipeline (400): 400 Bad Request (pipelineName: default-1638926343429676922): elasticsearch error (type=script_exception): compile error

After:

$ elastic-package test pipeline
Run pipeline tests for the package
Error: error running package pipeline tests: could not complete test run: installing ingest pipelines failed: installing pipelines failed: unexpected response status for PutPipeline (400): 400 Bad Request (pipelineName: default-1638926754640971882): elasticsearch error (type=script_exception): compile error
Root cause:
[
  {
    "type": "script_exception",
    "reason": "compile error",
    "processor_type": "dissect",
    "script_stack": [
      "... _principal_name.contains('\\')",
      "                             ^---- HERE"
    ],
    "script": "ctx?.sqlserver?.audit?.server_principal_name != null \u0026\u0026 ctx?.sqlserver?.audit?.server_principal_name.contains('\\')",
    "lang": "painless",
    "position": {
      "offset": 110,
      "start": 85,
      "end": 114
    },
    "suppressed": [
      {
        "type": "parse_exception",
        "reason": "processor [set] doesn't support one or more provided configuration parameters [ignore_missing]",
        "processor_type": "set"
      },
      {
        "type": "parse_exception",
        "reason": "processor [set] doesn't support one or more provided configuration parameters [ignore_missing]",
        "processor_type": "set"
      },
      {
        "type": "parse_exception",
        "reason": "processor [set] doesn't support one or more provided configuration parameters [ignore_missing]",
        "processor_type": "set"
      },
      {
        "type": "parse_exception",
        "reason": "processor [set] doesn't support one or more provided configuration parameters [ignore_missing]",
        "processor_type": "set"
      }
    ]
  }
]

@r00tu53r r00tu53r requested a review from andrewkroh December 8, 2021 01:27
@r00tu53r r00tu53r self-assigned this Dec 8, 2021
@r00tu53r r00tu53r added the enhancement New feature or request label Dec 8, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 8, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-12-08T02:28:39.880+0000

  • Duration: 31 min 14 sec

  • Commit: 9d5c22a

Test stats 🧪

Test Results
Failed 0
Passed 455
Skipped 4
Total 459

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@andrewkroh andrewkroh added Team:Ecosystem Label for the Packages Ecosystem team Team:Security-External Integrations labels Dec 8, 2021
@mtojek mtojek self-requested a review December 8, 2021 07:45
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Hi Sai,

Thanks for your contribution!

Could you please double-check if the verbose mode doesn't mess up the CLI table with test results?

elastic-package test pipeline -v

If it's fine, I'm happy to merge it.

@r00tu53r
Copy link
Contributor Author

r00tu53r commented Dec 8, 2021

Hi Marcin,

Thank you. I checked the output for elastic-package test pipeline -v for cases where -

  1. All pipeline tests passed
  2. Some tests failed
  3. Some with pipeline errors (i.e. syntax error in pipeline)

For cases 1 & 2 the CLI table was displayed as expected. The 3rd case it isn't applicable. If I've misunderstood please let me know.

@mtojek mtojek self-requested a review December 8, 2021 10:04
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution and testing, let's get this one in!

@mtojek mtojek merged commit 5509c44 into elastic:master Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Team:Ecosystem Label for the Packages Ecosystem team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants