{"record":{"id":"80a6953c730dc661","repo":"apache/flink","slug":"error-parsing-yaml-configuration-80a695","errorCode":null,"errorMessage":"Error parsing YAML configuration.","messagePattern":"Error parsing YAML configuration\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java","lineNumber":264,"sourceCode":"     *         port: 6123         # network port to connect to for communication with the job manager\n     * taskmanager:\n     *     rpc:\n     *         port: 6122         # network port the task manager expects incoming IPC connections\n     * </pre>\n     *\n     * @param file the YAML file to read from\n     * @see <a href=\"http://www.yaml.org/spec/1.2/spec.html\">YAML 1.2 specification</a>\n     */\n    private static Configuration loadYAMLResource(File file) {\n        final Configuration config = new Configuration();\n\n        try {\n            Map<String, Object> configDocument = flatten(YamlParserUtils.loadYamlFile(file));\n            configDocument.forEach((k, v) -> config.setValueInternal(k, v, false));\n\n            return config;\n        } catch (Exception e) {\n            throw new RuntimeException(\"Error parsing YAML configuration.\", e);\n        }\n    }\n\n    /**\n     * Check whether the key is a hidden key.\n     *\n     * @param key the config key\n     * @param additionalKeys user-defined additional sensitive key substrings to check in addition\n     *     to the built-in list; use {@link SecurityOptions#ADDITIONAL_SENSITIVE_KEYS} to obtain\n     *     these from a loaded {@link Configuration}\n     */\n    public static boolean isSensitive(String key, List<String> additionalKeys) {\n        Preconditions.checkNotNull(key, \"key is null\");\n        final String keyInLower = key.toLowerCase();\n        for (String hideKey : SENSITIVE_KEYS) {\n            if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) {\n                return true;\n            }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L246-L282","documentation":"Thrown by GlobalConfiguration.loadYAMLResource as a RuntimeException wrapping any exception caught while parsing the flink-conf.yaml file. The inner cause is the actual parse error (YAML syntax error, type coercion failure, etc.). This is a catch-all that masks the root cause behind a generic message.","triggerScenarios":"Malformed YAML syntax (bad indentation, stray tabs, unbalanced brackets). A value that fails type coercion during setValueInternal. Unsupported YAML constructs (anchors, tags) the parser cannot handle.","commonSituations":"Hand-editing flink-conf.yaml with incorrect indentation. Mixing tabs and spaces. Copy-pasting config snippets with invalid YAML. Values containing special characters that need quoting.","solutions":["Examine the cause of the RuntimeException to find the exact YAML line and error.","Validate the YAML with a linter (e.g., yamllint or an online parser) before deploying.","Quote values containing special characters (:, {, }, [, ], ,, &, *, #, ?, |, <, >, =, %, @).","Use spaces consistently; avoid tabs for indentation."],"exampleFix":"# before (tab indentation / bad nesting)\njobmanager:\n\tmemory:\n\t  process.size: 1600m\n\n# after\njobmanager:\n  memory:\n    process:\n      size: 1600m","handlingStrategy":"try-catch","validationCode":"// Pre-validate YAML with snakeyaml before Flink loads it\norg.yaml.snakeyaml.Yaml yaml = new org.yaml.snakeyaml.Yaml();\ntry (InputStream is = Files.newInputStream(Paths.get(yamlPath))) {\n    yaml.load(is); // throws on syntax errors\n} catch (Exception e) { /* report line number */ }","typeGuard":null,"tryCatchPattern":"try {\n    Configuration conf = GlobalConfiguration.loadConfiguration(configDir);\n} catch (RuntimeException e) {\n    if (e.getMessage().equals(\"Error parsing YAML configuration.\") && e.getCause() != null) {\n        Throwable cause = e.getCause();\n        // inspect cause for line/column info\n    }\n}","preventionTips":["Use a YAML linter (yamllint) on flink-conf.yaml before deploying.","Use spaces, not tabs, for indentation.","Quote values containing special characters.","Inspect the wrapped cause for the exact parse location."],"tags":["configuration","yaml","startup","parsing"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}