{"record":{"id":"028d1034dfba6188","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-value-data-from-input-stream","errorCode":null,"errorMessage":" : Unable to read value data from input stream","messagePattern":" : Unable to read value data from input stream","errorType":"exception","errorClass":"KettleFileException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":2841,"sourceCode":"              throw new KettleFileException( toString() + \" : Unable to de-serialize data of type \" + getType() );\n          }\n\n        case STORAGE_TYPE_BINARY_STRING:\n          return readBinaryString( inputStream );\n\n        case STORAGE_TYPE_INDEXED:\n          return readSmallInteger( inputStream ); // just an index: 4-bytes should\n          // be enough.\n\n        default:\n          throw new KettleFileException( toString() + \" : Unknown storage type \" + getStorageType() );\n      }\n    } catch ( EOFException e ) {\n      throw new KettleEOFException( e );\n    } catch ( SocketTimeoutException e ) {\n      throw e;\n    } catch ( IOException e ) {\n      throw new KettleFileException( toString() + \" : Unable to read value data from input stream\", e );\n    }\n  }\n\n  protected void writeString( DataOutputStream outputStream, String string ) throws IOException {\n    // Write the length and then the bytes\n    if ( string == null ) {\n      outputStream.writeInt( -1 );\n    } else {\n      byte[] chars = string.getBytes( Const.XML_ENCODING );\n      outputStream.writeInt( chars.length );\n      outputStream.write( chars );\n    }\n  }\n\n  protected void writeBinaryString( DataOutputStream outputStream, byte[] binaryString ) throws IOException {\n    // Write the length and then the bytes\n    if ( binaryString == null ) {\n      outputStream.writeInt( -1 );","sourceCodeStart":2823,"sourceCodeEnd":2859,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L2823-L2859","documentation":"KettleFileException thrown by ValueMetaBase.readData wrapping an IOException (other than EOF/SocketTimeout, which map to KettleEOFException/rethrow): value data could not be read from the DataInputStream. The stream failed mid-read due to an I/O fault.","triggerScenarios":"readData() called on a DataInputStream from a socket or file that broke, was closed, or hit a device error while reading the row bytes.","commonSituations":"Cluster streaming where the peer node died or the network dropped; truncated/corrupt Kettle serialized file; concurrent closing of the input stream.","solutions":["Inspect the wrapped cause (e.getCause()) for the root I/O error","Validate stream/network health and re-establish the connection, then retry the transfer from a known checkpoint","Check the source file for truncation/corruption and regenerate it"],"exampleFix":"// before\nObject v = valueMeta.readData(inputStream); // network dropped mid-row\n// after\ntry {\n  Object v = valueMeta.readData(inputStream);\n} catch (KettleFileException e) {\n  reconnect(); inputStream = openStream(); // retry from checkpoint\n}","handlingStrategy":"try-catch","validationCode":"// Pre-flight the input stream:\nif (inputStream == null) throw new IllegalStateException(\"Input stream is closed\");\n// available() > 0 on socket streams indicates data is present before a read attempt","typeGuard":null,"tryCatchPattern":"try {\n  Object v = valueMeta.readData(in);\n} catch (KettleEOFException eof) {\n  // clean end of stream: stop reading, no retry\n} catch (KettleFileException e) {\n  if (e.getCause() instanceof IOException) {\n    LOG.error(\"Stream read failed for field \" + valueMeta.getName() + \": \" + e.getCause().getMessage());\n    reconnectAndReopenStream(); // re-establish and resume from checkpoint\n  } else { throw e; }\n}","preventionTips":["Distinguish KettleEOFException (normal end) from KettleFileException (I/O fault) when reading rows","Add heartbeat/keep-alive on cluster socket streams to detect dead peers early","Verify file integrity (size/checksum) before reading Kettle-serialized files","Avoid concurrent reads/closes on the same stream from multiple threads"],"tags":["kettle","pdi","ioexception","deserialization","stream"],"backgroundTag":"file-read-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"}