{"record":{"id":"a912397b1228a65b","repo":"pentaho/pentaho-kettle","slug":"trans-exception-unabletowritelogchannelinformationtologtable","errorCode":null,"errorMessage":"Trans.Exception.UnableToWriteLogChannelInformationToLogTable","messagePattern":"Trans\\.Exception\\.UnableToWriteLogChannelInformationToLogTable","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":2656,"sourceCode":"    }\n    // end PDI-7070\n\n    try {\n      db = new Database( this, channelLogTable.getDatabaseMeta() );\n      db.shareVariablesWith( this );\n      db.connect();\n      db.setCommit( logCommitSize );\n\n      List<LoggingHierarchy> loggingHierarchyList = getLoggingHierarchy();\n      for ( LoggingHierarchy loggingHierarchy : loggingHierarchyList ) {\n        db.writeLogRecord( channelLogTable, LogStatus.START, loggingHierarchy, null );\n      }\n\n      // Also time-out the log records in here...\n      //\n      db.cleanupLogRecords( channelLogTable, getName() );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG,\n        \"Trans.Exception.UnableToWriteLogChannelInformationToLogTable\" ), e );\n    } finally {\n      disconnectDb( db );\n    }\n  }\n\n  /**\n   * Writes step information to a step logging table (if one has been configured).\n   *\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();","sourceCodeStart":2638,"sourceCodeEnd":2674,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L2638-L2674","documentation":"Thrown by Trans.writeLogChannelInformation() when persisting the channel logging hierarchy (channels for the transformation and its steps) to the configured channel log table fails. The method connects, writes channel records, and calls cleanupLogRecords() to time out stale entries; any Exception in that flow is wrapped in this message.","triggerScenarios":"writeLogChannelInformation() is invoked (from beginProcessing/endProcessing paths); the DB connect, writeLogRecord, or db.cleanupLogRecords(channelLogTable, getName()) throws; wrapped as KettleException(UnableToWriteLogChannelInformationToLogTable).","commonSituations":"Channel log table missing or its primary-key columns altered; database credentials invalid; cleanup DELETE blocked by privileges or locks; DB connection dropped before the write.","solutions":["Inspect the cause to find the failing statement (write vs cleanupLogRecords DELETE) and fix that database issue.","Recreate the channel log table from the Log tab DDL so its schema matches the current PDI version.","Grant the log user INSERT and DELETE privileges on the channel log table.","Test the channel log table connection; if the write is transient, retry the transformation."],"exampleFix":"// before: cleanup fails due to missing DELETE privilege\nGRANT DELETE ON channel_log TO etl_user;\n// after: writeLogChannelInformation() completes including cleanup of timed-out records","handlingStrategy":"try-catch","validationCode":"// Ensure channel log table exists and is writable before the transformation runs\nDatabase db = new Database(trans, channelLogTable.getDatabaseMeta());\ndb.connect();\nif (!db.checkTableExists(\"CHANNEL_LOG\")) throw new IllegalStateException(\"CHANNEL_LOG missing\");","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"UnableToWriteLogChannelInformation\")) {\n    log.warn(\"Channel metadata logging failed; run continues\", e.getCause());\n  }\n}","preventionTips":["Keep channel log table schema current with the installed PDI version.","Ensure cleanupLogRecords DELETE privileges for the log user.","Watch for lock contention on channel_log in high-concurrency schedulers."],"tags":["database","logging","channels","cleanup"],"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"}