Failed to open reader on writer – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch is unable to open a reader on a writer, typically due to a corrupted index or a disk space issue. To resolve this, you can try the following: 1) Check if there’s enough disk space and free up space if necessary. 2) Use the Elasticsearch Check Index API to verify the integrity of the index. If it’s corrupted, you may need to restore it from a backup. 3) If the issue persists, consider reindexing your data into a new index.

This guide will help you check for common problems that cause the log ” failed to open reader on writer ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index.

Log Context

Log “failed to open reader on writer” class name is InternalEngine.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 try {
 indexWriter.rollback();
 } catch (IOException inner) { // iw is closed below
 e.addSuppressed(inner);
 }
 throw new EngineCreationFailureException(shardId; "failed to open reader on writer"; e);
 }
 } finally {
 if (success == false) { // release everything we created on a failure
 IOUtils.closeWhileHandlingException(internalReaderManager; indexWriter);
 }

 

 [ratemypost]