{"record":{"id":"e41ebc96e9ef2453","repo":"flowable/flowable-engine","slug":"couldn-t-get-db-schema-version","errorCode":null,"errorMessage":"couldn't get db schema version","messagePattern":"couldn't get db schema version","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/db/ProcessDbSchemaManager.java","lineNumber":65,"sourceCode":"            }\n            if (CommandContextUtil.getDbSqlSession().getDbSqlSessionFactory().isDbHistoryUsed() && !isHistoryTablePresent()) {\n                errorMessage = addMissingComponent(errorMessage, \"history\");\n            }\n\n            if (errorMessage != null) {\n                throw new FlowableException(\"Flowable database problem: \" + errorMessage);\n            }\n\n        } catch (Exception e) {\n            if (isMissingTablesException(e)) {\n                throw new FlowableException(\n                        \"no flowable tables in db. set <property name=\\\"databaseSchemaUpdate\\\" to value=\\\"true\\\" or value=\\\"create-drop\\\" (use create-drop for testing only!) in bean processEngineConfiguration in flowable.cfg.xml for automatic schema creation\",\n                        e);\n            } else {\n                if (e instanceof RuntimeException) {\n                    throw (RuntimeException) e;\n                } else {\n                    throw new FlowableException(\"couldn't get db schema version\", e);\n                }\n            }\n        }\n\n        logger.debug(\"flowable db schema check successful\");\n    }\n\n    protected String addMissingComponent(String missingComponents, String component) {\n        if (missingComponents == null) {\n            return \"Tables missing for component(s) \" + component;\n        }\n        return missingComponents + \", \" + component;\n    }\n\n    protected String getDbVersion() {\n        DbSqlSession dbSqlSession = CommandContextUtil.getDbSqlSession();\n        String selectSchemaVersionStatement = dbSqlSession.getDbSqlSessionFactory().mapStatement(\"org.flowable.common.engine.impl.persistence.entity.PropertyEntityImpl.selectPropertyValue\");\n        return dbSqlSession.getSqlSession().selectOne(selectSchemaVersionStatement, \"schema.version\");","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/db/ProcessDbSchemaManager.java#L47-L83","documentation":"Generic wrapper thrown when schemaCheckVersion catches a non-missing-tables, non-RuntimeException (checked) exception while checking or reading the DB schema version. The original exception is attached as the cause; the message only indicates the version check could not complete.","triggerScenarios":"getDbVersion() or table-presence checks throw a checked/wrapped exception — e.g. SQL errors surfaced as non-runtime exceptions, driver/classloader issues, or any unexpected Exception during the schema check.","commonSituations":"Broken/mismatched JDBC driver causing SQLExceptions wrapped oddly; network interruptions mid-check; permissions problems on the metadata queries; custom DbSqlSessionFactory misconfiguration.","solutions":["Inspect the cause chain of the thrown FlowableException for the root SQLException and fix that underlying problem.","Verify JDBC connectivity, driver version, and that the DB user can read ACT_GE_PROPERTY and database metadata.","Check Flowable's databaseType detection / supported database list; set databaseType explicitly if auto-detection fails on an unsupported DB."],"exampleFix":"// before\n// cause hidden: FlowableException(\"couldn't get db schema version\", e)\n// after: log the cause to find root issue\ntry { processEngine = cfg.buildProcessEngine(); }\ncatch (FlowableException e) { LOG.error(\"schema check failed\", e.getCause()); throw e; }","handlingStrategy":"try-catch","validationCode":"try { managementService.getProperties(); } catch (Exception e) { LOG.error(\"DB schema check will fail\", e); }","typeGuard":null,"tryCatchPattern":"try { engine = cfg.buildProcessEngine(); } catch (FlowableException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); LOG.error(\"root schema-check failure\", root); }","preventionTips":["Always inspect the cause chain when this generic message appears","Verify JDBC driver version matches the database before engine startup","Confirm DB user read access to ACT_GE_PROPERTY and metadata tables"],"tags":["database","schema-version","wrapped-exception"],"backgroundTag":"database-query-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}