When creating any new Security Analytics detector an exception is thrown, here are some logs from the server:
{"type": "server", "timestamp": "2023-03-27T14:47:19,852Z", "level": "ERROR", "component": "o.o.a.u.AlertingException", "cluster.name": "logs", "node.name": "es-master-1", "message": "Aler ting error: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')", "cluster.uuid": "o1Ol5SK_SGWmwe0MXaMmtA", "node.id": "74ZN26_6TV2HGWRSuKA84A" } {"type": "server", "timestamp": "2023-03-27T14:47:19,854Z", "level": "ERROR", "component": "o.o.s.u.SecurityAnalyticsException", "cluster.name": "logs", "node.name": "es-master-1", "messag e": "Security Analytics error:", "cluster.uuid": "o1Ol5SK_SGWmwe0MXaMmtA", "node.id": "74ZN26_6TV2HGWRSuKA84A" , "stacktrace": ["org.opensearch.alerting.util.AlertingException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')", "at org.opensearch.alerting.util.AlertingException$Companion.wrap(AlertingException.kt:70) ~[?:?]", "at org.opensearch.alerting.transport.TransportIndexMonitorAction$IndexMonitorHandler.indexMonitor(TransportIndexMonitorAction.kt:512) ~[?:?]", "at org.opensearch.alerting.transport.TransportIndexMonitorAction$IndexMonitorHandler.access$indexMonitor(TransportIndexMonitorAction.kt:239) ~[?:?]", "at org.opensearch.alerting.transport.TransportIndexMonitorAction$IndexMonitorHandler$indexMonitor$1.invokeSuspend(TransportIndexMonitorAction.kt) ~[?:?]", "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: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of l oader 'bootstrap')", "... 9 more"] } {"type": "server", "timestamp": "2023-03-27T14:47:19,858Z", "level": "WARN", "component": "r.suppressed", "cluster.name": "logs", "node.name": "es-master-1", "message": "path: /_plugins/_s ecurity_analytics/detectors, params: {}", "cluster.uuid": "o1Ol5SK_SGWmwe0MXaMmtA", "node.id": "74ZN26_6TV2HGWRSuKA84A" , "stacktrace": ["org.opensearch.securityanalytics.util.SecurityAnalyticsException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in mo dule java.base of loader 'bootstrap')", "at org.opensearch.securityanalytics.util.SecurityAnalyticsException.wrap(SecurityAnalyticsException.java:51) ~[?:?]", "at org.opensearch.securityanalytics.transport.TransportIndexDetectorAction$AsyncIndexDetectorsAction.lambda$finishHim$0(TransportIndexDetectorAction.java:1168) ~[?:?]", "at org.opensearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:73) [opensearch-2.6.0.jar:2.6.0]", "at org.opensearch.action.ActionRunnable$2.doRun(ActionRunnable.java:88) ~[opensearch-2.6.0.jar:2.6.0]", "at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:806) [opensearch-2.6.0.jar:2.6.0]", "at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) [opensearch-2.6.0.jar:2.6.0]", "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]", "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]", "at java.lang.Thread.run(Thread.java:833) [?:?]", "Caused by: java.lang.Exception: org.opensearch.alerting.util.AlertingException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in mod ule java.base of loader 'bootstrap')", "... 9 more"] }
From another node I found this exception:
{"type": "server", "timestamp": "2023-03-27T14:48:18,089Z", "level": "ERROR", "component": "o.o.a.DocumentLevelMonitorRunner", "cluster.name": "logs", "node.name": "es-data-2", "[972/1943] "Failed to start Document-level-monitor Apache_access_logs. Error: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')", "cluster.uuid": "o1Ol5SK_SGWmwe0MXaMmtA", "node.id": "RRFc1RJcQeG3b9dwZ-cQKw" , "stacktrace": ["java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap' )", "at org.opensearch.alerting.util.DocLevelMonitorQueries.traverseMappingsAndUpdate(DocLevelMonitorQueries.kt:172) ~[opensearch-alerting-2.6.0.0.jar:2.6.0.0]", "at org.opensearch.alerting.util.DocLevelMonitorQueries.traverseMappingsAndUpdate(DocLevelMonitorQueries.kt:164) ~[opensearch-alerting-2.6.0.0.jar:2.6.0.0]", "at org.opensearch.alerting.util.DocLevelMonitorQueries.indexDocLevelQueries(DocLevelMonitorQueries.kt:245) ~[opensearch-alerting-2.6.0.0.jar:2.6.0.0]", "at org.opensearch.alerting.util.DocLevelMonitorQueries.indexDocLevelQueries$default(DocLevelMonitorQueries.kt:198) ~[opensearch-alerting-2.6.0.0.jar:2.6.0.0]", "at org.opensearch.alerting.DocumentLevelMonitorRunner.runMonitor(DocumentLevelMonitorRunner.kt:116) [opensearch-alerting-2.6.0.0.jar:2.6.0.0]", "at org.opensearch.alerting.DocumentLevelMonitorRunner$runMonitor$1.invokeSuspend(DocumentLevelMonitorRunner.kt) [opensearch-alerting-2.6.0.0.jar:2.6.0.0]", "at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]", "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:?]"] } {"type": "server", "timestamp": "2023-03-27T14:48:18,107Z", "level": "ERROR", "component": "o.o.a.u.AlertingException", "cluster.name": "logs", "node.name": "es-data-2", "message": "Alerti ng error: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')", "c luster.uuid": "o1Ol5SK_SGWmwe0MXaMmtA", "node.id": "RRFc1RJcQeG3b9dwZ-cQKw" }
Running 2.6.0, this cluster has been upgraded from elastic to ODFE to Opensearch over the years.
Any help resolving this would be appreciated!