{"record":{"id":"8b0b8608cb9e3b77","repo":"flowable/flowable-engine","slug":"deserialized-value-is-not-an-array-of-id-s","errorCode":null,"errorMessage":"Deserialized value is not an array of ID's: ","messagePattern":"Deserialized value is not an array of ID's: ","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/JPAEntityListVariableType.java","lineNumber":163,"sourceCode":"            String[] toStore = ids.toArray(new String[] {});\n            ByteArrayOutputStream baos = new ByteArrayOutputStream();\n            ObjectOutputStream out = new ObjectOutputStream(baos);\n\n            out.writeObject(toStore);\n            return baos.toByteArray();\n        } catch (IOException ioe) {\n            throw new FlowableException(\"Unexpected exception when serializing JPA id's\", ioe);\n        }\n    }\n\n    protected String[] deserializeIds(byte[] bytes) {\n        try {\n            ByteArrayInputStream bais = new ByteArrayInputStream(bytes);\n            ObjectInputStream in = new ObjectInputStream(bais);\n\n            Object read = in.readObject();\n            if (!(read instanceof String[])) {\n                throw new FlowableIllegalArgumentException(\"Deserialized value is not an array of ID's: \" + read);\n            }\n\n            return (String[]) read;\n        } catch (IOException | ClassNotFoundException ioe) {\n            throw new FlowableException(\"Unexpected exception when deserializing JPA id's\", ioe);\n        }\n    }\n\n}\n","sourceCodeStart":145,"sourceCodeEnd":173,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/JPAEntityListVariableType.java#L145-L173","documentation":"When reading a JPA entity list variable back, deserializeIds Java-deserializes the stored bytes and requires the result to be a String[]. If the deserialized object is anything else, FlowableIllegalArgumentException is thrown.","triggerScenarios":"getValue → ids → deserializeIds encountering stored bytes that decode to a non-String[] object: bytes written by an older Flowable version with a different format, manual corruption, or bytes written for a different variable type.","commonSituations":"Upgrading Flowable where the persisted variable byte format changed; manually editing variable byte values in DB; reusing a variable name across incompatible value types.","solutions":["Inspect the stored BYTE value in the variable table and delete/repair the corrupted variable","Re-set the variable with a valid list of JPA entities to rewrite correct bytes","Check Flowable upgrade notes for variable serialization format changes and migrate data","Ensure no other code writes to the same variable byte array"],"exampleFix":"// before\n// legacy variable row with non-String[] bytes\nSELECT BYTES_ FROM ACT_RU_VARIABLE WHERE NAME_='customers'; -- inspect\n// after\nruntimeService.setVariable(executionId, \"customers\", validEntityList); // rewrites bytes","handlingStrategy":"validation","validationCode":"// inspect persisted bytes before reading the variable\nbyte[] bytes = readVariableBytesFromDb(\"customers\");\nboolean looksValid = bytes != null && bytes.length > 0;","typeGuard":null,"tryCatchPattern":"try { Object v = runtimeService.getVariable(executionId, \"customers\"); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().startsWith(\"Deserialized value is not an array of ID's\")) { runtimeService.setVariable(executionId, \"customers\", null); } else throw e; }","preventionTips":["Never hand-edit variable byte columns in the DB","Review serialization-format changes when upgrading Flowable and migrate data","Keep one value type per variable name — don't reuse a name across entity-list and scalar values"],"tags":["jpa","deserialization","data-corruption","flowable"],"backgroundTag":"unexpected-response-shape","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"}