{"record":{"id":"5517f5eea5acf013","repo":"pentaho/pentaho-kettle","slug":"trans-exception-unabletowritestepinformationtologtable","errorCode":null,"errorMessage":"Trans.Exception.UnableToWriteStepInformationToLogTable","messagePattern":"Trans\\.Exception\\.UnableToWriteStepInformationToLogTable","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":2683,"sourceCode":"   *\n   * @throws KettleException if any errors occur during logging\n   */\n  protected void writeStepLogInformation() throws KettleException {\n    Database db = null;\n    StepLogTable stepLogTable = getTransMeta().getStepLogTable();\n    try {\n      db = createDataBase( stepLogTable.getDatabaseMeta() );\n      db.shareVariablesWith( this );\n      db.connect();\n      db.setCommit( logCommitSize );\n\n      for ( StepMetaDataCombi combi : getSteps() ) {\n        db.writeLogRecord( stepLogTable, LogStatus.START, combi, null );\n      }\n\n      db.cleanupLogRecords( stepLogTable, getName() );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG,\n        \"Trans.Exception.UnableToWriteStepInformationToLogTable\" ), e );\n    } finally {\n      disconnectDb( db );\n    }\n\n  }\n\n  protected Database createDataBase( DatabaseMeta meta ) {\n    return new Database( this, meta );\n  }\n\n  protected synchronized void writeMetricsInformation() throws KettleException {\n    Preconditions.checkNotNull( log );\n    List<MetricsDuration> metricsList =\n      MetricsUtil.getDuration( log.getLogChannelId(), Metrics.METRIC_PLUGIN_REGISTRY_REGISTER_EXTENSIONS_START );\n    if ( ( log.isDebug() ) && !metricsList.isEmpty() ) {\n      log.logDebug( metricsList.get( 0 ).toString() );\n    }","sourceCodeStart":2665,"sourceCodeEnd":2701,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L2665-L2701","documentation":"Thrown by Trans.writeStepLogInformation() when writing one start record per transformation step (via db.writeLogRecord(stepLogTable, LogStatus.START, combi, null)) to the configured step log table fails, or when subsequent cleanupLogRecords() fails. Any Exception is wrapped in this message.","triggerScenarios":"writeStepLogInformation() iterates getSteps() and writes a START log row per StepMetaDataCombi into the step log table; a DB error on any write or on cleanupLogRecords(stepLogTable, getName()) triggers this exception.","commonSituations":"Step log table missing/renamed after migration; one step's metadata can't be serialized to the log columns; DB outage at transformation start; insufficient insert privileges.","solutions":["Check the cause for the failing SQL and restore the step log table database (connection, schema, privileges).","Recreate the step log table from the Log tab generated DDL.","Grant INSERT/DELETE on the step log table to the log user.","Remove the Step log table configuration if per-step start logging is not needed."],"exampleFix":"// before: step_log table absent\nKettleException: UnableToWriteStepInformationToLogTable\n// after: CREATE TABLE step_log (...); via Log tab SQL generation","handlingStrategy":"validation","validationCode":"// Verify step log table exists and the DB accepts writes before execution\nDatabase db = new Database(trans, stepLogTable.getDatabaseMeta());\ndb.connect();\nif (!db.checkTableExists(\"STEP_LOG\")) throw new IllegalStateException(\"STEP_LOG missing\");","typeGuard":null,"tryCatchPattern":"try {\n  trans.waitUntilFinished();\n} catch (KettleException e) {\n  log.error(\"Step start-record logging failed: \" + e.getCause().getMessage());\n  // re-create table or disable step logging, then re-run\n}","preventionTips":["Deploy step_log DDL with the transformation, not separately.","Grant INSERT/DELETE on step_log to the ETL user in every environment.","Check DB connectivity at scheduled start time, not only at design time."],"tags":["database","logging","steps","transformation"],"backgroundTag":"database-write-failed","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"}