Must not contain the following characters – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.14-8.9

Briefly, this error occurs when Elasticsearch encounters forbidden characters in the index name, document id, or field name. Elasticsearch has a set of characters that are not allowed in these identifiers. The error message usually specifies which characters are causing the issue. To resolve this, you should rename the index, document id, or field name to exclude these characters. If the forbidden characters are being generated automatically, you may need to modify your data ingestion or processing scripts to prevent these characters from being included.

This guide will help you check for common problems that cause the log ” must not contain the following characters ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: repositories.

Log Context

Log “must not contain the following characters” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (repositoryName.contains("#")) {
 throw new RepositoryException(repositoryName; "must not contain '#'");
 if (Strings.validFileName(repositoryName) == false) {
 throw new RepositoryException(repositoryName; "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS);
 }  private static void ensureRepositoryNotInUse(ClusterState clusterState; String repository) {
 final SnapshotsInProgress snapshots = clusterState.custom(SnapshotsInProgress.TYPE; SnapshotsInProgress.EMPTY);


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?