{"record":{"id":"0c488f29cb7e13f2","repo":"apache/flink","slug":"the-flink-config-file-does-not-exist","errorCode":null,"errorMessage":"The Flink config file '{}' ({}) does not exist.","messagePattern":"The Flink config file '(.+?)' \\((.+?)\\) does not exist\\.","errorType":"validation","errorClass":"IllegalConfigurationException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/configuration/ConfigurationFileMigrationUtils.java","lineNumber":81,"sourceCode":"            throw new IllegalArgumentException(\n                    \"Given configuration directory is null, cannot load configuration\");\n        }\n\n        final File confDirFile = new File(configDir);\n        if (!(confDirFile.exists())) {\n            throw new IllegalConfigurationException(\n                    \"The given configuration directory name '\"\n                            + configDir\n                            + \"' (\"\n                            + confDirFile.getAbsolutePath()\n                            + \") does not describe an existing directory.\");\n        }\n\n        // get Flink yaml configuration file\n        Map<String, String> configuration;\n        File yamlConfigFile = new File(confDirFile, LEGACY_FLINK_CONF_FILENAME);\n        if (!yamlConfigFile.exists()) {\n            throw new IllegalConfigurationException(\n                    \"The Flink config file '\"\n                            + yamlConfigFile\n                            + \"' (\"\n                            + yamlConfigFile.getAbsolutePath()\n                            + \") does not exist.\");\n        } else {\n            LOG.info(\n                    \"Using legacy YAML parser to load flink configuration file from {}.\",\n                    yamlConfigFile.getAbsolutePath());\n            configuration = loadLegacyYAMLResource(yamlConfigFile);\n        }\n\n        Configuration standardYamlConfig = new Configuration();\n        configuration.forEach(standardYamlConfig::setString);\n        return standardYamlConfig;\n    }\n\n    /**","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/configuration/ConfigurationFileMigrationUtils.java#L63-L99","documentation":"Third guard in migrateLegacyToStandardYamlConfig: the directory exists, but the legacy config file flink-conf.yaml inside it does not, so Flink throws IllegalConfigurationException naming the file and its absolute path. This migration path is specifically for the legacy 'flink-conf.yaml' flat-key format — the modern 'config.yaml' layout is not read here. An empty-but-present file would pass; a missing file will not.","triggerScenarios":"Conf directory contains only the modern config.yaml (or nothing) while the legacy migration loader is invoked; file named flink-conf.yaml missing due to image pruning; directory created fresh without copying any template.","commonSituations":"Mixing Flink config layouts during upgrades; container images that copy only config.yaml but env/tooling still triggers the legacy migration; admins deleting the legacy file after migration while old scripts keep calling this API.","solutions":["Place a flink-conf.yaml (even a minimal/empty one) in the conf directory if you must use this legacy migration path.","Prefer loading the modern config.yaml via GlobalConfiguration.loadConfiguration() instead of the legacy migration utility.","If the file should exist, fix the image/deployment step that dropped it."],"exampleFix":"# before: /opt/flink/conf contains only config.yaml\n# after: also provide the legacy file (or switch the caller)\ntouch /opt/flink/conf/flink-conf.yaml   # empty file satisfies the check\n# better: use GlobalConfiguration.loadConfiguration(confDir) for config.yaml","handlingStrategy":"validation","validationCode":"File legacy = new File(configDir, \"flink-conf.yaml\");\nif (!legacy.isFile()) {\n    // either create it or switch to the modern config.yaml loader\n    System.out.println(\"No legacy flink-conf.yaml at \" + legacy.getAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Know which config layout your Flink version expects (flink-conf.yaml legacy vs config.yaml modern) and carry the right file.","Keep a template conf directory in version control and deploy from it."],"tags":["configuration","missing-file","startup","migration","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}