Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Comma separated cron time ranges causes fatal error in ES #71

Closed
adityaj1107 opened this issue Jun 2, 2021 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@adityaj1107
Copy link
Contributor

Issue by thenom
Thursday Aug 27, 2020 at 10:28 GMT
Originally opened as opendistro-for-elasticsearch/alerting#245


Describe the bug
Comma separated cron time ranges causes fatal error in ES

Other plugins installed
Stock OpenDistro 1.8.0

To Reproduce

POST _opendistro/_alerting/monitors
{
  "type": "monitor",
  "name": "Testing",
  "enabled": false,
  "schedule": {
    "cron": {
      "expression": "0/10 00-06,20-23 * * *",
      "timezone": "Europe/London"
    }
  },
  "inputs": [
    {
      "search": {
        "indices": [
          "test*"
        ],
        "query": {
          "size": 1,
          "query": {
            "bool": {
              "must": [
                {
                  "range": {
                    "@timestamp": {
                      "from": "now-10m"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  ],
  "triggers": [
    {
      "name": "trigger",
      "severity": "1",
      "condition": {
        "script": {
          "source": "return ctx.results.0.hits.total.value > 0",
          "lang": "painless"
        }
      },
      "actions": [
        {
          "name": "action",
          "destination_id": "vceQTXMB-AAC6rUPLBiV",
          "message_template": {
            "source": "Returned more than 1 result",
            "lang": "mustache"
          },
          "throttle_enabled": false,
          "subject_template": {
            "source": "Open Distro Alerting",
            "lang": "mustache"
          }
        }
      ]
    }
  ]
}

Note the 00-06,20-23 for the hour in the cron expression:
https://opendistro.github.io/for-elasticsearch-docs/docs/alerting/cron/

Expected behavior
Create a monitor that runs between 0am to 6am and 8pm to 11pm.

Error generated

[2020-08-27T10:06:07,772][ERROR][o.e.ExceptionsHelper     ] [single-instance_0] fatal error
	at org.elasticsearch.ExceptionsHelper.lambda$maybeDieOnAnotherThread$4(ExceptionsHelper.java:294)
	at java.base/java.util.Optional.ifPresent(Optional.java:176)
	at org.elasticsearch.ExceptionsHelper.maybeDieOnAnotherThread(ExceptionsHelper.java:284)
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.exceptionCaught(Netty4HttpRequestHandler.java:66)
	at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:300)
	at io.netty.channel.AbstractChannelHandlerContext.notifyHandlerException(AbstractChannelHandlerContext.java:825)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:58)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:615)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:578)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.base/java.lang.Thread.run(Thread.java:832)
[2020-08-27T10:06:07,774][WARN ][o.e.h.AbstractHttpServerTransport] [single-instance_0] caught exception while handling client http traffic, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:38512}
java.lang.Exception: java.lang.ExceptionInInitializerError
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.exceptionCaught(Netty4HttpRequestHandler.java:69) [transport-netty4-client-7.7.0.jar:7.7.0]
	at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:300) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.notifyHandlerException(AbstractChannelHandlerContext.java:825) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:58) [transport-netty4-client-7.7.0.jar:7.7.0]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [netty-codec-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321) [netty-codec-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295) [netty-codec-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [netty-handler-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:615) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:578) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [netty-transport-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-common-4.1.45.Final.jar:4.1.45.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.45.Final.jar:4.1.45.Final]
	at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.ExceptionInInitializerError
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:149) ~[?:?]
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120) ~[?:?]
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331) ~[?:?]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) ~[?:?]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304) ~[?:?]
	at com.cronutils.model.time.generator.AndFieldValueGenerator.<clinit>(AndFieldValueGenerator.java:33) ~[?:?]
	at com.cronutils.model.time.generator.FieldValueGeneratorFactory.forCronField(FieldValueGeneratorFactory.java:36) ~[?:?]
	at com.cronutils.model.time.ExecutionTimeBuilder.forHoursMatching(ExecutionTimeBuilder.java:63) ~[?:?]
	at com.cronutils.model.time.ExecutionTime.forCron(ExecutionTime.java:53) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.CronSchedule.<init>(Schedule.kt:156) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.CronSchedule.<init>(Schedule.kt:153) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.Schedule$Companion.parse(Schedule.kt:93) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.model.Monitor$Companion.parse(Monitor.kt:146) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.model.Monitor$Companion.parse$default(Monitor.kt:126) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexMonitorAction.prepareRequest(RestIndexMonitorAction.kt:122) ~[?:?]
	at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:94) ~[elasticsearch-7.7.0.jar:7.7.0]
	at com.amazon.opendistroforelasticsearch.security.filter.OpenDistroSecurityRestFilter$1.handleRequest(OpenDistroSecurityRestFilter.java:94) ~[?:?]
	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:236) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:318) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:176) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:329) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:383) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:308) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:54) ~[?:?]
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:29) ~[?:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	... 40 more
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createSecurityManager")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:?]
	at java.security.AccessController.checkPermission(AccessController.java:1036) ~[?:?]
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:408) ~[?:?]
	at java.lang.SecurityManager.<init>(SecurityManager.java:347) ~[?:?]
	at org.slf4j.helpers.Util$ClassContextSecurityManager.<init>(Util.java:43) ~[?:?]
	at org.slf4j.helpers.Util$ClassContextSecurityManager.<init>(Util.java:43) ~[?:?]
	at org.slf4j.helpers.Util.<clinit>(Util.java:49) ~[?:?]
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:149) ~[?:?]
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120) ~[?:?]
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331) ~[?:?]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) ~[?:?]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304) ~[?:?]
	at com.cronutils.model.time.generator.AndFieldValueGenerator.<clinit>(AndFieldValueGenerator.java:33) ~[?:?]
	at com.cronutils.model.time.generator.FieldValueGeneratorFactory.forCronField(FieldValueGeneratorFactory.java:36) ~[?:?]
	at com.cronutils.model.time.ExecutionTimeBuilder.forHoursMatching(ExecutionTimeBuilder.java:63) ~[?:?]
	at com.cronutils.model.time.ExecutionTime.forCron(ExecutionTime.java:53) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.CronSchedule.<init>(Schedule.kt:156) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.CronSchedule.<init>(Schedule.kt:153) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.Schedule$Companion.parse(Schedule.kt:93) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.model.Monitor$Companion.parse(Monitor.kt:146) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.model.Monitor$Companion.parse$default(Monitor.kt:126) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexMonitorAction.prepareRequest(RestIndexMonitorAction.kt:122) ~[?:?]
	at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:94) ~[elasticsearch-7.7.0.jar:7.7.0]
	at com.amazon.opendistroforelasticsearch.security.filter.OpenDistroSecurityRestFilter$1.handleRequest(OpenDistroSecurityRestFilter.java:94) ~[?:?]
	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:236) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:318) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:176) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:329) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:383) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:308) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:54) ~[?:?]
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:29) ~[?:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	... 40 more
[2020-08-27T10:06:07,773][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [single-instance_0] fatal error in thread [Thread-19], exiting
java.lang.ExceptionInInitializerError: null
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:149) ~[?:?]
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120) ~[?:?]
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331) ~[?:?]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) ~[?:?]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304) ~[?:?]
	at com.cronutils.model.time.generator.AndFieldValueGenerator.<clinit>(AndFieldValueGenerator.java:33) ~[?:?]
	at com.cronutils.model.time.generator.FieldValueGeneratorFactory.forCronField(FieldValueGeneratorFactory.java:36) ~[?:?]
	at com.cronutils.model.time.ExecutionTimeBuilder.forHoursMatching(ExecutionTimeBuilder.java:63) ~[?:?]
	at com.cronutils.model.time.ExecutionTime.forCron(ExecutionTime.java:53) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.CronSchedule.<init>(Schedule.kt:156) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.CronSchedule.<init>(Schedule.kt:153) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.core.model.Schedule$Companion.parse(Schedule.kt:93) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.model.Monitor$Companion.parse(Monitor.kt:146) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.model.Monitor$Companion.parse$default(Monitor.kt:126) ~[?:?]
	at com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexMonitorAction.prepareRequest(RestIndexMonitorAction.kt:122) ~[?:?]
	at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:94) ~[elasticsearch-7.7.0.jar:7.7.0]
	at com.amazon.opendistroforelasticsearch.security.filter.OpenDistroSecurityRestFilter$1.handleRequest(OpenDistroSecurityRestFilter.java:94) ~[?:?]
	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:236) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:318) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:176) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:329) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:383) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:308) ~[elasticsearch-7.7.0.jar:7.7.0]
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:54) ~[?:?]
	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:29) ~[?:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:58) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[?:?]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[?:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[?:?]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:615) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:578) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createSecurityManager")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:?]
	at java.security.AccessController.checkPermission(AccessController.java:1036) ~[?:?]
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:408) ~[?:?]
	at java.lang.SecurityManager.<init>(SecurityManager.java:347) ~[?:?]
	at org.slf4j.helpers.Util$ClassContextSecurityManager.<init>(Util.java:43) ~[?:?]
	at org.slf4j.helpers.Util$ClassContextSecurityManager.<init>(Util.java:43) ~[?:?]
	at org.slf4j.helpers.Util.<clinit>(Util.java:49) ~[?:?]
	... 67 more
