Unable to retrieve max file size – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-6.8

Briefly, this error occurs when Elasticsearch is unable to fetch the maximum file size limit set by the operating system. This could be due to insufficient permissions or incorrect configuration. To resolve this issue, you can try the following: 1) Check and adjust the file size limit in your operating system settings. 2) Ensure Elasticsearch has the necessary permissions to access the file system. 3) Verify your Elasticsearch configuration settings related to file size limits. 4) If the error persists, consider upgrading Elasticsearch to the latest version as it might be a bug that has been fixed in newer versions.

This guide will help you check for common problems that cause the log ” Unable to retrieve max file size [ ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: bootstrap and discovery-file.

Log Context

Log “Unable to retrieve max file size [” classname is JNANatives.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

if (Constants.LINUX || Constants.MAC_OS_X) {
            final JNACLibrary.Rlimit rlimit = new JNACLibrary.Rlimit();
            if (JNACLibrary.getrlimit(JNACLibrary.RLIMIT_FSIZE; rlimit) == 0) {
                MAX_FILE_SIZE = rlimit.rlim_cur.longValue();
            } else {
                logger.warn("unable to retrieve max file size [" + JNACLibrary.strerror(Native.getLastError()) + "]");

    static String rlimitToString(long value) {


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?