Tried to query fileLength but file is gone – How to solve this OpenSearch error

Opster Team

Aug-23, Version: 1-1.1

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 OpenSearch operation.

Briefly, this error occurs when OpenSearch tries to access a file that no longer exists or has been moved. This could be due to a manual deletion, a system error, or a misconfiguration. To resolve this issue, you can try the following: 1) Verify the file path and ensure the file exists in the specified location. 2) Check the system logs for any errors that might have led to the file being deleted. 3) Ensure that OpenSearch has the necessary permissions to access the file. 4) If the file was moved, update the file path in OpenSearch configuration.

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 ” Tried to query fileLength but file is gone [{}] [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following OpenSearch concepts: query, index.

Log Context

Log “Tried to query fileLength but file is gone [{}] [{}]” classname is Engine.java.
We extracted the following from OpenSearch source code for those seeking an in-depth context :

            long length = 0L;
            try {
                length = directory.fileLength(file);
            } catch (NoSuchFileException | FileNotFoundException e) {
                final Directory finalDirectory = directory;
                logger.warn(() -> new ParameterizedMessage("Tried to query fileLength but file is gone [{}] [{}]";
                    finalDirectory; file); e);
            } catch (IOException e) {
                final Directory finalDirectory = directory;
                logger.warn(() -> new ParameterizedMessage("Error when trying to query fileLength [{}] [{}]";
                    finalDirectory; file); e);

 

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