No such index and AUTO CREATE INDEX SETTING getKey is false – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-6.8

Briefly, this error occurs when Elasticsearch tries to automatically create an index that doesn’t exist, but the auto-create index setting is set to false. This setting prevents Elasticsearch from automatically creating indices. To resolve this issue, you can either manually create the index before indexing documents into it, or you can change the auto-create index setting to true, allowing Elasticsearch to automatically create indices as needed. However, be aware that allowing automatic index creation can lead to unexpected index creation if incorrect index names are used.

This guide will help you check for common problems that cause the log ” no such index and [” + AUTO_CREATE_INDEX_SETTING.getKey() + “] is [false] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index.

Log Context

Log “no such index and [” + AUTO_CREATE_INDEX_SETTING.getKey() + “] is [false]” class name is AutoCreateIndex.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 return false;
 }
 // One volatile read; so that all checks are done against the same instance:
 final AutoCreate autoCreate = this.autoCreate;
 if (autoCreate.autoCreateIndex == false) {
 throw new IndexNotFoundException("no such index and [" + AUTO_CREATE_INDEX_SETTING.getKey() + "] is [false]"; index);
 }
 if (dynamicMappingDisabled) {
 throw new IndexNotFoundException("no such index and [" + MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey() + "] is [false]";
 index);
 }

 

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?