pentaho/pentaho-kettle · error · KettleEOFException
Error reading value data from stream
Error message
Error reading value data from stream
What it means
This KettleEOFException (with message 'Error reading value data from stream') is thrown by Value.readObj when any non-EOF exception occurs while reading the value's type-specific payload from the stream. Unlike the truncation case, this indicates a format/corruption problem: bad length prefixes, invalid primitives, or mismatched serialization versions.
Solutions
- Re-align the stream to a valid record boundary before deserializing (store/seek to known offsets).
- Match writer and reader PDI versions; re-export the file if formats changed.
- Validate file integrity with checksums; regenerate corrupted data.
- Ensure only one consumer reads the stream and no external code repositions it.
- Log e.getCause() when catching KettleEOFException to identify which primitive read failed and fix the writer accordingly.
Example fix
// before in.skip( guessedOffset ); Value v = new Value( in ); // mid-record -> error // after long offset = rowOffsets.get( rowIndex ); // offsets recorded at write time in.skip( offset ); Value v = new Value( in );
Defensive patterns
Strategy: try-catch
Validate before calling
// verify integrity before deserialization if ( !checksumMatches( file, expectedSha256 ) ) throw new IOException( "Corrupt data file: " + file );
Try / catch
try {
Value v = new Value( in );
} catch ( KettleEOFException e ) {
// non-EOF cause wrapped: corruption or format mismatch
throw new IOException( "Bad value record at offset " + bytesRead + ": " + e.getCause(), e );
} Prevention
- Record row offsets at write time instead of guessing seek positions.
- Version-stamp serialized files and check on read.
- Never share one InputStream between independent readers.
- Verify checksums before reading.
- Keep writer/reader Kettle versions compatible.
When it happens
Trigger: Value.readObj encountering invalid data mid-value: corrupted length fields causing negative/huge array reads, wrong UTF data, incompatible wire format from a different Kettle version, or reading a stream positioned in the middle of a record.
Common situations: Random-access reads landing mid-record; files written by newer/older PDI versions; bit-rotted archives; mixing binary and text streams; seeking with a wrong offset into a Kettle data file.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- End of file reached
- End of file reached while reading value
- Error reading from data input stream
- End of file while reading the number of metadata values in…
- KettleEOFException wrapping EOFException (no message)
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/cbe7f0560b0c87a7.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/compatibility/Value.java:1777
}
break;
case VALUE_TYPE_NUMBER:
setValue( dis.readDouble() );
break;
case VALUE_TYPE_INTEGER:
setValue( dis.readLong() );
break;
case VALUE_TYPE_BOOLEAN:
setValue( dis.readBoolean() );
break;
default:
break;
}
}
} catch ( EOFException e ) {
throw new KettleEOFException( "End of file reached while reading value", e );
} catch ( Exception e ) {
throw new KettleEOFException( "Error reading value data from stream", e );
}
}
/**
* Compare 2 values of the same or different type! The comparison of Strings is case insensitive
*
* @param v
* the value to compare with.
* @return -1 if The value was smaller, 1 bigger and 0 if both values are equal.
*/
public int compare( Value v ) {
return compare( v, true );
}
/**
* Compare 2 values of the same or different type!
*
* @param vView on GitHub (pinned to f3058517a1)