@adityaj1107 adityaj1107 added the bug Something isn't working label Jun 2, 2021
@adityaj1107
Copy link
Contributor Author

Comment by thenom
Thursday Aug 27, 2020 at 11:07 GMT


This also seems to happen with:

"expression": "0/10 0,1 * * *",

With the above monitor but not with:

"expression": "0/10 0 * * *",

@adityaj1107
Copy link
Contributor Author

Comment by Angrboda2
Wednesday Sep 30, 2020 at 14:54 GMT


Confirmed, our entire production system was taken down when I tried an expression like this:
0 0,6-23 * * *

Further experimentation showed expressions without commas worked fine.

@adityaj1107
Copy link
Contributor Author

Comment by gmfmi-znk
Thursday May 20, 2021 at 15:57 GMT


I get exactly the same issue using this CRON expression : 5,10,15,20,25 * * 5 *.
Tested against the v1.12.0 on Docker.

@qreshi
Copy link
Contributor

qreshi commented Oct 28, 2021

Hmm, I suspected this might have been related to this issue but it looks like that was fixed in cron-utils version 5.0.5 and we were using 7.0.5 in the older versions of Alerting.

We did, however, upgrade to version 9.1.3 in ODFE 1.13.0.0. Is anyone still seeing this issue in v1.13.0.0?

@praveensameneni
Copy link
Member

Closing with reference to - opendistro-for-elasticsearch/alerting#245

@qreshi
Copy link
Contributor

qreshi commented Feb 28, 2022

Issue opendistro-for-elasticsearch/alerting#245 was closed in favor of this one as it was migrated to OpenSearch Alerting. This issue should still remain open for tracking.

@qreshi qreshi reopened this Feb 28, 2022
@qreshi
Copy link
Contributor

qreshi commented Jun 24, 2022

It appears that the cron version upgrade has resolved this issue as it is no longer occurring in our newer versions. Closing.

@qreshi qreshi closed this as completed Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants