{"record":{"id":"0def5ecea3e33dd0","repo":"apache/seatunnel","slug":"could-not-parse-duration-value-s-supported-for","errorCode":null,"errorMessage":"Could not parse duration value '%s'. Supported formats: shorthand (e.g. 10S, 500MS) or ISO-8601 (e.g. PT10S).","messagePattern":"Could not parse duration value '(.+?)'\\. Supported formats: shorthand \\(e\\.g\\. 10S, 500MS\\) or ISO-8601 \\(e\\.g\\. PT10S\\)\\.","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java","lineNumber":203,"sourceCode":"        }\n\n        String value = o.toString().trim();\n        if (value.isEmpty()) {\n            throw new IllegalArgumentException(\"Duration value cannot be blank.\");\n        }\n\n        // Prefer shorthand format first to match connector docs, e.g. 10S / 500MS.\n        String normalized = value.replaceAll(\"\\\\s+\", \"\").toUpperCase(Locale.ROOT);\n        Duration shorthandDuration = tryParseShorthandDuration(normalized);\n        if (shorthandDuration != null) {\n            return shorthandDuration;\n        }\n\n        // Fallback to ISO-8601 duration format, e.g. PT10S.\n        try {\n            return Duration.parse(value);\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\n                    String.format(\n                            \"Could not parse duration value '%s'. Supported formats: shorthand (e.g. 10S, 500MS) or ISO-8601 (e.g. PT10S).\",\n                            value),\n                    e);\n        }\n    }\n\n    private static Duration tryParseShorthandDuration(String normalizedValue) {\n        Duration parsed = parseDurationWithSuffix(normalizedValue, \"MS\", Duration::ofMillis);\n        if (parsed != null) {\n            return parsed;\n        }\n        parsed = parseDurationWithSuffix(normalizedValue, \"S\", Duration::ofSeconds);\n        if (parsed != null) {\n            return parsed;\n        }\n        parsed = parseDurationWithSuffix(normalizedValue, \"M\", Duration::ofMinutes);\n        if (parsed != null) {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java#L185-L221","documentation":"Thrown from ConfigUtil.convertToDuration when the trimmed value is non-empty but matches neither the shorthand format (e.g. 10S, 500MS, 5M) nor ISO-8601 (e.g. PT10S): the shorthand parser returned null and the ISO-8601 parse also failed. It fires on malformed duration strings like \"ten seconds\", \"10 sec\", or a bare \"10\" with no unit, indicating the user's duration syntax is unsupported rather than blank.","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the value in shorthand form with a unit suffix, e.g. 10S, 500MS, 5M, 1H","Or use ISO-8601 form, e.g. PT10S, PT1M30S","Remember a bare number without a unit is invalid — always append a time unit"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}