flowable/flowable-engine · error · FlowableException

Unexpected error getting variable data

Error message

Unexpected error getting variable data

What it means

Generic FlowableException wrapping an IOException that occurred while serializing the variable value to the binary response stream in getVariableData. It indicates an I/O problem (e.g. writing the serialized object failed) rather than a validation problem. The original IOException is attached as the cause.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskVariableDataResource.java:84

                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 error getting variable data", ioe);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Inspect the cause IOException in server logs for the root serialization problem
  2. Ensure the variable's value class implements Serializable with a stable serialVersionUID
  3. Re-save the variable with a valid serializable or byte-array value
  4. Fall back to reading the variable via the JSON variable endpoint
Defensive patterns

Strategy: try-catch

Try / catch

try { return await api.get(url, { responseType: 'arraybuffer' }); }
catch (e) { log.error('variable data fetch failed', e); return fallbackViaJsonEndpoint(name); }

Prevention

When it happens

Trigger: GET /cmmn-runtime/tasks/{taskId}/variables/{name}/data where ObjectOutputStream.writeObject or the underlying ByteArrayOutputStream throws IOException — typically serialization of an object whose class is broken or not serializable at write time.

Common situations: Non-serializable object stored as a variable value in an older engine version; JVM serialization issues after class changes; stream closed prematurely.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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