{"record":{"id":"78b7a69826a70169","repo":"pentaho/pentaho-kettle","slug":"error-de-serializing-row-of-data-from-byte-array","errorCode":null,"errorMessage":"Error de-serializing row of data from byte array","messagePattern":"Error de-serializing row of data from byte array","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/RowMeta.java","lineNumber":1147,"sourceCode":"    } catch ( Exception e ) {\n      throw new RuntimeException( \"Error serializing row to byte array\", e );\n    }\n  }\n\n  /**\n   * Create a row of data bases on a serialized format (byte[])\n   *\n   * @param data     the serialized data\n   * @param metadata the metadata to use\n   * @return a new row of data\n   */\n  public static Object[] getRow( RowMetaInterface metadata, byte[] data ) {\n    try {\n      ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( data );\n      DataInputStream dataInputStream = new DataInputStream( byteArrayInputStream );\n      return metadata.readData( dataInputStream );\n    } catch ( Exception e ) {\n      throw new RuntimeException( \"Error de-serializing row of data from byte array\", e );\n    }\n  }\n\n  public static Row createOriginalRow( RowMetaInterface rowMeta, Object[] rowData ) throws KettleValueException {\n    Row row = new Row();\n\n    for ( int i = 0; i < rowMeta.size(); i++ ) {\n      ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );\n      Object valueData = rowData[ i ];\n\n      Value value = valueMeta.createOriginalValue( valueData );\n      row.addValue( value );\n    }\n\n    return row;\n  }\n\n  /**","sourceCodeStart":1129,"sourceCodeEnd":1165,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/RowMeta.java#L1129-L1165","documentation":"RowMeta.getRow(RowMetaInterface, byte[]) deserializes a byte[] back into an Object[] row. Any exception during metadata.readData (truncated/corrupt data, format mismatch) is wrapped in a RuntimeException with this message, keeping the original as cause.","triggerScenarios":"Calling RowMeta.getRow() with a byte[] that was not produced by the matching RowMeta.getData() (different row layout, truncated buffer, wrong serialization version).","commonSituations":"Replaying stored binary payloads after the row structure changed; mixing cluster nodes on different Kettle versions; manually editing or truncating serialized rows.","solutions":["Verify the byte[] was produced by RowMeta.getData() with an identical RowMetaInterface layout","Check e.getCause() (often EOFException or KettleFileException) for the exact read failure","Ensure all nodes/steps run the same PDI version","Re-serialize the data from the original source instead of reusing stale bytes"],"exampleFix":"// before\nObject[] row = RowMeta.getRow(otherMeta, storedBytes); // meta differs from producer\n// after\nObject[] row = RowMeta.getRow(producerMeta, storedBytes); // use the same meta used to serialize","handlingStrategy":"try-catch","validationCode":"// Java: only deserialize bytes produced by RowMeta.getData with the same meta\nif (data == null || data.length == 0) throw new IllegalArgumentException(\"empty payload\");\n// compare layout checksums if you store them alongside the payload","typeGuard":null,"tryCatchPattern":"try {\n  Object[] row = RowMeta.getRow(meta, data);\n} catch (RuntimeException e) {\n  Throwable cause = e.getCause(); // usually EOFException / KettleFileException\n  throw new IllegalStateException(\"Row deserialization failed: \" + cause, cause);\n}","preventionTips":["Never reuse stale serialized bytes after changing the row layout","Include the RowMeta (or its XML) alongside stored binary rows","Pin the same PDI version on all cluster nodes","Round-trip test serialize->deserialize in CI when relying on binary row format"],"tags":["deserialization","row-metadata","kettle"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}