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

[Grokdebugger] Fix simulate error handling #83036

Merged

Conversation

jloleysens
Copy link
Contributor

Summary

Fix #82869

  • Use the new ES client for the call to ingest simulate
  • Use handleEsError shared logic to correctly handle errors originating from ES
  • Added a minor fix for where a string value was being thrown as an error
  • Removed some functionality from KibanaFramework

How to test

  1. Start Kibana with basic license yarn start
  2. Create a new user and a new role - the role should just have access to all of Kibana UI no actual cluster privileges. Assign this role to the user
  3. Logged in as the new user, go to grokdebugger and submit a simulate request for any input
  4. See the error message regarding cluster privileges.
  5. Do the same with the ES user with full privileges and everything should work as before

Screenshots

Screenshot 2020-11-10 at 11 22 38

Screenshot 2020-11-10 at 11 34 28

Release note

Grokdebugger correctly passes Elasticsearch errors to the Kibana UI.

- removed code to call simulate endpoint from "KibanaFramework"
- fixed throwing of string value
- using new elasticsearch client instead of legacy
- handle error with shared error handling logic
@jloleysens jloleysens added release_note:fix v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Feature:Grok Debugger Dev Tools Grok Debugger feature v7.11.0 labels Nov 10, 2020
@jloleysens jloleysens requested a review from cjcenizal November 10, 2020 10:48
@jloleysens jloleysens requested a review from a team as a code owner November 10, 2020 10:48
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
grokdebugger 558.3KB 558.3KB +11.0B

Distributable file count

id before after diff
default 42766 42767 +1

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jloleysens jloleysens requested review from yuliacech and removed request for cjcenizal November 10, 2020 17:31
Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Hi @jloleysens , changes LGTM, I tested locally and everything worked!

@jloleysens jloleysens merged commit 9038e5c into elastic:master Nov 11, 2020
@jloleysens jloleysens deleted the grokdebugger/fix-simulate-error-handling branch November 11, 2020 14:43
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 11, 2020
* Fix detection of 4xx errors in grokdebugger simulate endpoint

- removed code to call simulate endpoint from "KibanaFramework"
- fixed throwing of string value
- using new elasticsearch client instead of legacy
- handle error with shared error handling logic

* added deprecation notice to register route on KibanaFramework

* remove deprecation notice
jloleysens added a commit that referenced this pull request Nov 11, 2020
* Fix detection of 4xx errors in grokdebugger simulate endpoint

- removed code to call simulate endpoint from "KibanaFramework"
- fixed throwing of string value
- using new elasticsearch client instead of legacy
- handle error with shared error handling logic

* added deprecation notice to register route on KibanaFramework

* remove deprecation notice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Grok Debugger Dev Tools Grok Debugger feature release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grok Debugger API routes should forward ES errors
4 participants