-
Notifications
You must be signed in to change notification settings - Fork 130
Description
What is the bug?
RollUp Job creation fails with 500 error code in Opensearch 2.12
Error Message :
{"error":{"root_cause":[{"type":"null_pointer_exception","reason":"Cannot invoke \"java.time.Instant.plusMillis(long)\" because \"startTime\" is null"}],"type":"null_pointer_exception","reason":"Cannot invoke \"java.time.Instant.plusMillis(long)\" because \"startTime\" is null"},"status":500}
How can one reproduce the bug?
Steps to reproduce the behavior:
-
Use the below API to create a new RollUp Job - Create RollUp Job
Sample -
curl -X PUT localhost:9200/_plugins/_rollup/jobs/test -H 'Content-Type:application/json' -d '{"rollup":{"target_index":"rollup_hourly_fmstats_test","description":"Hourly Stats Rollup","source_index":"test_*","enabled":true,"schedule":{"interval":{"period":60,"unit":"Minutes"}},"delay":0,"continuous":"true","metrics":[{"source_field":"abc.accepted","metrics":[{"max":{}}]},{"source_field":"abc.rejected","metrics":[{"max":{}}]},{"source_field":"abc.matched","metrics":[{"max":{}}]}],"page_size":5000,"dimensions":[{"date_histogram":{"fixed_interval":"60m","source_field":"timestamp"}},{"terms":{"source_field":"name"}}]}}' -
RollUp Job creation is fails with error (500)
What is the expected behavior?
RollUp Job to be created and data to be rolled up
What is your host/environment?
- OS: Ubuntu
- Version 22
- Plugins - index-state-management (ISM)
Do you have any screenshots?
NA
Do you have any additional context?
I was debugging the code and noticed that we have not initialised Schedule
Modifying the code to Instant.now() instead of schedule.startTime fixed the issue
Update - This doesn't affect the existing RolUp Jobs. Any job created using earlier version (2.10) seems to be working as the time is initialised
