Creating new allocation failed – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8-8.2

Briefly, this error occurs when Elasticsearch is unable to allocate shards to nodes due to insufficient resources, such as disk space, memory, or CPU. To resolve this issue, you can take several steps: 1) Increase the resources of your Elasticsearch cluster, either by adding more nodes or upgrading existing ones. 2) Optimize your indices by reducing the number of shards, merging small indices, or deleting unnecessary data. 3) Check and adjust your shard allocation settings, such as the disk watermark thresholds. 4) Monitor your cluster regularly to prevent resource shortages.

This guide will help you check for common problems that cause the log ” [{}] creating new allocation failed ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, allocation.

Log Context

Log “[{}] creating new allocation failed” classname is TransportStartTrainedModelDeploymentAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        }

        ActionListener waitForDeploymentToStart = ActionListener.wrap(
            modelAllocation -> waitForDeploymentState(request.getModelId(); request.getTimeout(); request.getWaitForState(); listener);
            e -> {
                logger.warn(() -> new ParameterizedMessage("[{}] creating new allocation failed"; request.getModelId()); e);
                if (ExceptionsHelper.unwrapCause(e) instanceof ResourceAlreadyExistsException) {
                    e = new ElasticsearchStatusException(
                        "Cannot start deployment [{}] because it has already been started";
                        RestStatus.CONFLICT;
                        e;

 

 [ratemypost]