Unexpected exception while failing – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-6.8

Briefly, this error occurs when Elasticsearch encounters an unexpected issue while trying to downgrade from version 6 to version 8. This could be due to incompatible data types, index settings, or mapping conflicts. To resolve this issue, you can try the following: 1) Ensure that your data types are compatible between the two versions. 2) Check your index settings and mappings for any conflicts. 3) Consider reindexing your data after downgrading. 4) If all else fails, you may need to restore from a backup taken before the downgrade attempt.

This guide will help you check for common problems that cause the log ” Unexpected exception while failing [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: discovery.

Log Context

Log “Unexpected exception while failing [{}]” classname is ZenDiscovery.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

         } catch (Exception e) {
            try {
                pendingStatesQueue.markAsFailed(newClusterState; e);
            } catch (Exception inner) {
                logger.error(() -> new ParameterizedMessage("unexpected exception while failing [{}]"; reason); inner);
            return false;

        if (currentState.blocks().hasGlobalBlock(discoverySettings.getNoMasterBlock())) {