pentaho/pentaho-kettle · error · KettleException

Trans.Exception.UnableToWriteMetricsInformationToLogTable

Error message

Trans.Exception.UnableToWriteMetricsInformationToLogTable

What it means

Thrown by Trans.writeMetricsLogInformation() when writing transformation metric records to the configured performance/metrics log table fails, or when its cleanupLogRecords() call fails. Metrics logging records run/status metrics per execution; an error there is wrapped as UnableToWriteMetricsInformationToLogTable.

Solutions

  1. Inspect the cause to find the failing statement and fix the underlying database error.
  2. Create or recreate the metrics log table using the DDL generated in the Log tab.
  3. Archive/purge old metrics rows to reduce lock contention and timeouts on very large tables.
  4. Grant the log user INSERT/DELETE privileges on the metrics log table, or disable metrics logging if unused.

Example fix

// before: metrics_log missing
KettleException: UnableToWriteMetricsInformationToLogTable
// after: run generated DDL for metrics_log from the Log tab, then re-run
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the metrics log table exists and is not oversized before the run
Database db = new Database(trans, metricsLogTable.getDatabaseMeta());
db.connect();
if (!db.checkTableExists("METRICS_LOG")) throw new IllegalStateException("METRICS_LOG missing");

Try / catch

try {
  trans.waitUntilFinished();
} catch (KettleException e) {
  log.error("Metrics logging failed; check METRICS_LOG table and connection", e.getCause());
}

Prevention

When it happens

Trigger: writeMetricsLogInformation() writes metric rows into the metrics log table (typically at begin/end processing) and then db.cleanupLogRecords(metricsLogTable, getName()); any Exception is wrapped in this message.

Common situations: Performance metrics log table configured but never created; schema drift after PDI upgrade; metrics table grew too large causing write timeouts/lock contention; DB connection dropped during the run.

Related errors


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

Appendix: source

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

        Map<String, MetricsSnapshotInterface> snapshotMap =
          MetricsRegistry.getInstance().getSnapshotMaps().get( logChannelId );
        if ( snapshotMap != null ) {
          synchronized ( snapshotMap ) {
            Iterator<MetricsSnapshotInterface> iterator = snapshotMap.values().iterator();
            while ( iterator.hasNext() ) {
              MetricsSnapshotInterface snapshot = iterator.next();
              db.writeLogRecord( metricsLogTable, LogStatus.START, new LoggingMetric( batchId, snapshot ), null );
            }
          }
        }
      }

      // Also time-out the log records in here...
      //
      db.cleanupLogRecords( metricsLogTable, getName() );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG,
        "Trans.Exception.UnableToWriteMetricsInformationToLogTable" ), e );
    } finally {
      disconnectDb( db );
    }
  }

  private void disconnectDb( Database db ) throws KettleDatabaseException {
    if ( db == null ) {
      return;
    }
    if ( !db.isAutoCommit() ) {
      db.commit( true );
    }
    db.close();
  }

  /**
   * Gets the result of the transformation. The Result object contains such measures as the number of errors, number of

View on GitHub (pinned to f3058517a1)