{"record":{"id":"654e4bc07a001177","repo":"Activiti/Activiti","slug":"activiti-database-problem-errormessage","errorCode":null,"errorMessage":"Activiti database problem: ${errorMessage}","messagePattern":"Activiti database problem: (.+?)","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"critical","filePath":"activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSession.java","lineNumber":894,"sourceCode":"    // ////////////////////////////////////////////////////////\n\n    public void dbSchemaCheckVersion() {\n        try {\n            String dbVersion = getDbVersion();\n            if (!ProcessEngine.VERSION.equals(dbVersion)) {\n                throw new ActivitiWrongDbException(ProcessEngine.VERSION, dbVersion);\n            }\n\n            String errorMessage = null;\n            if (!isEngineTablePresent()) {\n                errorMessage = addMissingComponent(errorMessage, \"engine\");\n            }\n            if (dbSqlSessionFactory.isDbHistoryUsed() && !isHistoryTablePresent()) {\n                errorMessage = addMissingComponent(errorMessage, \"history\");\n            }\n\n            if (errorMessage != null) {\n                throw new ActivitiException(\"Activiti database problem: \" + errorMessage);\n            }\n        } catch (Exception e) {\n            if (isMissingTablesException(e)) {\n                throw new ActivitiException(\n                    \"no activiti tables in db. set <property name=\\\"databaseSchemaUpdate\\\" to value=\\\"true\\\" or value=\\\"create-drop\\\" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation\",\n                    e\n                );\n            } else {\n                if (e instanceof RuntimeException) {\n                    throw (RuntimeException) e;\n                } else {\n                    throw new ActivitiException(\"couldn't get db schema version\", e);\n                }\n            }\n        }\n\n        log.debug(\"activiti db schema check successful\");\n    }","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSession.java#L876-L912","documentation":"As the final part of dbSchemaCheckVersion, Activiti verifies that required table groups (engine, history, identity) are present. If any are missing it throws ActivitiException listing the missing components, meaning the database is incompletely initialized.","triggerScenarios":"Engine startup (schema check) against a database where ACT_* tables are partially present — e.g. engine tables exist but history or identity tables were dropped or never created.","commonSituations":"Partial manual schema creation; someone dropped tables; restoring a partial DB backup; pointing the engine at a database initialized for another product.","solutions":["Set databaseSchemaUpdate=true so missing tables are created automatically","Run the schema creation scripts manually (activiti.<db>.create.*.sql)","Point the engine at the correct, fully initialized database"],"exampleFix":"// before\n<property name=\"databaseSchemaUpdate\" value=\"false\"/>\n// after\n<property name=\"databaseSchemaUpdate\" value=\"true\"/>","handlingStrategy":"validation","validationCode":"boolean hasEngine = dbSqlSession.isEngineTablePresent();\nboolean hasHistory = dbSqlSession.isHistoryTablePresent();\nboolean hasIdentity = dbSqlSession.isIdentityTablePresent();\nif (!hasEngine || !hasHistory || !hasIdentity) cfg.setDatabaseSchemaUpdate(\"true\");","typeGuard":null,"tryCatchPattern":"try {\n    processEngine = cfg.buildProcessEngine();\n} catch (ActivitiException e) {\n    if (e.getMessage().contains(\"Activiti database problem\")) recreateMissingTables();\n    throw e;\n}","preventionTips":["Use databaseSchemaUpdate=true or run full create scripts on fresh environments","Protect ACT_* tables from manual drops","Verify DB backups restore all ACT_* table groups"],"tags":["database","schema","missing-tables","configuration"],"backgroundTag":"schema-validation-failed","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}