{"record":{"id":"e31344b71c22a629","repo":"quarkusio/quarkus","slug":"failed-to-parse-config-file-configyaml","errorCode":null,"errorMessage":"Failed to parse config file ${configYaml}","messagePattern":"Failed to parse config file (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/config/RegistriesConfigLocator.java","lineNumber":72,"sourceCode":"        return load(configYaml);\n    }\n\n    /**\n     * Deserializes a given configuration file.\n     *\n     * @param configYaml configuration file\n     * @return deserialized registry client configuration\n     */\n    public static RegistriesConfig load(Path configYaml) {\n        try {\n            RegistriesConfigImpl.Builder config = RegistriesConfigMapperHelper.deserialize(configYaml,\n                    RegistriesConfigImpl.Builder.class);\n            if (config == null) { // empty file\n                config = new RegistriesConfigImpl.Builder();\n            }\n            return validate(config.setSource(new ConfigSource.FileConfigSource(configYaml)).build());\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Failed to parse config file \" + configYaml, e);\n        }\n    }\n\n    /**\n     * Deserializes registry client configuration from an input stream.\n     *\n     * @param configYaml input stream\n     * @return deserialized registry client configuration\n     */\n    public static RegistriesConfig load(InputStream configYaml) {\n        try {\n            RegistriesConfigImpl.Builder instance = RegistriesConfigMapperHelper.deserializeYaml(configYaml,\n                    RegistriesConfigImpl.Builder.class);\n            return instance == null ? null : validate(instance.build());\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Failed to parse config file \" + configYaml, e);\n        }\n    }","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/config/RegistriesConfigLocator.java#L54-L90","documentation":"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.","triggerScenarios":"resolveConfig loading a specific configYaml path that is unreadable, has bad permissions, or contains invalid YAML mapping for RegistriesConfigImpl.Builder.","commonSituations":"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).","solutions":["Validate the YAML with a linter — look for tabs, bad indentation, and wrong types","Check file readability/permissions for the config path in the message","Restore the default config or delete the file so the locator falls back to the built-in default","Compare against the schema: top-level `registries:` list of objects with id/extra/etc."],"exampleFix":"# before (bad indentation)\nregistries:\n- id: registry.acme.org\n   extra:\n     quarkus-core-version: 3.x\n# after\nregistries:\n  - id: registry.acme.org\n    extra:\n      quarkus-core-version: 3.x","handlingStrategy":"try-catch","validationCode":"// pre-validate YAML before load\ntry (InputStream in = Files.newInputStream(configYaml)) {\n    new org.yaml.snakeyaml.Yaml().load(in); // throws on malformed YAML\n}","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Lint registries.yaml after every edit (no tabs, correct nesting)","Back up the default config before manual changes","Check file permissions for config paths in CI containers"],"tags":["configuration","yaml","parsing"],"backgroundTag":"config-file-parse-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}