{"record":{"id":"3762c05f3f5143ee","repo":"pentaho/pentaho-kettle","slug":"unable-to-log-the-job-entries-to-a-database-table-at-the-end","errorCode":null,"errorMessage":"Unable to log the job entries to a database table at the end of the job","messagePattern":"Unable to log the job entries to a database table at the end of the job","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/Job.java","lineNumber":1123,"sourceCode":"      } catch ( KettleDatabaseException dbe ) {\n        addErrors( 1 ); // This is even before actual execution\n        throw new KettleJobException( BaseMessages.getString( PKG, \"Job.Log.UnableToProcessLoggingStart\", \"\"\n            + tableName ), dbe );\n      } finally {\n        ldb.close();\n      }\n    }\n\n    // If we need to write out the job entry logging information, do so at the end of the job:\n    //\n    JobEntryLogTable jobEntryLogTable = jobMeta.getJobEntryLogTable();\n    if ( jobEntryLogTable.isDefined() ) {\n      addJobListener( new JobAdapter() {\n        @Override public void jobFinished( Job job ) throws KettleException {\n          try {\n            writeJobEntryLogInformation();\n          } catch ( KettleException e ) {\n            throw new KettleException( BaseMessages.getString( PKG,\n                \"Job.Exception.UnableToPerformJobEntryLoggingAtJobEnd\" ), e );\n          }\n        }\n      } );\n    }\n\n    // If we need to write the log channel hierarchy and lineage information,\n    // add a listener for that too...\n    //\n    ChannelLogTable channelLogTable = jobMeta.getChannelLogTable();\n    if ( channelLogTable.isDefined() ) {\n      addJobListener( new JobAdapter() {\n\n        @Override public void jobFinished( Job job ) throws KettleException {\n          try {\n            writeLogChannelInformation();\n          } catch ( KettleException e ) {\n            throw new KettleException( BaseMessages.getString( PKG, \"Job.Exception.UnableToPerformLoggingAtTransEnd\" ),","sourceCodeStart":1105,"sourceCodeEnd":1141,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/Job.java#L1105-L1141","documentation":"Registered as a jobFinished listener when the job entry log table is defined; if writing job-entry-level log information at job end throws a KettleException, it is re-wrapped with this message. The original database/IO exception is the cause.","triggerScenarios":"At job completion, writeJobEntryLogInformation() fails while inserting job entry log rows into the defined job entry log table.","commonSituations":"Job entry log table missing or schema outdated; DB connection dropped during long jobs; permissions revoked mid-run; disk full on the log database.","solutions":["Inspect the cause chain for the underlying SQL/IO error","Verify the job entry log table schema matches the current Kettle version","Confirm the log DB connection stays alive for the job duration (pool/idle timeouts)","Grant write privileges on the job entry log table"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before run: verify job entry log table exists\nResultSet rs = conn.getMetaData().getTables(null, null, jobEntryLogTable.getTableName(), null);\nif (!rs.next()) throw new IllegalStateException(\"Job entry log table missing\");","typeGuard":null,"tryCatchPattern":"try {\n  job.run();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"job entries to a database table\")) {\n    log.error(\"Job-entry log write failed at job end\", e.getCause());\n    // job itself may have succeeded; check job result separately\n  }\n}","preventionTips":["Define and create the job entry log table before enabling job-entry logging","Avoid aggressive DB idle timeouts on long-running jobs","Monitor disk space on the logging database"],"tags":["database","logging","job-entries"],"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"}