%s %s failed to clean up potentially bad snapshot – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.9

Briefly, this error occurs when Elasticsearch fails to delete a potentially corrupted or incomplete snapshot. This could be due to insufficient permissions, disk space issues, or network connectivity problems. To resolve this, you can manually delete the snapshot if it’s not needed. If it’s important, try restoring it to see if it’s corrupted. Ensure Elasticsearch has the necessary permissions and there’s enough disk space. Check your network connectivity and the health of your Elasticsearch cluster. If the problem persists, consider reconfiguring your snapshot settings or upgrading Elasticsearch to the latest version.

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

Log Context

Log “[%s] [%s] failed to clean up potentially bad snapshot” classname is SnapshotUpgradeTaskExecutor.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            }; failure -> {
                logger.warn(() -> format("[%s] [%s] failed to clean up potentially bad snapshot"; jobId; snapshotId); failure);
                    new ElasticsearchStatusException(
                        "Task to upgrade job [{}] snapshot [{}] got reassigned while running leaving an unknown snapshot state. "
                            + "Unable to cleanup potentially corrupted snapshot";