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

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

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.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

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?