{"record":{"id":"fdfaf0d82f18e736","repo":"apache/seatunnel","slug":"duration-value-cannot-be-blank","errorCode":null,"errorMessage":"Duration value cannot be blank.","messagePattern":"Duration value cannot be blank\\.","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":189,"sourceCode":"\n    static Double convertToDouble(Object o) {\n        if (o.getClass() == Double.class) {\n            return (Double) o;\n        } else if (o.getClass() == Float.class) {\n            return ((Float) o).doubleValue();\n        }\n\n        return Double.parseDouble(o.toString());\n    }\n\n    static Duration convertToDuration(Object o) {\n        if (o instanceof Duration) {\n            return (Duration) o;\n        }\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);","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java#L171-L207","documentation":"Thrown from ConfigUtil.convertToDuration when a Duration-typed option is given a value that is empty or only whitespace after trimming. This is a guard at the start of duration parsing: the user supplied an option key with an empty string (e.g. timeout=\"\"), and no duration can be derived from it, distinct from the later parse failure for malformed non-empty text.","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide an actual duration value for the option, e.g. 10S or PT10S","Remove the option key entirely if empty is meant to mean 'use the default'","Check for an empty environment-variable substitution or templating placeholder that resolved to \"\""],"exampleFix":null,"handlingStrategy":"validation","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"}