Acknowledge alert times out

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch 2.11.1 on RHEL 9 any browser

Describe the issue:
I am running Opensearch inside a docker container with security turned on through the security plugin.
I have created a monitor which has triggers an alert.

When I select the alert and click Acknowledge, nothing happens for a while. Eventually, I see a message that says the “Failed to acknowledge the alert Request Timeout after 30000ms”.

I have pulled the container log and see:
{“type”: “server”, “timestamp”: “2024-04-19T22:01:31,180Z”, “level”: “ERROR”, “component”: “o.o.b.OpenSearchUncaughtExceptionHandler”, “cluster.name”: “docker-cluster”, “node.name”: “datastore”, “message”: “uncaught exception in thread [DefaultDispatcher-worker-4]”, “cluster.uuid”: “2WjR_3_cQGq4fa4jC-sSjg”, “node.id”: “jHwAj9aHSTK9eyuH4jOLrQ” ,
“stacktrace”: [“org.opensearch.alerting.util.AlertingException: Filter by user backend roles is enabled with security disabled.”,
“at org.opensearch.alerting.util.AlertingException$Companion.wrap(AlertingException.kt:70) ~[?:?]”,
“at org.opensearch.alerting.transport.SecureTransportAction$DefaultImpls.validateUserBackendRoles(SecureTransportAction.kt:82) ~[?:?]”,
“at org.opensearch.alerting.transport.TransportGetMonitorAction.validateUserBackendRoles(TransportGetMonitorAction.kt:50) ~[?:?]”,
“at org.opensearch.alerting.transport.TransportGetMonitorAction.doExecute(TransportGetMonitorAction.kt:79) ~[?:?]”,
“at org.opensearch.alerting.transport.TransportGetMonitorAction.doExecute(TransportGetMonitorAction.kt:50) ~[?:?]”,
“at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:218) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.indexmanagement.controlcenter.notification.filter.IndexOperationActionFilter.apply(IndexOperationActionFilter.kt:39) ~[?:?]”,
“at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.indexmanagement.rollup.actionfilter.FieldCapsFilter.apply(FieldCapsFilter.kt:118) ~[?:?]”,
“at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.security.filter.SecurityFilter.apply0(SecurityFilter.java:324) ~[?:?]”,
“at org.opensearch.security.filter.SecurityFilter.apply(SecurityFilter.java:165) ~[?:?]”,
“at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.action.support.TransportAction.execute(TransportAction.java:188) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.action.support.TransportAction.execute(TransportAction.java:107) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.client.node.NodeClient.executeLocally(NodeClient.java:110) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.client.node.NodeClient.doExecute(NodeClient.java:97) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.client.support.AbstractClient.execute(AbstractClient.java:476) ~[opensearch-2.11.1.jar:2.11.1]”,
“at org.opensearch.alerting.transport.TransportAcknowledgeAlertAction$doExecute$1$1$getMonitorResponse$1.invoke(TransportAcknowledgeAlertAction.kt:99) ~[opensearch-alerting-2.11.1.0-SNAPSHOT.jar:2.11.1.0-SNAPSHOT]”,
“at org.opensearch.alerting.transport.TransportAcknowledgeAlertAction$doExecute$1$1$getMonitorResponse$1.invoke(TransportAcknowledgeAlertAction.kt:92) ~[opensearch-alerting-2.11.1.0-SNAPSHOT.jar:2.11.1.0-SNAPSHOT]”,
“at org.opensearch.alerting.opensearchapi.OpenSearchExtensionsKt.suspendUntil(OpenSearchExtensions.kt:152) ~[alerting-core-2.11.1.0-SNAPSHOT.jar:?]”,
“at org.opensearch.alerting.transport.TransportAcknowledgeAlertAction$doExecute$1$1.invokeSuspend(TransportAcknowledgeAlertAction.kt:92) ~[opensearch-alerting-2.11.1.0-SNAPSHOT.jar:2.11.1.0-SNAPSHOT]”,
“at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.8.21.jar:1.8.21-release-380(1.8.21)]”,
“at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233) [kotlinx-coroutines-core-1.1.1.jar:?]”,
“at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) [kotlinx-coroutines-core-1.1.1.jar:?]”,
“at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) [kotlinx-coroutines-core-1.1.1.jar:?]”,
“at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) [kotlinx-coroutines-core-1.1.1.jar:?]”,
“Caused by: java.lang.Exception: org.opensearch.OpenSearchStatusException: Filter by user backend roles is enabled with security disabled.”,
“… 27 more”] }
uncaught exception in thread [DefaultDispatcher-worker-4]
AlertingException[Filter by user backend roles is enabled with security disabled.]; nested: Exception[org.opensearch.OpenSearchStatusException: Filter by user backend roles is enabled with security disabled.];
at org.opensearch.alerting.util.AlertingException$Companion.wrap(AlertingException.kt:70)
at org.opensearch.alerting.transport.SecureTransportAction$DefaultImpls.validateUserBackendRoles(SecureTransportAction.kt:82)
at org.opensearch.alerting.transport.TransportGetMonitorAction.validateUserBackendRoles(TransportGetMonitorAction.kt:50)
at org.opensearch.alerting.transport.TransportGetMonitorAction.doExecute(TransportGetMonitorAction.kt:79)
at org.opensearch.alerting.transport.TransportGetMonitorAction.doExecute(TransportGetMonitorAction.kt:50)
at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:218)
at org.opensearch.indexmanagement.controlcenter.notification.filter.IndexOperationActionFilter.apply(IndexOperationActionFilter.kt:39)
at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216)
at org.opensearch.indexmanagement.rollup.actionfilter.FieldCapsFilter.apply(FieldCapsFilter.kt:118)
at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216)
at org.opensearch.security.filter.SecurityFilter.apply0(SecurityFilter.java:324)
at org.opensearch.security.filter.SecurityFilter.apply(SecurityFilter.java:165)
at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216)
at org.opensearch.action.support.TransportAction.execute(TransportAction.java:188)
at org.opensearch.action.support.TransportAction.execute(TransportAction.java:107)
at org.opensearch.client.node.NodeClient.executeLocally(NodeClient.java:110)
at org.opensearch.client.node.NodeClient.doExecute(NodeClient.java:97)
at org.opensearch.client.support.AbstractClient.execute(AbstractClient.java:476)
at org.opensearch.alerting.transport.TransportAcknowledgeAlertAction$doExecute$1$1$getMonitorResponse$1.invoke(TransportAcknowledgeAlertAction.kt:99)
at org.opensearch.alerting.transport.TransportAcknowledgeAlertAction$doExecute$1$1$getMonitorResponse$1.invoke(TransportAcknowledgeAlertAction.kt:92)
at org.opensearch.alerting.opensearchapi.OpenSearchExtensionsKt.suspendUntil(OpenSearchExtensions.kt:152)
at org.opensearch.alerting.transport.TransportAcknowledgeAlertAction$doExecute$1$1.invokeSuspend(TransportAcknowledgeAlertAction.kt:92)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)
Caused by: java.lang.Exception: org.opensearch.OpenSearchStatusException: Filter by user backend roles is enabled with security disabled.
… 27 more

I don’t have a problem with any of the other alerting functions.

After putting some debug statements in the log, it appears that the userid that I am logged in with get forgotten.

Is there a code fix in newer code for this? Is there some configuration setting that I am missing?

Configuration:

Relevant Logs or Screenshots:

I believe this problem is caused by what is documented in

Is there any sample code that I can look at that addresses this or a direct fix for the alert acknowledge problem?

you may try version 2.13.0
it may have been fixed already