apache/dolphinscheduler · error · ServiceException
10024
10024
Error message
scheduler crontab expression validation failure: {0} What it means
updateSchedule validates the crontab in the scheduleExpression with CronUtils.isValidExpression; on failure SCHEDULE_CRON_CHECK_FAILED is thrown including the offending crontab. Unlike error 250 this is a boolean validity check (no exception-based parsing), but the cause is the same: the crontab is not a valid Quartz expression.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java:567
ScheduleParam scheduleParam = JSONUtils.parseObject(scheduleExpression, ScheduleParam.class);
if (scheduleParam == null) {
log.warn("Parameter scheduleExpression is invalid, so parse cron error.");
throw new ServiceException(Status.PARSE_TO_CRON_EXPRESSION_ERROR);
}
if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) {
log.warn("The start time must not be the same as the end or time can not be null.");
throw new ServiceException(Status.SCHEDULE_START_TIME_END_TIME_SAME);
}
if (scheduleParam.getStartTime().getTime() > scheduleParam.getEndTime().getTime()) {
log.warn("The start time must smaller than end time");
throw new ServiceException(Status.START_TIME_BIGGER_THAN_END_TIME_ERROR);
}
schedule.setStartTime(scheduleParam.getStartTime());
schedule.setEndTime(scheduleParam.getEndTime());
if (!CronUtils.isValidExpression(scheduleParam.getCrontab())) {
log.error("Schedule crontab verify failure, crontab:{}.", scheduleParam.getCrontab());
throw new ServiceException(Status.SCHEDULE_CRON_CHECK_FAILED, scheduleParam.getCrontab());
}
schedule.setCrontab(scheduleParam.getCrontab());
validateMissedFirePolicy(scheduleParam);
if (scheduleParam.isMissedFirePolicySet() && scheduleParam.getMissedFirePolicy() != null) {
schedule.setMissedFirePolicy(scheduleParam.getMissedFirePolicy());
}
schedule.setTimezoneId(scheduleParam.getTimezoneId());
}
if (warningType != null) {
schedule.setWarningType(warningType);
}
schedule.setWarningGroupId(warningGroupId);
if (failureStrategy != null) {
schedule.setFailureStrategy(failureStrategy);
}View on GitHub (pinned to 02eac45a1b)
Solutions
- Correct the crontab to valid Quartz format, e.g. '0 0 12 * * ?'.
- Run CronUtils.isValidExpression(crontab) (or an online Quartz cron validator) before submitting.
- Use '?' in either dayOfMonth or dayOfWeek when the other is constrained.
- Migrate Unix cron syntax to Quartz (add seconds field, convert as needed).
Example fix
// before
{"startTime":1700000000000,"endTime":1730000000000,"crontab":"0 12 * *"} // invalid
// after
{"startTime":1700000000000,"endTime":1730000000000,"crontab":"0 0 12 * * ?"} Defensive patterns
Strategy: validation
Validate before calling
if (!CronUtils.isValidExpression(scheduleParam.getCrontab())) {
throw new IllegalArgumentException("Invalid Quartz crontab: " + scheduleParam.getCrontab());
} Try / catch
try {
schedulerService.updateSchedule(loginUser, projectCode, id, scheduleExpression, ...);
} catch (ServiceException e) {
if (e.getCode() == Status.SCHEDULE_CRON_CHECK_FAILED.getCode()) {
// e.getMessage() contains the offending crontab; fix and resubmit
}
} Prevention
- Pre-validate crontab with CronUtils.isValidExpression
- Use Quartz cron syntax (6-7 fields, seconds first)
- Convert Unix 5-field crons before submitting
- Use '?' not '*' when constraining dayOfMonth/dayOfWeek separately
When it happens
Trigger: Updating a schedule with a crontab that fails CronUtils.isValidExpression: wrong field count, illegal characters, out-of-range day/month values, or unsupported syntax.
Common situations: 5-field Unix cron pasted into the API; '?' vs '*' misuse; day-of-month + day-of-week both set to '*' conflicting semantics users expect; empty crontab string.
Related errors
- PARSE_TO_CRON_EXPRESSION_ERROR
- REQUEST_PARAMS_NOT_VALID_ERROR
- SCHEDULE_START_TIME_END_TIME_SAME
- START_TIME_BIGGER_THAN_END_TIME_ERROR
- 10141
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/a09cb3afedb1bd5c.
Report an issue: GitHub.