Briefly, this error occurs when you try to delete a snapshot that is incompatible with the current version of Elasticsearch. This could be due to the snapshot being created with a different version of Elasticsearch. To resolve this issue, you can either upgrade your Elasticsearch to a version compatible with the snapshot or restore the snapshot to a cluster running a compatible version, then re-index the data to your current cluster. Alternatively, you can ignore the incompatible snapshots if they are not needed.
This guide will help you check for common problems that cause the log ” cannot delete incompatible snapshot ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: snapshot, delete.
Overview
DELETE is an Elasticsearch API which removes a document from a specific index. This API requires an index name and _id document to delete the document.
Delete a document
DELETE /my_index/_doc/1
Notes
- A delete request throws 404 error code if the document does not already exist in the index.
- If you want to delete a set of documents that matches a query, you need to use delete by query API.
Log Context
Log “cannot delete incompatible snapshot” class name is SnapshotsService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
final Repository repository = repositoriesService.repository(repositoryName); final RepositoryData repositoryData = repository.getRepositoryData(); final OptionalincompatibleSnapshotId = repositoryData.getIncompatibleSnapshotIds().stream().filter(s -> snapshotName.equals(s.getName())).findFirst(); if (incompatibleSnapshotId.isPresent()) { throw new SnapshotException(repositoryName; snapshotName; "cannot delete incompatible snapshot"); } Optional matchedEntry = repositoryData.getSnapshotIds() .stream() .filter(s -> s.getName().equals(snapshotName)) .findFirst();
[ratemypost]