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/action/admin/cluster/desirednodes/TransportUpdateDesiredNodesActionTests.java
final ClusterBlockException e = action.checkBlock(randomUpdateDesiredNodesRequest(), state);
        assertThat(e, is(nullValue()));
    }
    public void testSettingsGetValidated() throws Exception {
        DesiredNodesSettingsValidator validator = new DesiredNodesSettingsValidator(null) {
            @Override
            public void validate(List<DesiredNode> desiredNodes) {
                throw new IllegalArgumentException("Invalid settings");
            }
        };
        ClusterService clusterService = mock(ClusterService.class);
        ThreadPool threadPool = mock(ThreadPool.class);
        TransportService transportService = MockUtils.setupTransportServiceWithThreadpoolExecutor(threadPool);
        final TransportUpdateDesiredNodesAction action = new TransportUpdateDesiredNodesAction(
            transportService,
            clusterService,
            threadPool,
            mock(ActionFilters.class),
            mock(IndexNameExpressionResolver.class),
            validator,
            mock(AllocationService.class)
        );
        final ClusterState state = ClusterState.builder(new ClusterName(randomAlphaOfLength(10))).build();
        final PlainActionFuture<UpdateDesiredNodesResponse> future = PlainActionFuture.newFuture();
        action.masterOperation(mock(Task.class), randomUpdateDesiredNodesRequest(), state, future);
        IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, future::actionGet);
        assertThat(exception.getMessage(), containsString("Invalid settings"));
        verify(clusterService, never()).submitUnbatchedStateUpdateTask(any(), any());
    }
    public void testUpdateDesiredNodes() {