Datafeed is stopping because job state is – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when the Elasticsearch job associated with a datafeed is not in the correct state to process data. This could be due to the job being closed, failed, or not yet opened. To resolve this issue, you can check the job’s state and ensure it’s in the ‘opened’ state before starting the datafeed. If the job is closed, you can open it using the ‘open jobs API’. If the job has failed, you need to investigate the cause of the failure, fix it, and then open the job again.

This guide will help you check for common problems that cause the log ” Datafeed [{}] is stopping because job [{}] state is [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “Datafeed [{}] is stopping because job [{}] state is [{}]” classname is DatafeedRunner.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                if (jobState == JobState.OPENING || jobHasOpenAutodetectCommunicator(currentTasks; jobId) == false) {
                    remainingTasks.add(datafeedTask);
                } else if (jobState == JobState.OPENED) {
                    runTask(datafeedTask);
                } else {
                    logger.warn("Datafeed [{}] is stopping because job [{}] state is [{}]"; datafeedTask.getDatafeedId(); jobId; jobState);
                    datafeedTask.stop("job_never_opened"; TimeValue.timeValueSeconds(20));
                }
            }
            tasksToRun.retainAll(remainingTasks);
        }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?