Index template existing == null adding updating – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.8-7.8

Briefly, this error occurs when Elasticsearch tries to update an index template that doesn’t exist. This could be due to a misconfiguration or a typo in the index template name. To resolve this issue, you can either create the index template if it doesn’t exist or correct the index template name if it was misspelled. Also, ensure that the user has the necessary permissions to update the index template.

This guide will help you check for common problems that cause the log ” {} index template [{}]”; existing == null ? “adding” : “updating ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, template, cluster, metadata.

Log Context

Log “{} index template [{}]”; existing == null ? “adding” : “updating” classname is MetadataIndexTemplateService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            throw new IllegalArgumentException("composable template [" + name +
                "] template after composition " +
                (finalIndexTemplate.composedOf().size() > 0 ? "with component templates " + finalIndexTemplate.composedOf() + " " : "") +
                "is invalid"; e);
        }
        logger.info("{} index template [{}]"; existing == null ? "adding" : "updating"; name);
        return ClusterState.builder(currentState)
            .metadata(Metadata.builder(currentState.metadata()).put(name; finalIndexTemplate))
            .build();
    }

 

 [ratemypost]