{"record":{"id":"85d0daa668208813","repo":"flowable/flowable-engine","slug":"failed-to-get-change-log-version-from-changelogt","errorCode":null,"errorMessage":"Failed to get change log version from ${changeLogTableName}","messagePattern":"Failed to get change log version from (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineSqlScriptBasedDbSchemaManager.java","lineNumber":217,"sourceCode":"                String changeLogVersion = null;\n                try (ResultSet resultSet = statement.executeQuery()) {\n                    while (resultSet.next()) {\n                        String changeLogVersionId = resultSet.getString(1);\n                        int changeLogVersionOrder = getChangeLogVersionOrder(changeLogVersionId);\n                        if (changeLogVersionOrder > latestChangeLogVersionOrder) {\n                            // Even though we are ordering by DATEEXECUTED, and the last ID should be the last executed one.\n                            // It is still possible that there are multiple entries with the same DATEEXECUTED value and the order might not be correct.\n                            // e.g. MySQL 8.0 sometimes does not return the correct order.\n                            changeLogVersion = changeLogVersionId;\n                            latestChangeLogVersionOrder = changeLogVersionOrder;\n                        }\n                    }\n                }\n                if (changeLogVersion != null) {\n                    return new ChangeLogVersion(changeLogVersion, getDbVersionForChangelogVersion(changeLogVersion));\n                }\n            } catch (SQLException e) {\n                throw new RuntimeException(\"Failed to get change log version from \" + changeLogTableName, e);\n            }\n        }\n\n        return new ChangeLogVersion(null, getDbVersionForChangelogVersion(null));\n    }\n\n    public record ChangeLogVersion(String version, String dbVersion) {\n    }\n\n}\n","sourceCodeStart":199,"sourceCodeEnd":228,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineSqlScriptBasedDbSchemaManager.java#L199-L228","documentation":"Raised inside getChangeLogVersion when a SQLException occurs while reading the Flowable change-log table (e.g. FLW_EV_DATABASECHANGELOG / Liquibase-style changelog) during schema update. It signals the change-log table exists but its version could not be read; wrapped RuntimeException keeps the SQLException as cause.","triggerScenarios":"schemaUpdateInLock -> getChangeLogVersion executes SQL against changeLogTableName and the JDBC call throws: table locked, column missing, corrupted changelog, insufficient SELECT privilege, or connection failure mid-read.","commonSituations":"Interrupted previous schema update left the changelog in a bad state; DBA altered/renamed the change-log table; concurrent engine boots contending on the changelog; user lacks privileges on FLW_* change-log tables.","solutions":["Read the cause SQLException for the exact SQL error (lock, privilege, missing column).","Repair or recreate the change-log table from a clean state (backup, drop, let Flowable rebuild and re-run updates).","Ensure no other engine instance holds a lock on the changelog during startup.","Grant the DB user SELECT/UPDATE rights on the Flowable change-log tables."],"exampleFix":"// before: guessing at cause\ncatch (FlowableException e) { log.error(e.getMessage()); }\n// after\ncatch (FlowableException e) { log.error(\"changelog read failed\", e.getCause()); /* then repair FLW change-log table */ }","handlingStrategy":"try-catch","validationCode":"try (ResultSet rs = c.getMetaData().getColumns(null, null, \"FLW_EV_DATABASECHANGELOG\", null)) { if (!rs.next()) throw new IllegalStateException(\"change-log table missing/corrupt\"); }","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) { if (e.getMessage().startsWith(\"Failed to get change log version\")) { repairOrRecreateChangelog(); } else { throw e; } }","preventionTips":["Avoid killing the JVM mid-schema-update.","Ensure only one engine instance bootstraps the schema at a time.","Grant privileges on FLW_* change-log tables.","Back up change-log tables before upgrades."],"tags":["database","schema","sql","changelog","flowable"],"backgroundTag":"sql-query-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}