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

  1. Inspect the cause (ioe) in the server log/stacktrace to find the real problem.
  2. Verify database connectivity and that the bytearray storage table exists and is intact.
  3. 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

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/dd63bea36f61791e. Report an issue: GitHub.