{"record":{"id":"7449428e1a57ab7f","repo":"flowable/flowable-engine","slug":"error-reading-batch-part","errorCode":null,"errorMessage":"Error reading batch part ","messagePattern":"Error reading batch part ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetCaseInstanceMigrationBatchResultCmd.java","lineNumber":109,"sourceCode":"\n        partResult.setResult(batchPart.getStatus());\n        if (CaseInstanceBatchMigrationResult.RESULT_FAIL.equals(batchPart.getStatus()) &&\n                batchPart.getResultDocumentJson(engineConfiguration.getEngineCfgKey()) != null) {\n\n            try {\n                JsonNode resultNode = objectMapper.readTree(batchPart.getResultDocumentJson(engineConfiguration.getEngineCfgKey()));\n                if (resultNode.has(BATCH_RESULT_MESSAGE_LABEL)) {\n                    String resultMessage = resultNode.get(BATCH_RESULT_MESSAGE_LABEL).asString();\n                    partResult.setMigrationMessage(resultMessage);\n                }\n                \n                if (resultNode.has(BATCH_RESULT_STACKTRACE_LABEL)) {\n                    String resultStacktrace = resultNode.get(BATCH_RESULT_STACKTRACE_LABEL).asString();\n                    partResult.setMigrationStacktrace(resultStacktrace);\n                }\n\n            } catch (JacksonException e) {\n                throw new FlowableException(\"Error reading batch part \" + batchPart.getId());\n            }\n        }\n        return partResult;\n    }\n\n}\n","sourceCodeStart":91,"sourceCodeEnd":116,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetCaseInstanceMigrationBatchResultCmd.java#L91-L116","documentation":"FlowableException thrown by GetCaseInstanceMigrationBatchResultCmd.convertFromBatchPart when the batch part's JSON result cannot be parsed (JacksonException). The stored batch-part result document is malformed or unreadable, so the engine cannot reconstruct the per-instance migration result.","triggerScenarios":"Reading a case migration batch result whose batch part documents were written by an incompatible engine version or corrupted in storage; batch part contains non-JSON content where a result node was expected.","commonSituations":"Upgrading Flowable across versions where the batch result serialization changed; database rows edited/migrated manually; partial writes from a failed upgrade; copying batch tables between environments with schema drift.","solutions":["Inspect the offending batch part record's RESULT_ content and repair or delete the corrupted row","Re-run the case migration batch so fresh, valid batch parts are written","Confirm the engine version reading the batch matches the one that wrote it; upgrade both together"],"exampleFix":"// before\nBatchPartResult partResult = migrationService\n    .createCaseMigrationBatchResult(batchId).getBatchPartResult(batchPartId);\n// after\ntry {\n    partResult = migrationService.createCaseMigrationBatchResult(batchId)\n        .getBatchPartResult(batchPartId);\n} catch (FlowableException e) {\n    // re-run migration or inspect raw batch part\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"boolean looksLikeJson = batchPart != null && batchPart.getResult() != null && batchPart.getResult().startsWith(\"{\");","tryCatchPattern":"try { partResult = batchResult.getBatchPartResult(batchPartId); } catch (FlowableException e) { log.error(\"corrupt batch part {}, re-run migration\", batchPartId); }","preventionTips":["Keep the engine version that reads batches the same as the one that wrote them","Do not hand-edit batch result tables; re-run migrations instead"],"tags":["cmmn","batch","json-parse","migration"],"backgroundTag":"json-parse-error","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"}