elastic / kibana

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

[ML] Saved object syncing can throw an error with datafeed ID update #191196

Open jgowdyelastic opened 2 months ago

jgowdyelastic commented 2 months ago

When syncing or initialising AD saved objects, if a job which lives in a different space is missing the datafeed ID but the datafeed exists, syncing will throw an error.

To reproduce:

This also affects the hourly auto sync task which only runs on the default space. Meaning it's not possible to update the datafeed ID for jobs that live exclusively in a non default space.

This is not a non-trivial fix as the saved objects client does not allow editing of SOs from other spaces. The is an old feature request to allow this

The work around is to run sync in the space which the jobs exist.

The datafeed ID updating code should catch the error and not cause the endpoint to return with a 500 error code.

elasticmachine commented 2 months ago

Pinging @elastic/ml-ui (:ml)