%s %s failed to load bad snapshot for deletion – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.9

Briefly, this error occurs when Elasticsearch attempts to delete a snapshot but fails because the snapshot is corrupted or missing. This could be due to a disk failure, network issue, or a bug in Elasticsearch. To resolve this issue, you can try the following: 1) Check the integrity of your snapshots and restore any corrupted ones from backup. 2) If the snapshot is not needed, manually delete it from the repository. 3) If the issue persists, consider upgrading Elasticsearch to the latest version as it may contain bug fixes related to snapshot deletion.

This guide will help you check for common problems that cause the log ” [%s] [%s] failed to load bad snapshot for deletion ” 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 load bad snapshot for deletion” classname is SnapshotUpgradeTaskExecutor.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

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