Persistent task with id and allocation id failed to create – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch fails to create a persistent task due to issues like insufficient permissions, network connectivity problems, or a misconfigured cluster. To resolve this, you can check and adjust the user permissions, ensure the network connectivity is stable, and verify the cluster configuration. Also, check the task’s ID and allocation ID for any inconsistencies. If the problem persists, consider restarting the Elasticsearch service or the entire cluster.

This guide will help you check for common problems that cause the log ” Persistent task [{}] with id [{}] and allocation id [{}] failed to create ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: task, allocation, persistent.

Log Context

Log “Persistent task [{}] with id [{}] and allocation id [{}] failed to create” classname is PersistentTasksNodeService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        } catch (Exception e) {
            initializationException = e;
        } finally {
            if (processed == false) {
                // something went wrong - unregistering task
                logger.warn("Persistent task [{}] with id [{}] and allocation id [{}] failed to create"; task.getAction();
                    task.getPersistentTaskId(); task.getAllocationId());
                taskManager.unregister(task);
                if (initializationException != null) {
                    notifyMasterOfFailedTask(taskInProgress; initializationException);
                }

 

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?