flowable/flowable-engine · error · FlowableException
Unexpected exception getting variable data
Error message
Unexpected exception getting variable data
What it means
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.
Source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/variable/HistoricVariableInstanceDataResource.java:83
result = (byte[]) variable.getValue();
response.setContentType("application/octet-stream");
} else if (CmmnRestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variable.getType())) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutputStream outputStream = new ObjectOutputStream(buffer);
outputStream.writeObject(variable.getValue());
outputStream.close();
result = buffer.toByteArray();
response.setContentType("application/x-java-serialized-object");
} else {
throw new FlowableObjectNotFoundException("The variable does not have a binary data stream.", null);
}
return result;
} catch (IOException ioe) {
// Re-throw IOException
throw new FlowableException("Unexpected exception getting variable data", ioe);
}
}
}
View on GitHub (pinned to d6d39ce1c6)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try { data = fetch(url) } catch (e) { if (e.flowableType === 'FlowableException') { logServerError(e); retryOnce(); } else { throw e } } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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).
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- Error getting variable ${variable.getName()}
- Unexpected exception getting variable data
- Unexpected exception getting variable data
- Error getting variable " + variableName
- Error getting variable ${variableName}
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/dd63bea36f61791e.
Report an issue: GitHub.