Index template name specifies component templates – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.9-7.15

Briefly, this error occurs when an index template specifies component templates that do not exist in Elasticsearch. This could be due to a typo in the component template name or the component template was deleted. To resolve this issue, you can either create the missing component templates or correct the component template names in the index template. Also, ensure that the component templates are created before the index template that uses them.

This guide will help you check for common problems that cause the log ” index template [” + name + “] specifies component templates ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, metadata, index, template.

Log Context

Log “index template [” + name + “] specifies component templates ” class name is MetadataIndexTemplateService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 final List missingComponentTemplates = template.composedOf().stream()
 .filter(componentTemplate -> componentTemplates.containsKey(componentTemplate) == false)
 .collect(Collectors.toList());  if (missingComponentTemplates.size() > 0) {
 throw new InvalidIndexTemplateException(name; "index template [" + name + "] specifies component templates " +
 missingComponentTemplates + " that do not exist");
 }
 }  public ClusterState addIndexTemplateV2(final ClusterState currentState; final boolean create;

 

 [ratemypost]