{"record":{"id":"60e8fa1d2747e3b5","repo":"quarkusio/quarkus","slug":"error-while-loading-the-liquibase-changelogs-s","errorCode":null,"errorMessage":"Error while loading the liquibase changelogs: %s","messagePattern":"Error while loading the liquibase changelogs: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/liquibase/liquibase-mongodb/deployment/src/main/java/io/quarkus/liquibase/mongodb/deployment/LiquibaseMongodbProcessor.java","lineNumber":240,"sourceCode":"\n        ChangeLogParameters changeLogParameters = new ChangeLogParameters();\n        ChangeLogParserFactory changeLogParserFactory = ChangeLogParserFactory.getInstance();\n        LinkedHashSet<LogicalPhysicalAlias> allAliases = new LinkedHashSet<>();\n        try (var classLoaderResourceAccessor = new ClassLoaderResourceAccessor(\n                Thread.currentThread().getContextClassLoader())) {\n            for (LiquibaseMongodbBuildTimeClientConfig buildConfig : liquibaseBuildConfig.clientConfigs().values()) {\n                String changeLog = resolveChangeLog(buildConfig.changeLog(), buildConfig.searchPath());\n                if (changeLog == null) {\n                    continue;\n                }\n                ChangeLogParser parser = changeLogParserFactory.getParser(changeLog, classLoaderResourceAccessor);\n                DatabaseChangeLog root = parser.parse(changeLog, changeLogParameters, classLoaderResourceAccessor);\n                if (root != null) {\n                    allAliases.addAll(LiquibaseChangeLogResourceDiscovery.scan(root).logicalPhysicalAliases());\n                }\n            }\n        } catch (Exception ex) {\n            throw new IllegalStateException(\n                    \"Error while loading the liquibase changelogs: %s\".formatted(ex.getMessage()), ex);\n        }\n\n        byte[] mappingBytes = mergeLogicalPathMappingProperties(allAliases);\n        if (mappingBytes != null) {\n            generatedResources.produce(\n                    new GeneratedResourceBuildItem(LiquibaseLogicalPathMappings.MONGODB_MAPPING_RESOURCE, mappingBytes));\n            nativeImageResources\n                    .produce(new NativeImageResourceBuildItem(LiquibaseLogicalPathMappings.MONGODB_MAPPING_RESOURCE));\n        }\n    }\n\n    private byte[] mergeLogicalPathMappingProperties(LinkedHashSet<LogicalPhysicalAlias> aliases) {\n        if (aliases.isEmpty()) {\n            return null;\n        }\n        TreeMap<String, String> sorted = new TreeMap<>();\n        for (LogicalPhysicalAlias alias : aliases) {","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/liquibase/liquibase-mongodb/deployment/src/main/java/io/quarkus/liquibase/mongodb/deployment/LiquibaseMongodbProcessor.java#L222-L258","documentation":"At build time, LiquibaseMongodbProcessor.liquibaseNativeLogicalPathMappings parses every configured changelog to discover logical-file-path aliases so native-image resource mappings can be generated. If any changelog cannot be parsed or read, it wraps the cause in an IllegalStateException with this message. It is a build/deployment-time failure, so the application fails to start rather than failing lazily at runtime.","triggerScenarios":"Running the Quarkus build (augmentation) for a MongoDB app whose quarkus.liquibase-mongodb.change-log points to a missing, unreadable, or syntactically invalid YAML/XML/JSON changelog; the parser.parse() call throws and the processor rethrows as IllegalStateException.","commonSituations":"Typo in the changelog path; changelog references included files that don't exist; invalid YAML/XML syntax; changelog uses Liquibase features/attributes unsupported by the bundled Liquibase version; resource not on the build classpath.","solutions":["Read the wrapped cause (ex.getMessage()) — it names the offending changelog and parse error; fix the referenced changelog file","Verify quarkus.liquibase-mongodb.change-log points to a file on the classpath (e.g. db/changelog/db.changelog-master.yaml) with correct spelling","Validate the changelog's XML/YAML/JSON syntax and that all <include>/<includeAll> targets exist","Test the changelog with standalone Liquibase update to confirm it parses","Check for Liquibase syntax not supported by the quarkus-liquibase-mongodb bundled Liquibase version and align versions"],"exampleFix":"// before\nquarkus.liquibase-mongodb.change-log=conf/master.yaml\n// after\nquarkus.liquibase-mongodb.change-log=db/changelog/master.yaml","handlingStrategy":"validation","validationCode":"// Run before build: check the changelog exists and parses\nString path = \"db/changelog/master.yaml\";\nif (getClass().getClassLoader().getResource(path) == null) {\n    throw new IllegalStateException(\"quarkus.liquibase-mongodb.change-log resource missing: \" + path);\n}\nnew Liquibase(path, new ClassLoaderResourceAccessor(), new MongoConnection()) // or standalone Liquibase CLI validate","typeGuard":null,"tryCatchPattern":"try {\n    quarkusBuild(); // or application startup\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Error while loading the liquibase changelogs\")) {\n        log.error(\"Fix changelog syntax/path: \" + e.getCause(), e);\n    }\n    throw e;\n}","preventionTips":["Validate changelogs with the Liquibase CLI (update testing) before building the Quarkus app","Keep changelog files under src/main/resources with paths matching the config property exactly","Check include/includeAll targets exist whenever adding files","Keep the Liquibase version in sync with quarkus-liquibase-mongodb's bundled version"],"tags":["liquibase","mongodb","build-time","changelog","parse-error"],"backgroundTag":"changelog-parse-failure","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"}