During desired nodes updates the system validates that the provided node settings are valid in order to avoid boot looping issues. If one of the node settings depends on a secure setting, the validation fails even when the secure setting is present and correct.
server/src/test/java/org/elasticsearch/cluster/desirednodes/DesiredNodesSettingsValidatorTests.java
final Set<Setting<?>> availableSettings = Set.of(
            Setting.intSetting("test.invalid_value", 1, Setting.Property.NodeScope),
            Setting.intSetting("test.invalid_range", 1, 1, 100, Setting.Property.NodeScope),
            NODE_EXTERNAL_ID_SETTING,
            NODE_NAME_SETTING
        );
        final Settings.Builder settings = Settings.builder();
        if (randomBoolean()) {
            settings.put("test.invalid_value", randomAlphaOfLength(10));
        } else {
            settings.put("test.invalid_range", randomFrom(-1, Integer.MAX_VALUE));
        }
        final ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, availableSettings);
        final DesiredNodesSettingsValidator validator = new DesiredNodesSettingsValidator(clusterSettings);
        final List<DesiredNode> desiredNodes = randomList(2, 10, () -> randomDesiredNode(Version.CURRENT, settings.build()));
        IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> validator.validate(desiredNodes));
        assertThat(exception.getMessage(), containsString("Nodes with ids"));
        assertThat(exception.getMessage(), containsString("contain invalid settings"));
        assertThat(exception.getSuppressed().length > 0, is(equalTo(true)));
        assertThat(exception.getSuppressed()[0].getMessage(), containsString("Failed to parse value"));
    }
    public void testNodeVersionValidation() {
        final List<DesiredNode> desiredNodes = List.of(randomDesiredNode(Version.CURRENT.previousMajor(), Settings.EMPTY));
        final ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, Collections.emptySet());
        final DesiredNodesSettingsValidator validator = new DesiredNodesSettingsValidator(clusterSettings);
        final IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> validator.validate(desiredNodes));
        assertThat(exception.getMessage(), containsString("Nodes with ids"));
        assertThat(exception.getMessage(), containsString("contain invalid settings"));
        assertThat(exception.getSuppressed().length > 0, is(equalTo(true)));
        assertThat(exception.getSuppressed()[0].getMessage(), containsString("Illegal node version"));