pentaho/pentaho-kettle · error · KettleFileException
Error reading from data input stream
Error message
Error reading from data input stream
What it means
This KettleFileException is thrown by the Value(InputStream) constructor when readObj() fails with any exception other than EOFException during deserialization. It signals a corruption or format problem while reading the serialized Value (bad type tag, invalid UTF data, unexpected primitive, etc.) rather than a simple end-of-stream.
Solutions
- Verify the stream contains genuine Kettle-serialized Value data (check file header/magic and provenance).
- Ensure writer and reader use compatible Pentaho/Kettle versions; re-export the data if formats differ.
- Check for compression/encryption — wrap the stream in the matching GZIPInputStream/CipherInputStream before passing it in.
- Validate the file integrity (checksum) and regenerate it if corrupted.
- Catch KettleFileException and log the underlying cause (e.getCause()) to pinpoint which primitive read failed.
Example fix
// before
Value v = new Value( new FileInputStream( file ) ); // may throw KettleFileException
// after
try ( InputStream in = new GZIPInputStream( new FileInputStream( file ) ) ) {
Value v = new Value( in );
} catch ( KettleFileException e ) {
throw new IOException( "Corrupt or incompatible value data in " + file, e );
} Defensive patterns
Strategy: try-catch
Validate before calling
// sanity-check the source before deserializing File f = new File( path ); if ( !f.isFile() || f.length() == 0 ) throw new IOException( "Missing or empty data file: " + path ); // verify checksum recorded at write time if ( expectedMd5 != null && !md5Of( f ).equals( expectedMd5 ) ) throw new IOException( "Checksum mismatch: " + path );
Type guard
boolean looksLikeKettleBinary( InputStream in ) throws IOException {
in.mark( 16 );
int b = in.read();
in.reset();
return b != -1; // plus any known magic-byte check for your format
} Try / catch
try {
Value v = new Value( in );
} catch ( KettleFileException e ) {
throw new IOException( "Corrupt/incompatible value data: " + e.getCause(), e );
} Prevention
- Verify file provenance and format before deserialization.
- Wrap compressed/encrypted streams with the correct stream decorators.
- Align serialization format versions between writer and reader.
- Record and check checksums on data files.
- Log e.getCause() to identify the failing primitive read.
When it happens
Trigger: new Value( InputStream ) when the stream bytes do not match the expected Value serialization format: corrupted data files, wrong file type passed in, a writer using an incompatible serialization version, or encrypted/compressed data read as raw.
Common situations: Pointing the reader at a non-Kettle file; reading a file written by a different PDI version with a changed wire format; bit-rot or partial gzip decompression feeding the stream; passing a plain-text stream instead of a DataInputStream-compatible binary stream.
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
- Error reading value data from stream
- End of file reached
- End of file reached while reading value
- 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/78ead176c96e7cae.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/compatibility/Value.java:1641
}
}
}
/**
* Read the Value, including meta-data from a DataInputStream
*
* @param is
* The InputStream to read the value from
* @throws KettleFileException
* when the Value couldn't be created by reading it from the DataInputStream.
*/
public Value( InputStream is ) throws KettleFileException {
try {
readObj( new DataInputStream( is ) );
} catch ( EOFException e ) {
throw new KettleEOFException( "End of file reached", e );
} catch ( Exception e ) {
throw new KettleFileException( "Error reading from data input stream", e );
}
}
/**
* Write the data of this Value, without the meta-data to a DataOutputStream
*
* @param dos
* The DataOutputStream to write the data to
* @return true if all went well, false if something went wrong.
*/
public boolean writeData( DataOutputStream dos ) throws KettleFileException {
try {
// Is the value NULL?
dos.writeBoolean( isNull() );
// Handle Content -- only when not NULL
if ( !isNull() ) {
switch ( getType() ) {View on GitHub (pinned to f3058517a1)