pentaho/pentaho-kettle · error · org.pentaho.di.core.exception.KettleFileException

: Unable to read the marker flag data from input stream

Error message

${toString()} : Unable to read the marker flag data from input stream

What it means

In readData, a generic IOException (not EOF, not socket timeout) while reading the empty-row marker boolean is wrapped in KettleFileException "<rowMeta.toString()> : Unable to read the marker flag data from input stream". This signals a transport-level fault while reading the one-byte empty-row marker.

Solutions

  1. Inspect the exception message and chained IOException to identify the transport fault.
  2. Re-establish the connection or reopen the file and retry the read.
  3. For sockets, configure keep-alive and read timeouts; treat SocketTimeoutException (rethrown) separately as retryable.
  4. Regenerate the data file if it is corrupt or unreadable.

Example fix

// before
Object[] row = rowMeta.readData(inputStream);
// after
try {
  Object[] row = rowMeta.readData(inputStream);
} catch (KettleFileException e) {
  log.error("Marker flag read failed: " + e.getMessage(), e);
  inputStream = reconnect();
  Object[] row = rowMeta.readData(inputStream);
}
Defensive patterns

Strategy: retry

Validate before calling

if (inputStream instanceof SocketInputStream && !socket.isConnected() || socket.isClosed()) { reconnect(); }

Try / catch

try {
  Object[] row = rowMeta.readData(inputStream);
} catch (KettleFileException e) {
  if (e.getCause() instanceof SocketTimeoutException) { retryWithBackoff(); }
  else { reconnect(); }
}

Prevention

When it happens

Trigger: RowMeta.readData(inputStream) with size()==0 metadata where readBoolean throws connection reset, SSL error, or file I/O error instead of a clean EOF or timeout.

Common situations: Network resets during PDI slave-server row streaming; TLS failures on long-lived connections; corrupt or unreadable serialized data files.

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


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/054d9b479740a3c0. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/RowMeta.java:764

  }

  @Override
  public Object[] readData( DataInputStream inputStream ) throws KettleFileException, SocketTimeoutException {
    lock.readLock().lock();
    try {
      Object[] data = new Object[ size() ];
      for ( int i = 0; i < size(); i++ ) {
        data[ i ] = getValueMeta( i ).readData( inputStream );
      }
      if ( size() == 0 ) {
        try {
          inputStream.readBoolean();
        } catch ( EOFException e ) {
          throw new KettleEOFException( e );
        } catch ( SocketTimeoutException e ) {
          throw e;
        } catch ( IOException e ) {
          throw new KettleFileException( toString() + " : Unable to read the marker flag data from input stream", e );
        }

      }
      return data;
    } finally {
      lock.readLock().unlock();
    }
  }

  @Override
  public void clear() {
    lock.writeLock().lock();
    try {
      valueMetaList.clear();
      cache.invalidate();
      needRealClone = null;
    } finally {
      lock.writeLock().unlock();

View on GitHub (pinned to f3058517a1)