{"record":{"id":"11c195f2ce2f3805","repo":"apache/flink","slug":"the-configuration-directory-specified-in-the","errorCode":null,"errorMessage":"The configuration directory '{}', specified in the '{}' environment variable, does not exist.","messagePattern":"The configuration directory '(.+?)', specified in the '(.+?)' environment variable, does not exist\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java","lineNumber":1376,"sourceCode":"                    ExceptionUtils.stripException(t, UndeclaredThrowableException.class);\n            LOG.error(\"Fatal error while running command line interface.\", strippedThrowable);\n            strippedThrowable.printStackTrace();\n        }\n        return retCode;\n    }\n\n    // --------------------------------------------------------------------------------------------\n    //  Miscellaneous Utilities\n    // --------------------------------------------------------------------------------------------\n\n    public static String getConfigurationDirectoryFromEnv() {\n        String location = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);\n\n        if (location != null) {\n            if (new File(location).exists()) {\n                return location;\n            } else {\n                throw new RuntimeException(\n                        \"The configuration directory '\"\n                                + location\n                                + \"', specified in the '\"\n                                + ConfigConstants.ENV_FLINK_CONF_DIR\n                                + \"' environment variable, does not exist.\");\n            }\n        } else if (new File(CONFIG_DIRECTORY_FALLBACK_1).exists()) {\n            location = CONFIG_DIRECTORY_FALLBACK_1;\n        } else if (new File(CONFIG_DIRECTORY_FALLBACK_2).exists()) {\n            location = CONFIG_DIRECTORY_FALLBACK_2;\n        } else {\n            throw new RuntimeException(\n                    \"The configuration directory was not specified. \"\n                            + \"Please specify the directory containing the configuration file through the '\"\n                            + ConfigConstants.ENV_FLINK_CONF_DIR\n                            + \"' environment variable.\");\n        }\n        return location;","sourceCodeStart":1358,"sourceCodeEnd":1394,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L1358-L1394","documentation":"Thrown by CliFrontend.getConfigurationDirectoryFromEnv when the FLINK_CONF_DIR environment variable is set but the path it points to does not exist on the filesystem. Flink validates this immediately at CLI startup before loading any configuration, so no command will proceed. It is a RuntimeException (unchecked), surfaced as a fatal startup error.","triggerScenarios":"Setting FLINK_CONF_DIR to a path that has been removed, misspelled, or is relative to a different working directory. Also triggered when the variable is inherited from a container image or shell profile pointing at a path that was never mounted (e.g., Docker volume mismatch).","commonSituations":"Docker/Kubernetes deployment where FLINK_CONF_DIR points to a configmap mount path that isn't populated; CI pipelines that set FLINK_CONF_DIR from a template variable that resolves to a non-existent path; symlinks that dangle after package relocation.","solutions":["Verify the path exists: `ls -la $FLINK_CONF_DIR`","Unset FLINK_CONF_DIR to let Flink fall back to CONFIG_DIRECTORY_FALLBACK_1 or CONFIG_DIRECTORY_FALLBACK_2 (typically ../conf relative to the Flink binary)","Fix the environment variable to point at the actual configuration directory"],"exampleFix":"# before (broken)\nexport FLINK_CONF_DIR=/opt/flink/conf-custom  # path does not exist\n\n# after\nexport FLINK_CONF_DIR=/opt/flink/conf  # verified existing path\n# or unset to use default\nunset FLINK_CONF_DIR","handlingStrategy":"validation","validationCode":"String confDir = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);\nif (confDir != null && !new File(confDir).exists()) {\n    throw new IllegalArgumentException(\n        \"FLINK_CONF_DIR points to non-existent path: \" + confDir + \". Fix or unset it.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate FLINK_CONF_DIR exists in deployment scripts before starting Flink","Use absolute paths in FLINK_CONF_DIR to avoid working-directory sensitivity","In Docker, verify the config volume is mounted before entrypoint runs"],"tags":["cli","configuration","environment","startup"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}