Composable template template indexPatterns forbids index auto creation – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.11-8.9

Briefly, this error occurs when Elasticsearch tries to automatically create an index that matches a composable template, but the template settings forbid auto-creation. This could be due to a misconfiguration in the template settings. To resolve this issue, you can either modify the template settings to allow auto-creation of indices or manually create the index before indexing the data. Alternatively, you can disable the auto-creation of indices in Elasticsearch settings if it’s not necessary for your use case.

This guide will help you check for common problems that cause the log ” composable template ” + template.indexPatterns() + ” forbids index auto creation ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: template.

Log Context

Log “composable template ” + template.indexPatterns() + ” forbids index auto creation” class name is AutoCreateIndex.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (template != null && template.getAllowAutoCreate() != null) {
 if (template.getAllowAutoCreate()) {
 return true;
 } else {
 // An explicit false value overrides AUTO_CREATE_INDEX_SETTING
 throw new IndexNotFoundException("composable template " + template.indexPatterns() + " forbids index auto creation");
 }
 }  // One volatile read; so that all checks are done against the same instance:
 final AutoCreate autoCreate = this.autoCreate;

 

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?