Cannot add another snapshot to this repository as it – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.11-7.13

Briefly, this error occurs when you try to add a new snapshot to an Elasticsearch repository that is already processing a snapshot. Elasticsearch allows only one snapshot process at a time per repository. To resolve this issue, you can either wait for the current snapshot process to complete or cancel the ongoing snapshot process. Alternatively, you can create a new repository and add the snapshot there.

This guide will help you check for common problems that cause the log ” Cannot add another snapshot to this repository as it ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: repositories, snapshot, blobstore, repository.

Log Context

Log “Cannot add another snapshot to this repository as it” class name is BlobStoreRepository.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
final StepListener<repositorydata> repoDataListener = new StepListener<>();
getRepositoryData(repoDataListener);
repoDataListener.whenComplete(existingRepositoryData -> {
final int existingSnapshotCount = existingRepositoryData.getSnapshotIds().size();
if (existingSnapshotCount >= maxSnapshotCount) {
listener.onFailure(new RepositoryException(metadata.name(); "Cannot add another snapshot to this repository as it " +
"already contains [" + existingSnapshotCount + "] snapshots and is configured to hold up to [" + maxSnapshotCount +
"] snapshots only."));
return;
}<p></p></repositorydata>
final StepListener<repositorydata> repoDataListener = new StepListener<>(); getRepositoryData(repoDataListener); repoDataListener.whenComplete(existingRepositoryData -> { final int existingSnapshotCount = existingRepositoryData.getSnapshotIds().size(); if (existingSnapshotCount >= maxSnapshotCount) { listener.onFailure(new RepositoryException(metadata.name(); "Cannot add another snapshot to this repository as it " + "already contains [" + existingSnapshotCount + "] snapshots and is configured to hold up to [" + maxSnapshotCount + "] snapshots only.")); return; }<p></p></repositorydata>
 final StepListener repoDataListener = new StepListener<>();
 getRepositoryData(repoDataListener);
 repoDataListener.whenComplete(existingRepositoryData -> {
 final int existingSnapshotCount = existingRepositoryData.getSnapshotIds().size();
 if (existingSnapshotCount >= maxSnapshotCount) {
 listener.onFailure(new RepositoryException(metadata.name(); "Cannot add another snapshot to this repository as it " +
 "already contains [" + existingSnapshotCount + "] snapshots and is configured to hold up to [" + maxSnapshotCount +
 "] snapshots only."));
 return;
 }

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.