pentaho/pentaho-kettle · error · KettleException

Trans.Exception.NoTransnameAvailableForLogging

Error message

Trans.Exception.NoTransnameAvailableForLogging

What it means

Database transaction logging needs the transformation name to identify rows in the log table. If a log table is configured but the transformation name is empty (e.g. an unnamed/ad-hoc Trans object), Trans throws KettleException with Trans.Exception.NoTransnameAvailableForLogging. It protects the log table from rows without a transformation identifier.

Solutions

  1. Set a transformation name: transMeta.setName("MyTransform") before creating/executing the Trans
  2. If loading from XML, confirm the <info><name> element is non-empty
  3. Skip transaction logging (remove the log table config) if names are not applicable

Example fix

// before
TransMeta meta = new TransMeta();
Trans trans = new Trans(meta);
// after
TransMeta meta = new TransMeta();
meta.setName("NightlyETL");
Trans trans = new Trans(meta);
Defensive patterns

Strategy: validation

Validate before calling

if (transMeta.getTransLogTable().getTableName() != null &&
    (transMeta.getName() == null || transMeta.getName().isEmpty())) {
  transMeta.setName("Unnamed-Transformation-" + System.currentTimeMillis());
}

Try / catch

try {
  trans.execute(args);
} catch (KettleException e) {
  if (e.getMessage().contains("NoTransnameAvailableForLogging")) {
    transMeta.getTransMeta().setName("default"); // then retry
  } else throw e;
}

Prevention

When it happens

Trigger: init() with a non-empty log table but transMeta.getName() returning null/empty - typically a Trans built from an unnamed TransMeta or executed without setting a name.

Common situations: Programmatic execution: new Trans(new TransMeta()) without transMeta.setName("..."); transformations loaded from stream without a name; renamed/unsaved transformations.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

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

    logDate = new Date();
    startDate = Const.MIN_DATE;
    endDate = currentDate;

    DatabaseMeta logConnection = transLogTable.getDatabaseMeta();
    String logTable = environmentSubstitute( transLogTable.getActualTableName() );
    String logSchema = environmentSubstitute( transLogTable.getActualSchemaName() );

    try {
      if ( logConnection != null ) {

        String logSchemaAndTable = logConnection.getQuotedSchemaTableCombination( logSchema, logTable );
        if ( Utils.isEmpty( logTable ) ) {
          // It doesn't make sense to start database logging without a table
          // to log to.
          throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.NoLogTableDefined" ) );
        }
        if ( Utils.isEmpty( transMeta.getName() ) && logTable != null ) {
          throw new KettleException( BaseMessages.getString( PKG, "Trans.Exception.NoTransnameAvailableForLogging" ) );
        }
        transLogTableDatabaseConnection = new Database( this, logConnection );
        transLogTableDatabaseConnection.shareVariablesWith( this );
        if ( log.isDetailed() ) {
          log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.OpeningLogConnection", "" + logConnection ) );
        }
        transLogTableDatabaseConnection.connect();
        transLogTableDatabaseConnection.setCommit( logCommitSize );

        // See if we have to add a batch id...
        // Do this first, before anything else to lock the complete table exclusively
        //
        if ( transLogTable.isBatchIdUsed() ) {
          Long id_batch =
            logConnection.getNextBatchId( transLogTableDatabaseConnection, logSchema, logTable, transLogTable
              .getKeyField().getFieldName() );
          setBatchId( id_batch.longValue() );
        }

View on GitHub (pinned to f3058517a1)