Briefly, this error occurs when a semicolon (;) is included in a query or data sent to Elasticsearch. Elasticsearch interprets semicolons as special characters, which can disrupt the parsing process. To resolve this issue, you can either remove the semicolon from the data or query, or escape it using backslashes (\;) if it’s necessary for your data. Additionally, ensure that your application’s input validation process prevents such characters from being included in the data sent to Elasticsearch.
This guide will help you check for common problems that cause the log ” must not contain ‘;’ ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .
Log Context
Log “must not contain ‘;'” class name is SnapshotsService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
} if (snapshotName.contains(" ")) { throw new InvalidSnapshotNameException(repositoryName; snapshotName; "must not contain whitespace"); } if (snapshotName.contains(";")) { throw new InvalidSnapshotNameException(repositoryName; snapshotName; "must not contain ';'"); } if (snapshotName.contains("#")) { throw new InvalidSnapshotNameException(repositoryName; snapshotName; "must not contain '#'"); } if (snapshotName.charAt(0) == '_') {