{"record":{"id":"d261a839684a7e24","repo":"pentaho/pentaho-kettle","slug":"trans-exception-notransnameavailableforlogging","errorCode":null,"errorMessage":"Trans.Exception.NoTransnameAvailableForLogging","messagePattern":"Trans\\.Exception\\.NoTransnameAvailableForLogging","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":2266,"sourceCode":"    logDate = new Date();\n    startDate = Const.MIN_DATE;\n    endDate = currentDate;\n\n    DatabaseMeta logConnection = transLogTable.getDatabaseMeta();\n    String logTable = environmentSubstitute( transLogTable.getActualTableName() );\n    String logSchema = environmentSubstitute( transLogTable.getActualSchemaName() );\n\n    try {\n      if ( logConnection != null ) {\n\n        String logSchemaAndTable = logConnection.getQuotedSchemaTableCombination( logSchema, logTable );\n        if ( Utils.isEmpty( logTable ) ) {\n          // It doesn't make sense to start database logging without a table\n          // to log to.\n          throw new KettleTransException( BaseMessages.getString( PKG, \"Trans.Exception.NoLogTableDefined\" ) );\n        }\n        if ( Utils.isEmpty( transMeta.getName() ) && logTable != null ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"Trans.Exception.NoTransnameAvailableForLogging\" ) );\n        }\n        transLogTableDatabaseConnection = new Database( this, logConnection );\n        transLogTableDatabaseConnection.shareVariablesWith( this );\n        if ( log.isDetailed() ) {\n          log.logDetailed( BaseMessages.getString( PKG, \"Trans.Log.OpeningLogConnection\", \"\" + logConnection ) );\n        }\n        transLogTableDatabaseConnection.connect();\n        transLogTableDatabaseConnection.setCommit( logCommitSize );\n\n        // See if we have to add a batch id...\n        // Do this first, before anything else to lock the complete table exclusively\n        //\n        if ( transLogTable.isBatchIdUsed() ) {\n          Long id_batch =\n            logConnection.getNextBatchId( transLogTableDatabaseConnection, logSchema, logTable, transLogTable\n              .getKeyField().getFieldName() );\n          setBatchId( id_batch.longValue() );\n        }","sourceCodeStart":2248,"sourceCodeEnd":2284,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L2248-L2284","documentation":"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.","triggerScenarios":"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.","commonSituations":"Programmatic execution: new Trans(new TransMeta()) without transMeta.setName(\"...\"); transformations loaded from stream without a name; renamed/unsaved transformations.","solutions":["Set a transformation name: transMeta.setName(\"MyTransform\") before creating/executing the Trans","If loading from XML, confirm the <info><name> element is non-empty","Skip transaction logging (remove the log table config) if names are not applicable"],"exampleFix":"// before\nTransMeta meta = new TransMeta();\nTrans trans = new Trans(meta);\n// after\nTransMeta meta = new TransMeta();\nmeta.setName(\"NightlyETL\");\nTrans trans = new Trans(meta);","handlingStrategy":"validation","validationCode":"if (transMeta.getTransLogTable().getTableName() != null &&\n    (transMeta.getName() == null || transMeta.getName().isEmpty())) {\n  transMeta.setName(\"Unnamed-Transformation-\" + System.currentTimeMillis());\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(args);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"NoTransnameAvailableForLogging\")) {\n    transMeta.getTransMeta().setName(\"default\"); // then retry\n  } else throw e;\n}","preventionTips":["Always call transMeta.setName(...) for programmatically built transformations","Ensure loaded ktr XML contains a non-empty name","Name transformations before enabling transaction logging","Add a startup assertion that the transformation name is set"],"tags":["kettle","logging","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}