pentaho/pentaho-kettle · error · KettleException

Trans.Exception.ErrorWritingStepPerformanceLogRecordToTable

Error message

Trans.Exception.ErrorWritingStepPerformanceLogRecordToTable

What it means

Thrown when writing the step performance log rows to the step performance log table fails (or when cleaning up those records at transformation end fails). Trans wraps any exception from the performance log database write into a KettleException. The root database error is attached as the cause.

Solutions

  1. Read the chained cause for the underlying SQL/connection failure and repair it (connection, credentials, network)
  2. Verify the Step Performance Log settings: connection, schema and table name exist and match your PDI version's expected columns
  3. Check the DB user has INSERT/DELETE privileges on the performance log table (cleanup deletes rows at END)
  4. If performance logging is not needed, disable it in transformation properties to avoid the write entirely

Example fix

// before: performance log table removed manually
DROP TABLE step_performance;
// after: recreate the table per PDI schema or disable step performance logging
Transformation > Logging > Step Performance Log: disabled
Defensive patterns

Strategy: try-catch

Validate before calling

StepPerformanceLogTable perf = transMeta.getPerformanceLogTable();
if (perf.getDatabaseMeta() != null) {
  try (Database db = new Database(trans, perf.getDatabaseMeta())) {
    db.connect();
    // optionally check table exists: db.getTableFields(perf.getActualTableName())
  }
}

Type guard

if (transMeta.getPerformanceLogTable() == null || transMeta.getPerformanceLogTable().getDatabaseMeta() == null) { /* no perf logging: nothing to validate */ }

Try / catch

try {
  trans.waitUntilFinished();
} catch (Exception e) {
  if (e instanceof KettleException && e.getMessage().contains("ErrorWritingStepPerformanceLogRecordToTable")) {
    handlePerfLogFailure(e.getCause());
  } else { throw e; }
}

Prevention

When it happens

Trigger: trans.execute()/endProcessing with a StepPerformanceLogTable configured and the insert of performance rows (or ldb.cleanupLogRecords at LogStatus.END) throws.

Common situations: Performance log table missing or wrong schema, performance log database connection broken, table permissions denied, or interval-based writes hitting a dead connection mid-run.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/Trans.java:2972

                ldb.setValuesInsert( row.getRowMeta(), row.getData() );
                ldb.insertRow( true );
              }
              lastSeqNr = snapshot.getSeqNr();
            }
          }
        }
      }

      ldb.insertFinished( true );

      // Finally, see if the log table needs cleaning up...
      //
      if ( status.equals( LogStatus.END ) ) {
        ldb.cleanupLogRecords( performanceLogTable, getName() );
      }

    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG,
        "Trans.Exception.ErrorWritingStepPerformanceLogRecordToTable" ), e );
    } finally {
      if ( ldb != null ) {
        ldb.close();
      }
    }

    return lastSeqNr + 1;
  }

  /**
   * Close unique database connections. If there are errors in the Result, perform a rollback
   *
   * @param result the result of the transformation execution
   */
  private void closeUniqueDatabaseConnections( Result result ) {

    // Don't close any connections if the parent job is using the same transaction

View on GitHub (pinned to f3058517a1)