quarkusio/quarkus · error · IllegalStateException
SchedulerException while getting trigger (no message)
Error message
SchedulerException while getting trigger (no message)
What it means
While reconciling an annotated @Scheduled job, the wrapper fetches the current Quartz trigger; any SchedulerException raised by the underlying scheduler (JDBC store down, corrupted trigger, schema issues) is wrapped in an IllegalStateException with no custom message, so the original SchedulerException is the cause to inspect.
Source
Thrown at extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java:1042
// Job is disabled
return null;
}
JobInstrumenter instrumenter = null;
if (schedulerConfig.tracingEnabled() && jobInstrumenter.isResolvable()) {
instrumenter = jobInstrumenter.get();
}
invoker = initInvoker(invoker, events, scheduled.concurrentExecution(), skipPredicate, instrumenter,
vertx, task != null && runtimeConfig.runBlockingScheduledMethodOnQuartzThread(),
SchedulerUtils.parseExecutionMaxDelayAsMillis(scheduled), blockingExecutor);
QuartzTrigger quartzTrigger = new QuartzTrigger(trigger.getKey(),
new Function<>() {
@Override
public org.quartz.Trigger apply(TriggerKey triggerKey) {
try {
return scheduler.getTrigger(triggerKey);
} catch (SchedulerException e) {
throw new IllegalStateException(e);
}
}
}, invoker,
SchedulerUtils.parseOverdueGracePeriod(scheduled, defaultOverdueGracePeriod),
runtimeConfig.runBlockingScheduledMethodOnQuartzThread(), true, null, description);
QuartzTrigger existing = scheduledTasks.putIfAbsent(scheduled.identity(), quartzTrigger);
if (existing != null) {
throw new IllegalStateException("A job with this identity is already scheduled: " + scheduled.identity());
}
try {
if (oldTrigger != null) {
scheduler.rescheduleJob(trigger.getKey(), trigger);
LOGGER.debugf("Rescheduled job definition with config %s", scheduled);
} else {
scheduler.scheduleJob(jobDetail, trigger);
LOGGER.debugf("Scheduled job definition with config %s", scheduled);View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the caused-by SchedulerException for the real root cause
- Verify the Quartz JDBC store tables exist and match the Quartz version (run the Quartz DDL scripts)
- Test the datasource connectivity and pool health used by `quarkus.quartz.store-type=db`
- Fall back to `store-type=memory` to isolate whether the DB store is the problem
Example fix
null
Defensive patterns
Strategy: try-catch
Validate before calling
// verify store health before scheduling
try (Connection c = dataSource.getConnection()) { /* DB reachable */ } Try / catch
try { scheduler.newJob(id).schedule(); } catch (IllegalStateException e) {
Throwable root = e; while (root.getCause() != null) root = root.getCause();
if (root instanceof SchedulerException) { /* handle store outage */ }
} Prevention
- Run Quartz DDL scripts matching the bundled Quartz version
- Monitor the Quartz datasource and connection pool
- Verify trigger state in QRTZ_TRIGGERS if errors persist after a crash
When it happens
Trigger: Scheduler lookup of a TriggerKey during programmatic scheduling of a @Scheduled-defined job fails: DB store unreachable, table missing/locked, Quartz tables schema mismatch, or scheduler not started.
Common situations: Quartz JDBC tables not initialized (missing quartz tables DDL); DB connection pool exhausted; upgrading Quarkus/Quartz with an incompatible QRTZ_ schema; network outage to the configured datasource.
Related errors
- A skip predicate instance cannot be scheduled programmatical
- A task instance cannot be scheduled programmatically if DB s
- An async task instance cannot be scheduled programmatically
- Job [{identity}] that was previously scheduled programmatica
- Clustered jobs configured with unsupported job store option
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/19d203c61c8a51ca.
Report an issue: GitHub.