Document not found index id – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 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 retrieve a document using a specific index and ID, but the document does not exist in the specified index. This could be due to the document being deleted, the index not existing, or the ID being incorrect. To resolve this issue, you can verify the existence of the index and the document ID. If the index or document ID is incorrect, correct it. If the document was deleted, you may need to recreate it or restore it from a backup if available.

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 ” Document not found [” + index + “]/[” + id + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: rest, index, document.

Log Context

Log “Document not found [” + index + “]/[” + id + “]” class name is RestGetSourceAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 private static void checkResource(final GetResponse response) {
 final String index = response.getIndex();
 final String id = response.getId();  if (response.isExists() == false) {
 throw new ResourceNotFoundException("Document not found [" + index + "]/[" + id + "]");
 } else if (response.isSourceEmpty()) {
 throw new ResourceNotFoundException("Source not found [" + index + "]/[" + id + "]");
 }
 }
 }

 

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?

Get expert answers on Elasticsearch/OpenSearch