Cannot clone shard snapshot on a readonly repository – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.1-8.9

Briefly, this error occurs when Elasticsearch tries to clone a shard snapshot on a repository that is set to read-only mode. This operation is not allowed because the repository is not writable. To resolve this issue, you can either change the repository settings to make it writable or clone the shard snapshot to a different repository that is not read-only. Additionally, ensure that the user has the necessary permissions to perform write operations on the repository.

This guide will help you check for common problems that cause the log ” cannot clone shard snapshot on a readonly repository ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: snapshot, blobstore, shard, repositories, repository.

Log Context

Log “cannot clone shard snapshot on a readonly repository” class name is BlobStoreRepository.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 RepositoryShardId shardId;
 @Nullable ShardGeneration shardGeneration;
 ActionListener listener
 ) {
 if (isReadOnly()) {
 listener.onFailure(new RepositoryException(metadata.name(); "cannot clone shard snapshot on a readonly repository"));
 return;
 }
 final IndexId index = shardId.index();
 final int shardNum = shardId.shardId();
 final Executor executor = threadPool.executor(ThreadPool.Names.SNAPSHOT);

 

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?