quarkusio/quarkus · critical · IllegalStateException

Failed to parse config file ${configYaml}

Error message

Failed to parse config file ${configYaml}

What it means

Thrown when the registry client configuration YAML file cannot be read or deserialized (IOException) in RegistriesConfigLocator.load(Path). This covers unreadable files as well as malformed YAML that Jackson surfaces as an IOException.

Source

Thrown at independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/config/RegistriesConfigLocator.java:72

        return load(configYaml);
    }

    /**
     * Deserializes a given configuration file.
     *
     * @param configYaml configuration file
     * @return deserialized registry client configuration
     */
    public static RegistriesConfig load(Path configYaml) {
        try {
            RegistriesConfigImpl.Builder config = RegistriesConfigMapperHelper.deserialize(configYaml,
                    RegistriesConfigImpl.Builder.class);
            if (config == null) { // empty file
                config = new RegistriesConfigImpl.Builder();
            }
            return validate(config.setSource(new ConfigSource.FileConfigSource(configYaml)).build());
        } catch (IOException e) {
            throw new IllegalStateException("Failed to parse config file " + configYaml, e);
        }
    }

    /**
     * Deserializes registry client configuration from an input stream.
     *
     * @param configYaml input stream
     * @return deserialized registry client configuration
     */
    public static RegistriesConfig load(InputStream configYaml) {
        try {
            RegistriesConfigImpl.Builder instance = RegistriesConfigMapperHelper.deserializeYaml(configYaml,
                    RegistriesConfigImpl.Builder.class);
            return instance == null ? null : validate(instance.build());
        } catch (IOException e) {
            throw new IllegalStateException("Failed to parse config file " + configYaml, e);
        }
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Validate the YAML with a linter — look for tabs, bad indentation, and wrong types
  2. Check file readability/permissions for the config path in the message
  3. Restore the default config or delete the file so the locator falls back to the built-in default
  4. Compare against the schema: top-level `registries:` list of objects with id/extra/etc.

Example fix

# before (bad indentation)
registries:
- id: registry.acme.org
   extra:
     quarkus-core-version: 3.x
# after
registries:
  - id: registry.acme.org
    extra:
      quarkus-core-version: 3.x
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate YAML before load
try (InputStream in = Files.newInputStream(configYaml)) {
    new org.yaml.snakeyaml.Yaml().load(in); // throws on malformed YAML
}

Try / catch

try { cfg = RegistriesConfigLocator.load(configYaml); } catch (IllegalStateException e) { if (e.getMessage().startsWith("Failed to parse config file")) { log.error("Bad registries config at " + configYaml, e.getCause()); restoreDefaultConfig(configYaml); } else throw e; }

Prevention

When it happens

Trigger: resolveConfig loading a specific configYaml path that is unreadable, has bad permissions, or contains invalid YAML mapping for RegistriesConfigImpl.Builder.

Common situations: Hand-edited registries.yaml with wrong indentation or tabs; file locked/permission-denied; wrong YAML types (e.g. registry as a string instead of a mapping).

Understand the failure class

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/e31344b71c22a629. Report an issue: GitHub.