{"record":{"id":"c3a27a6a869cc853","repo":"quarkusio/quarkus","slug":"invalid-expression-on","errorCode":null,"errorMessage":"Invalid () expression on: ","messagePattern":"Invalid \\(\\) expression on: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/scheduler/common/src/main/java/io/quarkus/scheduler/common/runtime/util/SchedulerUtils.java","lineNumber":189,"sourceCode":"            return false;\n        }\n        int exprStart = val.indexOf(\"${\");\n        int exprEnd = -1;\n        if (exprStart >= 0) {\n            exprEnd = val.indexOf('}', exprStart + 2);\n        }\n        return exprEnd > 0;\n    }\n\n    private static long parseDurationAsMillis(Scheduled scheduled, String value, String memberName) {\n        return Math.abs(parseDuration(scheduled, value, memberName).toMillis());\n    }\n\n    private static Duration parseDuration(Scheduled scheduled, String value, String memberName) {\n        try {\n            return DurationConverter.parseDuration(value);\n        } catch (Exception e) {\n            throw new IllegalStateException(\"Invalid \" + memberName + \"() expression on: \" + scheduled, e);\n        }\n    }\n}\n","sourceCodeStart":171,"sourceCodeEnd":193,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/scheduler/common/src/main/java/io/quarkus/scheduler/common/runtime/util/SchedulerUtils.java#L171-L193","documentation":"A @Scheduled member (cron, every, delayed, or overdue grace period) given as a value or config expression could not be parsed into a Duration/Schedule by DurationConverter. The member name is embedded in the message and the original parse exception is chained as the cause.","triggerScenarios":"Calling SchedulerUtils.parseOverdueGracePeriod or parseDurationAsMillis with an @Scheduled whose member value is not a valid duration (e.g. \"10\", \"ten seconds\", an unexpanded/bad expression).","commonSituations":"Writing every=\"10\" without a time unit (\"10s\"); misspelled unit (\"5min\" vs \"5m\"); config expression resolving to empty or malformed string; negative or nonsense durations.","solutions":["Use a valid duration string with unit, e.g. \"10s\", \"5m\", \"1h\" or ISO-8601 like \"PT10S\"","Fix the config value the expression resolves to","Check the chained cause exception for the exact parse failure","For cron use a valid cron expression via @Scheduled(cron=...) instead of duration syntax"],"exampleFix":"// before\n@Scheduled(every = \"10\")\n// after\n@Scheduled(every = \"10s\")","handlingStrategy":"validation","validationCode":"try {\n    java.time.Duration.parse(\"10s\".matches(\".*[a-zA-Z].*\") ? \"PT\" + \"10s\".toUpperCase() : \"PT\" + \"10s\" + \"S\");\n} catch (Exception e) { /* invalid duration */ }","typeGuard":null,"tryCatchPattern":"try { DurationConverter.parseDuration(value); }\ncatch (Exception e) { throw new IllegalArgumentException(\"Bad duration: \" + value, e); }","preventionTips":["Always include a unit: 10s, 5m, 1h, or ISO-8601 PT10S","Test schedule expressions with unit tests before deploying","Validate config-sourced durations at startup","Avoid hand-writing durations; reuse constants"],"tags":["scheduler","duration-parsing","config","quarkus"],"backgroundTag":"invalid-duration-format","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"}