Only allow store that can be opened or that throws a ShardLockObtainFailedException while being opened but got a – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch tries to open a store that neither can be opened nor throws a ShardLockObtainFailedException. This could be due to a corrupted index or a disk I/O error. To resolve this issue, you can try to restore the index from a snapshot, or delete and recreate the index if the data is recoverable. If it’s a disk I/O error, check the disk health and replace it if necessary. Also, ensure that Elasticsearch has the necessary permissions to access the data directory.

This guide will help you check for common problems that cause the log ” only allow store that can be opened or that throws a ShardLockObtainFailedException while being opened but got a ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: shard.

Log Context

Log “only allow store that can be opened or that throws a ShardLockObtainFailedException while being opened but got a” class name is PrimaryShardAllocator.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 }
 }  if (allocationId != null) {
 assert nodeShardState.storeException() == null || nodeShardState.storeException() instanceof ShardLockObtainFailedException
 : "only allow store that can be opened or that throws a ShardLockObtainFailedException while being opened but got a "
 + "store throwing "
 + nodeShardState.storeException();
 numberOfAllocationsFound++;
 if (matchAnyShard || inSyncAllocationIds.contains(nodeShardState.allocationId())) {
 nodeShardStates.add(nodeShardState);

 

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?