You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUG] Cron expression with list (comma) value causes fatal error Opensearch thread due to NoClassDefFoundError when creating snapshot management policy
#519
Closed
tomchlee opened this issue
Sep 13, 2022
· 2 comments
Describe the bug
When creating snapshot management policy, I'm able to specify wildcard, range and step values in cron expression. However, when I specify cron expression with list (comma) value, it causes fatal error in Opensearch due to NoClassDefFoundError:
[2022-09-13T17:33:13,207][ERROR][o.o.b.OpenSearchUncaughtExceptionHandler] [node-1] fatal error in thread [Thread-3], exiting
java.lang.NoClassDefFoundError: org/opensearch/jobscheduler/repackage/org/slf4j/LoggerFactory
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.generator.AndFieldValueGenerator.<clinit>(AndFieldValueGenerator.java:27) ~[?:?]
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.generator.FieldValueGeneratorFactory.forCronField(FieldValueGeneratorFactory.java:31) ~[?:?]
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.ExecutionTimeBuilder.forMinutesMatching(ExecutionTimeBuilder.java:57) ~[?:?]
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.ExecutionTime.forCron(ExecutionTime.java:50) ~[?:?]
at org.opensearch.jobscheduler.spi.schedule.CronSchedule.<init>(CronSchedule.java:48) ~[?:?]
at org.opensearch.jobscheduler.spi.schedule.ScheduleParser.parse(ScheduleParser.java:50) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy$Creation$Companion.parse(SMPolicy.kt:271) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy$Companion.parse(SMPolicy.kt:151) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.api.resthandler.RestBaseIndexSMPolicyHandler.prepareIndexRequest(RestBaseIndexSMPolicyHandler.kt:38) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.api.resthandler.RestCreateSMPolicyHandler.prepareRequest(RestCreateSMPolicyHandler.kt:25) ~[?:?]
...
and another similar stacktrace:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.opensearch.jobscheduler.repackage.com.cronutils.model.time.generator.AndFieldValueGenerator
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.generator.FieldValueGeneratorFactory.forCronField(FieldValueGeneratorFactory.java:31) ~[?:?]
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.ExecutionTimeBuilder.forMinutesMatching(ExecutionTimeBuilder.java:57) ~[?:?]
at org.opensearch.jobscheduler.repackage.com.cronutils.model.time.ExecutionTime.forCron(ExecutionTime.java:50) ~[?:?]
at org.opensearch.jobscheduler.spi.schedule.CronSchedule.<init>(CronSchedule.java:48) ~[?:?]
at org.opensearch.jobscheduler.spi.schedule.ScheduleParser.parse(ScheduleParser.java:50) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy$Creation$Companion.parse(SMPolicy.kt:271) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy$Companion.parse(SMPolicy.kt:151) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.api.resthandler.RestBaseIndexSMPolicyHandler.prepareIndexRequest(RestBaseIndexSMPolicyHandler.kt:38) ~[?:?]
at org.opensearch.indexmanagement.snapshotmanagement.api.resthandler.RestCreateSMPolicyHandler.prepareRequest(RestCreateSMPolicyHandler.kt:25) ~[?:?]
...
To Reproduce
Steps to reproduce the behavior:
Try to create SM policy via SM api with list value in cron expression, e.g., "0,30 * * * *"
Opensearch process is killed and SM policy failed to be created
Expected behavior
SM policy is created successfully
Plugins
Index Management
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
OS: Linux
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
To fix this on your side immediately, please refer to the change in the above PR, build the job scheduler zip manually (./gradlew assemble), and re-install (uninstall & install) the job scheduler plugin to your cluster (install plugin doc)
Describe the bug
When creating snapshot management policy, I'm able to specify wildcard, range and step values in cron expression. However, when I specify cron expression with list (comma) value, it causes fatal error in Opensearch due to NoClassDefFoundError:
and another similar stacktrace:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
SM policy is created successfully
Plugins
Index Management
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: