{"record":{"id":"531f7d3167a713ce","repo":"apache/flink","slug":"could-not-parse-value-s-for-key-s","errorCode":null,"errorMessage":"Could not parse value '%s' for key '%s'.","messagePattern":"Could not parse value '(.+?)' for key '(.+?)'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/configuration/Configuration.java","lineNumber":378,"sourceCode":"     */\n    @PublicEvolving\n    public <T> T get(ConfigOption<T> configOption, T overrideDefault) {\n        return getOptional(configOption).orElse(overrideDefault);\n    }\n\n    @Override\n    public <T> Optional<T> getOptional(ConfigOption<T> option) {\n        Optional<Object> rawValue = getRawValueFromOption(option);\n        Class<?> clazz = option.getClazz();\n\n        try {\n            if (option.isList()) {\n                return rawValue.map(v -> ConfigurationUtils.convertToList(v, clazz));\n            } else {\n                return rawValue.map(v -> ConfigurationUtils.convertValue(v, clazz));\n            }\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\n                    GlobalConfiguration.isSensitive(\n                                    option.key(),\n                                    this.get(SecurityOptions.ADDITIONAL_SENSITIVE_KEYS))\n                            ? String.format(\"Could not parse value for key '%s'.\", option.key())\n                            : String.format(\n                                    \"Could not parse value '%s' for key '%s'.\",\n                                    rawValue.map(Object::toString).orElse(\"\"), option.key()),\n                    e);\n        }\n    }\n\n    @Override\n    public <T> Configuration set(ConfigOption<T> option, T value) {\n        final boolean canBePrefixMap = canBePrefixMap(option);\n        setValueInternal(option.key(), value, canBePrefixMap);\n        return this;\n    }\n","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L360-L396","documentation":"The non-sensitive variant of the getOptional parse failure: the raw value's string form is echoed ('Could not parse value '%s' for key '%s'') because the key did NOT match the sensitive-key patterns. It fires when ConfigurationUtils.convertValue/convertToList throws while turning the raw value into the ConfigOption's declared type — malformed duration/memory-size strings, non-numeric input for numeric options, or broken comma-separated list syntax.","triggerScenarios":"Setting 'taskmanager.memory.network.size: 1gbx'; 'heartbeat.interval: 10sec' (missing space); a list option like 'parallelism.default' with junk; a boolean option given 'yes' instead of 'true'; empty value '' for a numeric option.","commonSituations":"Hand-edited flink-conf.yaml or Kubernetes config map typos; values copied from blog posts written for a different config syntax; upgrading Flink where an option changed from plain long to duration/memory type so old values no longer parse.","solutions":["Rewrite the value in the syntax the message's key expects — the echoed value shows exactly what failed; durations need a unit with a space ('30 s') or ISO-8601 ('PT30S'), memory sizes '256 mb', booleans 'true'/'false'.","Cross-check the option in the official config docs for its type in your Flink version.","Fix list options: comma-separated entries, each entry itself well-formed.","Remove the key to use the default while you verify the correct syntax."],"exampleFix":"# before\nstate.backend.local-recovery: yes\nheartbeat.interval: 10sec\n\n# after\nstate.backend.local-recovery: true\nheartbeat.interval: 10 s","handlingStrategy":"validation","validationCode":"static boolean parsesAs(Configuration conf, ConfigOption<Long> opt) {\n    try {\n        conf.getOptional(opt);\n        return true;\n    } catch (IllegalArgumentException e) {\n        return false;\n    }\n}\n// call all typed gets once at startup to surface bad values with full context","typeGuard":null,"tryCatchPattern":"try {\n    Duration d = conf.getOptional(MyOptions.TIMEOUT).orElse(Duration.ZERO);\n} catch (IllegalArgumentException e) {\n    // message contains the offending value and key; map to a config-validation report\n    throw new ConfigValidationException(e.getMessage(), e);\n}","preventionTips":["Use Flink's config docs generator/validators on flink-conf.yaml in CI.","Write durations with a space ('30 s') and memory with units ('256 mb').","Read all typed options once during initialization so bad values fail fast, not mid-job."],"tags":["configuration","parse-error","yaml","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}