elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.64k stars 8.23k forks source link

[ML] Says job failed create but actually creates causing duplicate error on next creation attempt #121025

Open stefnestor opened 2 years ago

stefnestor commented 2 years ago

Kibana/Elasticsearch version: 7.15.2 Server OS version: Mac (11.6.1) Browser version: Firefox (94.0.2) Original install method (e.g. download page, yum, from source, etc.): ESS

Describe the bug: Kibana will error ML job failed create but actually creates causing duplicate error on next attempt.

Steps to reproduce:

  1. Create test ESS deployment
  2. Create new Anomaly Detection job (e.g. /app/ml/jobs/new_job > test index > single metrics w/default settings ...)
  3. At "Create Job" last page, cause failure somehow (e.g. temporarily close .kibana to not allow updated docs). Will error not able to create job '$JOB_ID' ... w/correlating causation.
  4. After bottom-right little window disappears, click "Create Job" again, now will error The job cannot be created with the Id '$JOB_ID'. The Id is already used.

Expected behavior:

Screenshots (if relevant):

image

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

image

Any additional context:

elasticmachine commented 2 years ago

Pinging @elastic/ml-ui (:ml)

jgowdyelastic commented 2 years ago

This error is being caused because we create the job saved object after successfully creating the job in elasticsearch. We might be able improve the text in the error toast to reflect this.

One important factor to acknowledge here: e.g. temporarily close .kibana to not allow updated docs if this is the case then kibana will not be in a stable state, all kinds of other things will be broken. I therefore think all we could really do in this case is improve the error message, no other work to improve user experience should be needed.