apache/dolphinscheduler · error · SchedulerException
QUARTZ_UPSERT_JOB_ERROR
QUARTZ_UPSERT_JOB_ERROR
Error message
QUARTZ_UPSERT_JOB_ERROR
What it means
Quartz rejected scheduleJob while creating or replacing the job/trigger for a workflow schedule — common causes are an invalid cron expression the Quartz parser refuses, a JobDataMap losing serializability, or a store concurrency conflict. The failed upsert leaves the old Quartz job in place, so the in-DB schedule state and Quartz state may diverge.
Source
Thrown at dolphinscheduler-scheduler-plugin/dolphinscheduler-scheduler-quartz/src/main/java/org/apache/dolphinscheduler/scheduler/quartz/QuartzScheduler.java:67
}
}
@Override
public void insertOrUpdateScheduleTask(int projectId, Schedule schedule) throws SchedulerException {
try {
CronTrigger cornTrigger = QuartzCornTriggerBuilder.newBuilder()
.withProjectId(projectId)
.withSchedule(schedule)
.build();
JobDetail jobDetail = QuartzJobDetailBuilder.newBuilder()
.withProjectId(projectId)
.withSchedule(schedule.getId())
.build();
scheduler.scheduleJob(jobDetail, Sets.newHashSet(cornTrigger), true);
log.info("Success scheduleJob: {} with trigger: {} at quartz", jobDetail, cornTrigger);
} catch (Exception e) {
log.error("Failed to add scheduler task, projectId: {}, scheduler: {}", projectId, schedule, e);
throw new SchedulerException(QuartzSchedulerExceptionEnum.QUARTZ_UPSERT_JOB_ERROR, e);
}
}
@Override
public void deleteScheduleTask(int projectId, int scheduleId) throws SchedulerException {
JobKey jobKey = QuartzJobKey.of(projectId, scheduleId).toJobKey();
try {
if (scheduler.checkExists(jobKey)) {
log.info("Try to delete scheduler task, projectId: {}, schedulerId: {}", projectId, scheduleId);
scheduler.deleteJob(jobKey);
}
} catch (Exception e) {
log.error("Failed to delete scheduler task, projectId: {}, schedulerId: {}", projectId, scheduleId, e);
throw new SchedulerException(QuartzSchedulerExceptionEnum.QUARTZ_DELETE_JOB_ERROR, e);
}
}
@OverrideView on GitHub (pinned to 02eac45a1b)
Solutions
- Validate the cron expression with CronUtils before the schedule reaches Quartz
- Confirm the Quartz tables and datasource are healthy and not locked by another node
- Check that the schedule record (projectId/scheduleId) is not concurrently modified by another master; retry the insertOrUpdate
- Inspect the caused-by SchedulerException for the exact Quartz objection (DuplicateKey, class-not-found, serialization)
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at dolphinscheduler-scheduler-plugin/dolphinscheduler-scheduler-quartz/src/main/java/org/apache/dolphinscheduler/scheduler/quartz/QuartzScheduler.java:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/98e59443f2a9a94c.
Report an issue: GitHub.