{"record":{"id":"177fb487ea1a3d32","repo":"apache/flink","slug":"value-for-configuration-key-key-is-not-set-co","errorCode":null,"errorMessage":"Value for configuration key='${key}' is not set correctly. Entered value='${val}'. Default value='${defaultValue}'","messagePattern":"Value for configuration key='(.+?)' is not set correctly\\. Entered value='(.+?)'\\. Default value='(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java","lineNumber":44,"sourceCode":"public class PropertiesUtil {\n\n    /**\n     * Get integer from properties. This method throws an exception if the integer is not valid.\n     *\n     * @param config Properties\n     * @param key key in Properties\n     * @param defaultValue default value if value is not set\n     * @return default or value of key\n     */\n    public static int getInt(Properties config, String key, int defaultValue) {\n        String val = config.getProperty(key);\n        if (val == null) {\n            return defaultValue;\n        } else {\n            try {\n                return Integer.parseInt(val);\n            } catch (NumberFormatException nfe) {\n                throw new IllegalArgumentException(\n                        \"Value for configuration key='\"\n                                + key\n                                + \"' is not set correctly. \"\n                                + \"Entered value='\"\n                                + val\n                                + \"'. Default value='\"\n                                + defaultValue\n                                + \"'\");\n            }\n        }\n    }\n\n    /**\n     * Get long from properties. This method throws an exception if the long is not valid.\n     *\n     * @param config Properties\n     * @param key key in Properties\n     * @param defaultValue default value if value is not set","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java#L26-L62","documentation":"Thrown by PropertiesUtil.getInt when a properties value exists but cannot be parsed as an int via Integer.parseInt. The library treats malformed numeric configuration as an illegal argument rather than silently falling back to the default, so typos fail fast. The message names the offending key, the entered value, and the default that would have applied.","triggerScenarios":"Calling PropertiesUtil.getInt(properties, key, defaultValue) where properties contains a non-integer string for key, e.g. \"abc\", \"10mb\", \"1.5\", an empty string, or a value with whitespace.","commonSituations":"Hand-edited flink-conf style properties files, unit placeholders in a numeric field (\"512mb\" in a slot/count field), locale-dependent decimal input, trailing spaces or BOM characters in properties files loaded from disk.","solutions":["Correct the value for the named key so it is a valid signed 32-bit integer (e.g. \"16\" instead of \"16 cores\").","If the value should carry a unit or size, switch to the appropriate parser such as MemorySize.parse for memory or TimeUtils.parseDuration for time instead of getInt.","Remove the key from the properties entirely if you want the defaultValue to apply.","Trim/normalize the properties file before parsing if stray whitespace or invisible characters are suspected."],"exampleFix":"# before\njob.parallelism=8x\n\n# after\njob.parallelism=8","handlingStrategy":"validation","validationCode":"String raw = props.getProperty(key);\nif (raw != null) {\n    try { Integer.parseInt(raw.trim()); }\n    catch (NumberFormatException e) { throw new IllegalStateException(\"Bad int for \" + key + \": \" + raw, e); }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run a config-validation pass over user-supplied Properties before handing them to PropertiesUtil.","Keep numeric keys free of units and separators; use dedicated parsers for sizes and durations.","Log the offending key/value at load time to fail with context in CI."],"tags":["configuration","properties","parsing","validation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}