{"record":{"id":"04ca7fa846057aa5","repo":"flowable/flowable-engine","slug":"invalid-engine-for-entitytype-with-id-id","errorCode":null,"errorMessage":"Invalid 'engine' for ${entityType} with id ${id} : ${tag}","messagePattern":"Invalid 'engine' for (.+?) with id (.+?) : (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/Flowable5Util.java","lineNumber":134,"sourceCode":"    public static boolean isFlowable5ProcessDefinition(ProcessDefinition processDefinition, ProcessEngineConfigurationImpl processEngineConfiguration) {\n        if (isV5Entity(processDefinition.getEngineVersion(), processDefinition.getId(), \"process definition\", processEngineConfiguration)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    public static boolean isV5Entity(String tag, String id, String entityType, ProcessEngineConfigurationImpl processEngineConfiguration) {\n        if (isVersion5Tag(tag)) {\n            if (!processEngineConfiguration.isFlowable5CompatibilityEnabled() || processEngineConfiguration.getFlowable5CompatibilityHandler() == null) {\n                throw new FlowableException(entityType + \" with id \" + id + \" has a v5 tag and flowable 5 compatibility is not enabled\");\n            }\n\n            return true;\n\n        } else {\n            if (tag != null) {\n                throw new FlowableException(\"Invalid 'engine' for \" + entityType + \" with id \" + id + \" : \" + tag);\n            }\n            return false;\n        }\n    }\n\n    public static boolean isVersion5Tag(String tag) {\n        return V5_ENGINE_TAG.equals(tag) || \"activiti-5\".equals(tag);\n    }\n\n    public static Flowable5CompatibilityHandler getFlowable5CompatibilityHandler() {\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();\n\n        Flowable5CompatibilityHandler flowable5CompatibilityHandler = null;\n        if (processEngineConfiguration != null) {\n            flowable5CompatibilityHandler = processEngineConfiguration.getFlowable5CompatibilityHandler();\n        }\n\n        if (flowable5CompatibilityHandler == null) {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/Flowable5Util.java#L116-L152","documentation":"isV5Entity distinguishes engine versions via a tag: a version-5 tag means v5, and null means Flowable 6. If the tag is neither of these (some unexpected non-null value), Flowable cannot determine which engine produced the entity and throws this FlowableException. It guards against corrupted or foreign entity metadata.","triggerScenarios":"isV5Entity (via isFlowable5Deployment / isFlowable5ProcessDefinition) is passed a tag value that is non-null and not recognized as the v5 tag — e.g. a manually edited or corrupted metadata tag in the deployment/definition tables.","commonSituations":"Database rows hand-edited or written by another tool with an unknown engine tag; upgrades between intermediate versions that used different tag conventions; mixing engine versions on a shared database.","solutions":["Inspect the tag column for the entity in the database (ACT_RE_PROCDEF / ACT_RE_DEPLOYMENT) and correct or remove the invalid value.","Restore the entity from a valid backup or redeploy the process definition.","Ensure no other tool or engine version writes these tables with foreign tag formats.","If migrating, follow the official migration procedure so tags are converted correctly."],"exampleFix":"// before: manual DB edit left tag 'activiti-legacy'\nUPDATE ACT_RE_PROCDEF SET ENGINE_VERSION_ = 'activiti-legacy' WHERE ID_ = '...';\n\n// after: use null for Flowable 6 entities\nUPDATE ACT_RE_PROCDEF SET ENGINE_VERSION_ = NULL WHERE ID_ = '...';","handlingStrategy":"validation","validationCode":"// validate engine tag before engine calls\nString tag = getEngineVersionTagFromDb(id);\nif (tag != null && !Flowable5Util.isVersion5Tag(tag)) {\n    throw new IllegalStateException(\"Unknown engine tag '\" + tag + \"' for entity \" + id);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit engine metadata columns","Restrict direct DB write access to Flowable tables","Use official migration tooling so engine tags stay consistent"],"tags":["compatibility","invalid-metadata","v5-migration"],"backgroundTag":"invalid-config-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}