apache/flink · critical · IllegalConfigurationException

The Flink config file '{}' ({}) does not exist.

Error message

The Flink config file '{}' ({}) does not exist.

What it means

Thrown by GlobalConfiguration.loadConfiguration (as IllegalConfigurationException) when the conf directory exists but the expected Flink config file (flink-conf.yaml by default) is missing inside it. The loader constructs new File(confDirFile, FLINK_CONF_FILENAME) and checks exists().

Source

Thrown at flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java:144

            throw new IllegalArgumentException(
                    "Given configuration directory is null, cannot load configuration");
        }

        final File confDirFile = new File(configDir);
        if (!(confDirFile.exists())) {
            throw new IllegalConfigurationException(
                    "The given configuration directory name '"
                            + configDir
                            + "' ("
                            + confDirFile.getAbsolutePath()
                            + ") does not describe an existing directory.");
        }

        // get Flink yaml configuration file
        Configuration configuration;
        File yamlConfigFile = new File(confDirFile, FLINK_CONF_FILENAME);
        if (!yamlConfigFile.exists()) {
            throw new IllegalConfigurationException(
                    "The Flink config file '"
                            + yamlConfigFile
                            + "' ("
                            + yamlConfigFile.getAbsolutePath()
                            + ") does not exist.");
        } else {
            LOG.info(
                    "Using standard YAML parser to load flink configuration file from {}.",
                    yamlConfigFile.getAbsolutePath());
            configuration = loadYAMLResource(yamlConfigFile);
        }

        final List<String> additionalKeys =
                configuration.get(SecurityOptions.ADDITIONAL_SENSITIVE_KEYS);
        logConfiguration("Loading", configuration, additionalKeys);

        if (dynamicProperties != null) {
            logConfiguration("Loading dynamic", dynamicProperties, additionalKeys);

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Ensure flink-conf.yaml exists inside the configured conf directory (the error prints the expected path).
  2. If using a custom filename, align it with FLINK_CONF_FILENAME or the distribution default.
  3. Re-copy the default flink-conf.yaml from the distribution template.

Example fix

# error indicates missing file at /opt/flink/conf/flink-conf.yaml
# before: directory exists but file absent

# after: create or restore the file
cp /opt/flink/conf/flink-conf.yaml.template /opt/flink/conf/flink-conf.yaml
Defensive patterns

Strategy: validation

Validate before calling

File yaml = new File(configDir, GlobalConfiguration.getFlinkConfFilename());
if (!yaml.isFile()) {
    throw new IllegalArgumentException("Missing config file: " + yaml.getAbsolutePath());
}

Try / catch

try {
    GlobalConfiguration.loadConfiguration(configDir);
} catch (IllegalConfigurationException e) {
    if (e.getMessage().contains("does not exist.")) { /* restore flink-conf.yaml */ }
}

Prevention

When it happens

Trigger: The conf directory is valid but flink-conf.yaml was deleted, renamed, or never created. Also triggered by a custom FLINK_CONF_FILENAME that doesn't match what's on disk.

Common situations: Minimal or custom Docker images that ship a conf directory without flink-conf.yaml. Renaming the file for templating and forgetting to restore it. Misconfigured mounted volumes that mount the parent dir but not the yaml file.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/8c9071ff2620cbe7. Report an issue: GitHub.