%s prewarming failed for file %s – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.7

Briefly, this error occurs when Elasticsearch fails to prewarm (load into cache before use) certain files, which can lead to slower search performance. This could be due to insufficient memory, disk space, or file corruption. To resolve this issue, you can try increasing the cache size, freeing up disk space, or checking the integrity of the files. If the problem persists, consider reindexing your data or upgrading your Elasticsearch version, as some versions have known issues with prewarming.

This guide will help you check for common problems that cause the log ” %s prewarming failed for file [%s] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “%s prewarming failed for file [%s]” classname is SearchableSnapshotDirectory.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                fileCompletionListener.whenComplete(ignored -> {
                    logger.debug("{} file [{}] prewarmed"; shardId; file.physicalName());
                }; e -> {
                    logger.warn(() -> format("%s prewarming failed for file [%s]"; shardId; file.physicalName()); e);

                final CountDownActionListener partsListener = new CountDownActionListener(numberOfParts; fileCompletionListener);
                submitted = true;