{"record":{"id":"ecf02e4270900f28","repo":"flowable/flowable-engine","slug":"error-reading-batch-part-ecf02e","errorCode":null,"errorMessage":"Error reading batch part ","messagePattern":"Error reading batch part ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetProcessInstanceMigrationBatchResultCmd.java","lineNumber":108,"sourceCode":"        partResult.setResult(batchPart.getStatus());\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();\n        if (ProcessInstanceBatchMigrationResult.RESULT_FAIL.equals(batchPart.getStatus()) && \n                batchPart.getResultDocumentJson(processEngineConfiguration.getEngineCfgKey()) != null) {\n            \n            try {\n                JsonNode resultNode = objectMapper.readTree(batchPart.getResultDocumentJson(processEngineConfiguration.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        \n        return partResult;\n    }\n}\n","sourceCodeStart":90,"sourceCodeEnd":115,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetProcessInstanceMigrationBatchResultCmd.java#L90-L115","documentation":"Thrown by GetProcessInstanceMigrationBatchResultCmd.convertFromBatchPart when parsing a process instance migration batch part's JSON result fails with a JacksonException. The batch part document could not be read, so the command aborts instead of returning a partially populated BatchPartResult. The original Jackson message is discarded, which makes this error opaque unless the batch part document itself is inspected.","triggerScenarios":"Calling the migration batch result API (ProcessInstanceMigrationService.getBatchResult / runtimeService batch result command) when a batch part document in the batch part table is missing, corrupt, or contains JSON that does not match the expected structure (e.g. missing/invalid batch result fields).","commonSituations":"Corrupted ACT_RU_BATCH_PART rows after a database restore or manual data migration; a Flowable version upgrade changing the batch result JSON shape while old parts remain; direct manipulation of the batch part JSON document; deserialization of a result containing unexpected node types (e.g. an array where an object is expected).","solutions":["Query the batch part table (ACT_RU_BATCH_PART / FlowableBatchPart) for the offending batchPart.getId() and inspect/repair its result JSON document.","Delete the corrupt batch part (or the whole batch) and re-run the process instance migration to regenerate clean batch parts.","Check for a Flowable version mismatch between the engine that wrote the batch parts and the one reading them; align versions or migrate the batch data.","If you control the code, log the caught JacksonException (or chain it: new FlowableException(msg, e)) to expose the underlying parse failure."],"exampleFix":"// before\n} catch (JacksonException e) {\n    throw new FlowableException(\"Error reading batch part \" + batchPart.getId());\n}\n// after\n} catch (JacksonException e) {\n    throw new FlowableException(\"Error reading batch part \" + batchPart.getId(), e);\n}","handlingStrategy":"try-catch","validationCode":"// verify the batch part is readable before requesting the result\nBatchPart part = managementService.getBatchPart(batchPartId); // non-null means part exists\nif (part == null) { throw new IllegalStateException(\"Batch part \" + batchPartId + \" missing/corrupt\"); }","typeGuard":null,"tryCatchPattern":"try {\n    migrationService.getBatchResult(batchId);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Error reading batch part\")) {\n        // inspect/repair batch part document or re-run the migration\n    }\n}","preventionTips":["Do not hand-edit batch part rows in the database.","Keep the Flowable engine version uniform across nodes sharing the same database.","Include the cause when rethrowing so future failures are diagnosable.","Monitor for interrupted migrations and clean up orphaned/corrupt batch parts."],"tags":["json","batch","process-migration","flowable"],"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"}