{"record":{"id":"9e5acdb73af20579","repo":"apache/dolphinscheduler","slug":"parse-corn-expression-s-error","errorCode":null,"errorMessage":"Parse corn expression: [%s] error","messagePattern":"Parse corn expression: \\[(.+?)\\] error","errorType":"exception","errorClass":"CronParseException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/cron/CronUtils.java","lineNumber":77,"sourceCode":"\n    private CronUtils() {\n        throw new IllegalStateException(\"CronUtils class\");\n    }\n\n    private static final CronParser QUARTZ_CRON_PARSER =\n            new CronParser(CronDefinitionBuilder.instanceDefinitionFor(QUARTZ));\n\n    /**\n     * parse to cron\n     *\n     * @param cronExpression cron expression, never null\n     * @return Cron instance, corresponding to cron expression received\n     */\n    public static Cron parse2Cron(String cronExpression) throws CronParseException {\n        try {\n            return QUARTZ_CRON_PARSER.parse(cronExpression);\n        } catch (IllegalArgumentException ex) {\n            throw new CronParseException(String.format(\"Parse corn expression: [%s] error\", cronExpression), ex);\n        }\n    }\n\n    /**\n     * Indicates whether the specified cron expression can be parsed into a\n     * valid cron expression\n     *\n     * @param cronExpression the expression to evaluate\n     * @return a boolean indicating whether the given expression is a valid cron\n     *         expression\n     */\n    public static boolean isValidExpression(String cronExpression) {\n        try {\n            parse2Cron(cronExpression);\n        } catch (CronParseException e) {\n            return false;\n        }\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/cron/CronUtils.java#L59-L95","documentation":"The Quartz-flavoured cron expression could not be parsed by the cron-parser library — the expression violates Quartz cron syntax (wrong field count, out-of-range values, illegal characters like 'L'/'W' in unsupported positions, or an empty/null string). IllegalArgumentException from the parser is caught and rethrown as CronParseException with a formatted message naming the offending expression.","triggerScenarios":"Thrown at dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/cron/CronUtils.java:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the expression to Quartz 6/7-field syntax (second minute hour day-of-month month day-of-week [year])","Validate via CronUtils.isValidExpression before saving the schedule so the UI rejects it early","Ensure day-of-month and day-of-week are not both restricted (Quartz requires one to be '?')","Check parameter placeholder substitution did not leave ${...} tokens in the cron string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}