{"record":{"id":"dd63bea36f61791e","repo":"flowable/flowable-engine","slug":"unexpected-exception-getting-variable-data-dd63be","errorCode":null,"errorMessage":"Unexpected exception getting variable data","messagePattern":"Unexpected exception getting variable data","errorType":"http","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/variable/HistoricVariableInstanceDataResource.java","lineNumber":83,"sourceCode":"                result = (byte[]) variable.getValue();\n                response.setContentType(\"application/octet-stream\");\n\n            } else if (CmmnRestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variable.getType())) {\n                ByteArrayOutputStream buffer = new ByteArrayOutputStream();\n                ObjectOutputStream outputStream = new ObjectOutputStream(buffer);\n                outputStream.writeObject(variable.getValue());\n                outputStream.close();\n                result = buffer.toByteArray();\n                response.setContentType(\"application/x-java-serialized-object\");\n\n            } else {\n                throw new FlowableObjectNotFoundException(\"The variable does not have a binary data stream.\", null);\n            }\n            return result;\n\n        } catch (IOException ioe) {\n            // Re-throw IOException\n            throw new FlowableException(\"Unexpected exception getting variable data\", ioe);\n        }\n    }\n}\n","sourceCodeStart":65,"sourceCodeEnd":87,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/variable/HistoricVariableInstanceDataResource.java#L65-L87","documentation":"getVariableData wraps IOException during binary variable retrieval in a generic FlowableException with the message 'Unexpected exception getting variable data'. It indicates the byte stream (file store or database blob) could not be read while serializing/deserializing the variable value.","triggerScenarios":"GET .../historic-variable-instances/{id}/data where reading the underlying byte array throws IOException — database connectivity failure mid-stream, corrupted blob, or ObjectInputStream errors on deserialization.","commonSituations":"DB connection dropped while streaming a large serialized variable; classpath missing the class of a serializable variable value; storage backend misconfigured (e.g. missing blob table).","solutions":["Inspect the cause (ioe) in the server log/stacktrace to find the real problem.","Verify database connectivity and that the bytearray storage table exists and is intact.","If the cause is deserialization, add the variable's value class to the REST app classpath or store data as byte[] instead of custom serializables."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { data = fetch(url) } catch (e) { if (e.flowableType === 'FlowableException') { logServerError(e); retryOnce(); } else { throw e } }","preventionTips":["Keep the serialized value's classes on the REST app classpath.","Monitor DB connectivity; read the server-side cause of the wrapped IOException.","Prefer byte[] over custom Serializable variables for cross-JVM access."],"tags":["io","serialization","variables"],"backgroundTag":"file-read-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}