{"record":{"id":"92b754662b6185a8","repo":"apache/flink","slug":"the-value-number-cannot-be-represented-as-an","errorCode":null,"errorMessage":"The value '${number}' cannot be represented as an integer number.","messagePattern":"The value '(.+?)' cannot be represented as an integer number\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/util/TimeUtils.java","lineNumber":101,"sourceCode":"                // Fall back to parse ISO-8601 duration format\n                Duration parsedDuration = Duration.parse(trimmed);\n                if (parsedDuration.isNegative()) {\n                    // Don't support negative duration which is consistent with before format\n                    throw new NumberFormatException(\"negative duration is not supported\");\n                }\n                return parsedDuration;\n            } catch (DateTimeParseException e) {\n                throw new NumberFormatException(\n                        \"text does not start with a number, and is not a valid ISO-8601 duration format: \"\n                                + trimmed);\n            }\n        }\n\n        final BigInteger value;\n        try {\n            value = new BigInteger(number); // this throws a NumberFormatException\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\n                    \"The value '\" + number + \"' cannot be represented as an integer number.\", e);\n        }\n\n        final ChronoUnit unit;\n        if (unitLabel.isEmpty()) {\n            unit = ChronoUnit.MILLIS;\n        } else {\n            unit = LABEL_TO_UNIT_MAP.get(unitLabel);\n        }\n        if (unit == null) {\n            throw new IllegalArgumentException(\n                    \"Time interval unit label '\"\n                            + unitLabel\n                            + \"' does not match any of the recognized units: \"\n                            + TimeUnit.getAllUnits());\n        }\n\n        try {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/util/TimeUtils.java#L83-L119","documentation":"After parseDuration extracts a leading digit run, it converts that substring with new BigInteger. Overflow is impossible (BigInteger), so this IllegalArgumentException means the digit run itself was not a valid integer token — classically a bare decimal point, a lone sign, or a floating-point value like \".5\" or \"1.5\".","triggerScenarios":"Calling TimeUtils.parseDuration(\"1.5 s\") or TimeUtils.parseDuration(\".5min\"): the digit scan stops at '.', leaving number=\"1\" or \".5\"-style tokens that BigInteger cannot parse depending on where the scan stopped; typically triggered by decimal values.","commonSituations":"Users writing fractional durations (\"1.5 min\") — supported by ISO-8601 but not by the number+unit path when the integer part is malformed; config generators emitting doubles into duration fields.","solutions":["Use an integer value with a smaller unit: \"90 s\" instead of \"1.5 min\".","Or use ISO-8601 which permits fractional seconds: \"PT1.5M\".","If generating config programmatically, round or convert durations to integral units before serialization."],"exampleFix":"# before\ntimeout=1.5 min\n\n# after\ntimeout=90 s","handlingStrategy":"validation","validationCode":"if (t.matches(\".*\\\\d\\\\.\\\\d.*\") && !t.startsWith(\"P\")) {\n    // fractional in number+unit form: convert to integral smaller unit or PT form first\n    t = toIso8601(t); // custom conversion\n}\nTimeUtils.parseDuration(t);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid fractional values in number+unit durations; express in a smaller unit.","Use ISO-8601 (PT1.5M) when fractions are required.","Round durations to whole units in config generators."],"tags":["configuration","duration","parsing","fractional"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}