-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Logs] Analysis throws index pattern error when creating jobs but still actually creates them #48672
Comments
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
@weltenwort @Kerry350 any insight on what the expected behavior should be in this instance? |
This is related to #48231, which surfaces the underlying error and offers a way for the user to fix it. The job is still created, because it's not an atomic operation. Internally the ML plugin actually creates a job and a datafeed. If the latter fails the job stays. Currently we delete the job on retry, because, if the cause of the error is that a job with the same id already exists, we don't want to delete any data that might be valuable to the user. (deleting a job also automatically deletes the results) #48660 relates to how the job health is being interpreted when the datafeed is missing. Maybe we can cover what is described here by not treating it as "stopped" but "failed"? 🤔 @afgomez what do you think? |
That makes sense. I'll change the code in the PR to reflect that. |
I did some investigation around this. When the user tries to create an ML job with a non-existing index both the job and the datafeed are created. The datafeed is marked as When the user reloads the page, since the datafeed exists and it has a valid state ( Some options that we could do:
Any other ideas? |
There have been recent discussion about introducing a configuration option to change that behavior on demand: elastic/elasticsearch#48056 As for the options:
|
@weltenwort this is the response we get from the API {
"jobs": [{ "id": "...", "success": true }],
"datafeeds": [
{
"id": "...",
"success": true,
"started": false,
"error": {
"msg": "[status_exception] No node found to start datafeed [datafeed-...], allocation explanation [cannot start datafeed [datafeed-...] because index [wadus-*] does not exist, is closed, or is still initializing.]",
"path": "/_ml/datafeeds/.../_start?&start=...",
"query": {},
"statusCode": 409,
"response": "{\"error\":{\"root_cause\":[{\"type\":\"status_exception\",\"reason\":\"No node found to start datafeed [...], allocation explanation [cannot start datafeed [...] because index [wadus-*] does not exist, is closed, or is still initializing.]\"}],\"type\":\"status_exception\",\"reason\":\"No node found to start datafeed [...], allocation explanation [cannot start datafeed [...] because index [wadus-*] does not exist, is closed, or is still initializing.]\"},\"status\":409}"
}
}
],
"kibana": {}
} Technically it was never started, so it was never stopped :D. I think a new state to reflect this scenario ( |
Yes, the reason is obvious during the setup process and we handle it appropriately. I was talking about the |
Ah, yes :) That's why the proposal to have a new state. Let's wait for the ML team to give their opinion on the topic. Otherwise I can give a shot to the second option |
Superseeded by #50008 |
When your log settings includes an index pattern that does not exist, the analysis setup workflow throws this error:

This seems to imply that the jobs weren't created. However, when you refresh the page, or tab away and go back to Analysis, the Analysis tab displays the UI for a successfully set up ML job. The job also exists in the ML plugin UI.
Steps to reproduce:
Expected behavior:
Not sure whether we should suppress this error (if it's not actually a problem) or if the ML jobs should be deleted when this error throws.
The text was updated successfully, but these errors were encountered: