{"record":{"id":"fe805d2775c2b16b","repo":"quarkusio/quarkus","slug":"unable-to-create-scheduler","errorCode":null,"errorMessage":"Unable to create Scheduler","messagePattern":"Unable to create Scheduler","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java","lineNumber":315,"sourceCode":"                                throw new IllegalStateException(\"Unable to obtain the trigger for \" + triggerKey);\n                            }\n                            createJobDefinitionQuartzTrigger(new SerializedExecutionMetadata(jobDetail), scheduled, oldTrigger);\n                        }\n                    }\n                }\n\n                if (transaction != null) {\n                    transaction.commit();\n                }\n            } catch (Throwable e) {\n                if (transaction != null) {\n                    try {\n                        transaction.rollback();\n                    } catch (SystemException ex) {\n                        LOGGER.error(\"Unable to rollback transaction\", ex);\n                    }\n                }\n                throw new IllegalStateException(\"Unable to create Scheduler\", e);\n            }\n        }\n    }\n\n    @Produces\n    @Singleton\n    org.quartz.Scheduler produceQuartzScheduler() {\n        if (scheduler == null) {\n            throw new IllegalStateException(\n                    \"Quartz scheduler is either explicitly disabled through quarkus.scheduler.enabled=false or no @Scheduled methods were found. If you only need to schedule a job programmatically you can force the start of the scheduler by setting 'quarkus.scheduler.start-mode=forced'.\");\n        }\n        return scheduler;\n    }\n\n    @Override\n    public org.quartz.Scheduler getScheduler() {\n        return scheduler;\n    }","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java#L297-L333","documentation":"QuartzSchedulerImpl creates the org.quartz.Scheduler during construction; any SchedulerException (or other failure) from the StdSchedulerFactory/transaction path is wrapped in IllegalStateException('Unable to create Scheduler'). The original cause is chained, and on transactional stores a rollback is attempted and logged first.","triggerScenarios":"StdSchedulerFactory fails to build the scheduler — bad Quartz properties (e.g. invalid instance id, delegate class missing), JDBC store misconfiguration, DB unreachable, table schema mismatch, classloading failure of configured store/driver classes.","commonSituations":"JDBC store with wrong DB credentials/URL; Quartz tables missing (never ran the DDL) or from an incompatible Quartz version; duplicate scheduler names with clustered mode misconfig; driver class not on classpath.","solutions":["Read the chained cause in the stack trace to identify the underlying SchedulerException.","For jdbc-store, run the Quartz schema DDL for your DB version and verify connectivity/credentials.","Check Quartz driver delegate class matches your DB (quarkus.quartz.driver-delegate or auto-detection).","Review quarkus.quartz.* properties (instance-id, cluster-checkin-interval, store-type) for invalid combinations."],"exampleFix":"# before: jdbc-store without tables\nquarkus.quartz.store-type=jdbc-store\n\n# after: tables created first (example for Postgres)\n# psql -f postgres-script/tables_postgres.sql\nquarkus.quartz.store-type=jdbc-store\nquarkus.quartz.clustered=true","handlingStrategy":"try-catch","validationCode":"// pre-flight: with jdbc-store, verify DB reachability and table existence before startup\ntry (var c = java.sql.DriverManager.getConnection(url, user, pass);\n     var rs = c.getMetaData().getTables(null, null, \"QRTZ_TRIGGERS\", null)) {\n    if (!rs.next()) throw new IllegalStateException(\"Quartz tables missing — run the schema DDL\");\n} catch (java.sql.SQLException e) {\n    throw new IllegalStateException(\"Quartz DB unreachable: \" + e.getMessage(), e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    scheduler = container.instance(org.quartz.Scheduler.class).get();\n} catch (IllegalStateException e) {\n    if (\"Unable to create Scheduler\".equals(e.getMessage())) {\n        // inspect e.getCause() (SchedulerException) for the root: DB, delegate, properties\n        log.error(\"Scheduler init failed\", e.getCause());\n    }\n    throw e;\n}","preventionTips":["Always read the chained cause — the wrapped SchedulerException names the real problem.","Run the Quartz schema DDL matching your Quartz version before using jdbc-store.","Validate quarkus.quartz.* properties in CI with a startup smoke test."],"tags":["quarkus","quartz","startup","scheduler-creation","jdbc-store"],"backgroundTag":"scheduler-initialization-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}