{"record":{"id":"b7c91398b1ae993b","repo":"pentaho/pentaho-kettle","slug":"kettleeofexception-wrapping-eofexception-no-message","errorCode":null,"errorMessage":"KettleEOFException wrapping EOFException (no message)","messagePattern":"KettleEOFException wrapping EOFException \\(no message\\)","errorType":"exception","errorClass":"org.pentaho.di.core.exception.KettleEOFException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/RowMeta.java","lineNumber":740,"sourceCode":"    try {\n      nr = inputStream.readInt();\n    } catch ( SocketTimeoutException e ) {\n      throw e;\n    } catch ( EOFException e ) {\n      throw new KettleEOFException(\n        \"End of file while reading the number of metadata values in the row metadata\", e );\n    } catch ( IOException e ) {\n      throw new KettleFileException( \"Unable to read nr of metadata values: \" + e.toString(), e );\n    }\n\n    for ( int i = 0; i < nr; i++ ) {\n      try {\n        int type = inputStream.readInt();\n        ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( type );\n        valueMeta.readMetaData( inputStream );\n        addValueMeta( valueMeta );\n      } catch ( EOFException e ) {\n        throw new KettleEOFException( e );\n      } catch ( Exception e ) {\n        throw new KettleFileException( toString() + \" : Unable to read row metadata from input stream\", e );\n      }\n\n    }\n  }\n\n  @Override\n  public Object[] readData( DataInputStream inputStream ) throws KettleFileException, SocketTimeoutException {\n    lock.readLock().lock();\n    try {\n      Object[] data = new Object[ size() ];\n      for ( int i = 0; i < size(); i++ ) {\n        data[ i ] = getValueMeta( i ).readData( inputStream );\n      }\n      if ( size() == 0 ) {\n        try {\n          inputStream.readBoolean();","sourceCodeStart":722,"sourceCodeEnd":758,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/RowMeta.java#L722-L758","documentation":"Inside the RowMeta(InputStream) constructor loop, each field's type int is read and a value meta created. An EOFException while reading a field's type means the stream ended partway through the metadata — some fields were read but the remaining ones are missing. It is rethrown as a message-less KettleEOFException carrying the EOFException as cause.","triggerScenarios":"Deserializing metadata where the declared field count (nr) exceeds the bytes actually available: sender wrote the header but died before writing all field types; truncated file; peer connection dropped mid-message.","commonSituations":"Network partitions during PDI cluster metadata exchange; partially-written cache files; version mismatch where the receiver misinterprets the sender's serialization format and runs out of bytes early.","solutions":["Verify the sender completed writeMeta successfully — check for paired write-side exceptions or partial sends.","Re-request the metadata over a fresh connection; partial metadata is unusable.","Check PDI version compatibility between sender and receiver so field serialization layouts match.","If reading a file, detect truncation (size vs expected length) and regenerate it."],"exampleFix":"// before\nRowMeta rowMeta = new RowMeta(inputStream); // KettleEOFException mid-fields\n// after\ntry {\n  RowMeta rowMeta = new RowMeta(inputStream);\n} catch (KettleEOFException e) {\n  log.error(\"Metadata stream truncated after some fields\", e);\n  inputStream = reconnect();\n  RowMeta rowMeta = new RowMeta(inputStream);\n}","handlingStrategy":"retry","validationCode":"int expectedBytes = 4 * nrFieldsDeclaredBySender;\nif (inputStream.available() < expectedBytes) { throw new KettleException(\"Insufficient bytes for declared fields\"); }","typeGuard":null,"tryCatchPattern":"try {\n  RowMeta rowMeta = new RowMeta(inputStream);\n} catch (KettleEOFException e) {\n  log.error(\"Stream ended mid-metadata\", e);\n  inputStream = reconnect();\n  RowMeta rowMeta = new RowMeta(inputStream);\n}","preventionTips":["Check sender-side write completion; partial sends corrupt the protocol.","Keep PDI versions aligned so field layouts match.","Frame messages with lengths so truncation is detected immediately."],"tags":["io","eof","deserialization","truncated"],"backgroundTag":"unexpected-eof","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"}