The published hash of the consistent secure setting differs from the locally computed one – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.3-7.15

Briefly, this error occurs when the hash of the secure setting published in the Elasticsearch cluster differs from the one computed locally. This discrepancy can be due to changes in secure settings without proper re-initialization or due to a cluster node with different secure settings. To resolve this, you can re-initialize the secure settings or ensure all nodes in the cluster have the same secure settings. Also, check for any inconsistencies in your cluster state and rectify them.

This guide will help you check for common problems that cause the log ” the published hash [{}] of the consistent secure setting [{}] differs from the locally computed one [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: settings.

Log Context

Log “the published hash [{}] of the consistent secure setting [{}] differs from the locally computed one [{}]” classname is ConsistentSettingsService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                final String publishedSalt = parts[0];
                final String publishedHash = parts[1];
                final byte[] computedSaltedHashBytes = computeSaltedPBKDF2Hash(localHash; publishedSalt.getBytes(StandardCharsets.UTF_8));
                final String computedSaltedHash = new String(Base64.getEncoder().encode(computedSaltedHashBytes); StandardCharsets.UTF_8);
                if (false == publishedHash.equals(computedSaltedHash)) {
                    logger.warn("the published hash [{}] of the consistent secure setting [{}] differs from the locally computed one [{}]";
                            publishedHash; concreteSecureSetting.getKey(); computedSaltedHash);
                    if (state.nodes().isLocalNodeElectedMaster()) {
                        throw new IllegalStateException("Master node cannot validate consistent setting. The published hash ["
                                + publishedHash + "] of the consistent secure setting [" + concreteSecureSetting.getKey()
                                + "] differs from the locally computed one [" + computedSaltedHash + "].");

 

 [ratemypost]