{"record":{"id":"1007bdc49ec6409f","repo":"quarkusio/quarkus","slug":"unsupported-cron-type","errorCode":null,"errorMessage":"Unsupported cron type: ","messagePattern":"Unsupported cron type: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/scheduler/common/src/main/java/io/quarkus/scheduler/common/runtime/CronParser.java","lineNumber":56,"sourceCode":"\n    public Cron mapToQuartz(Cron cron) {\n        switch (cronType) {\n            case QUARTZ:\n                return cron;\n            case UNIX:\n                return CronMapper.fromUnixToQuartz().map(cron);\n            case CRON4J:\n                return CronMapper.fromCron4jToQuartz().map(cron);\n            case SPRING:\n                return CronMapper.fromSpringToQuartz().map(cron);\n            case SPRING53:\n                // https://github.com/jmrozanec/cron-utils/issues/579\n                return new CronMapper(\n                        CronDefinitionBuilder.instanceDefinitionFor(CronType.SPRING53),\n                        CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ),\n                        setQuestionMark()).map(cron);\n            default:\n                throw new IllegalStateException(\"Unsupported cron type: \" + cronType);\n        }\n    }\n\n    // Copy from com.cronutils.mapper.CronMapper#setQuestionMark()\n    private static Function<Cron, Cron> setQuestionMark() {\n        return cron -> {\n            final CronField dow = cron.retrieve(CronFieldName.DAY_OF_WEEK);\n            final CronField dom = cron.retrieve(CronFieldName.DAY_OF_MONTH);\n            if (dow == null && dom == null) {\n                return cron;\n            }\n            if (dow.getExpression() instanceof QuestionMark || dom.getExpression() instanceof QuestionMark) {\n                return cron;\n            }\n            final Map<CronFieldName, CronField> fields = new EnumMap<>(CronFieldName.class);\n            fields.putAll(cron.retrieveFieldsAsMap());\n            if (dow.getExpression() instanceof Always) {\n                fields.put(CronFieldName.DAY_OF_WEEK,","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/scheduler/common/src/main/java/io/quarkus/scheduler/common/runtime/CronParser.java#L38-L74","documentation":"CronParser.mapToQuartz() translates cron expressions from various cron dialects (identified by CronType) into Quartz format using cron-utils. When the given CronType has no mapping branch in the switch, this IllegalStateException is thrown with the unsupported type appended. It indicates an internal/unknown cron dialect rather than a bad user expression.","triggerScenarios":"Calling CronParser.mapToQuartz(cronType, cron) with a CronType not handled by the switch (only specific types like SPRING, SPRING53, UNIX, CRON4J etc. are mapped); passing null; library upgrade introducing a new CronType not yet mapped.","commonSituations":"Custom scheduler configs referencing a cron dialect the Quarkus mapping doesn't support; passing a parsed Cron object's type that differs from the supported set; cron-utils version change adding new enum values.","solutions":["Use a cron expression in a supported dialect (Quartz or one of the mapped types) in @Scheduled/scheduler config","Check the CronParser switch and add a mapping branch if you control the code and need a new CronType","Normalize the expression to Quartz format before calling the parser","Verify the cron-utils dependency version matches what Quarkus expects"],"exampleFix":"// before\nCronParser.mapToQuartz(CronType.CRON4J_UNKNOWN, expr); // unsupported\n// after\nCronParser.mapToQuartz(CronType.UNIX, \"0 12 * * *\") or use Quartz syntax directly","handlingStrategy":"try-catch","validationCode":"// restrict config to supported dialects\nif (!Set.of(\"QUARTZ\",\"UNIX\",\"SPRING\",\"SPRING53\",\"CRON4J\").contains(dialect)) {\n    throw new IllegalArgumentException(\"unsupported cron dialect: \" + dialect);\n}","typeGuard":null,"tryCatchPattern":"try {\n    cron = CronParser.mapToQuartz(cronType, expression);\n} catch (IllegalStateException e) {\n    LOG.error(\"Unsupported cron type {} - use a mapped dialect\", cronType, e);\n    throw new ConfigurationException(\"Unsupported cron dialect\", e);\n}","preventionTips":["Author cron expressions directly in Quartz syntax for @Scheduled/scheduler config","Verify the configured CronType against CronParser's supported switch cases","Pin the cron-utils version bundled by Quarkus","Add unit tests covering every dialect your app configures"],"tags":["scheduler","cron","unsupported-value","parsing"],"backgroundTag":"unsupported-enum-value","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"}