pentaho/pentaho-kettle · error · KettleJobException
Conversion error after getting last logdate from
Error message
Conversion error after getting last logdate from {0} What it means
Thrown in the Job constructor when reading the last END log date from the job log table fails conversion. The value retrieved from the database cannot be converted to a Date via the row metadata (KettleValueException), so the constructor aborts with a KettleJobException.
Solutions
- Ensure the log table's LOGDATE column is a TIMESTAMP/DATETIME type
- Recreate the log table using Kettle's DDL generation
- Verify the database driver returns proper date types (update JDBC driver)
- Inspect ldb.getReturnRowMeta() to see the expected type vs actual column type
Example fix
// before CREATE TABLE job_log (... LOGDATE VARCHAR(50) ...) // after CREATE TABLE job_log (... LOGDATE TIMESTAMP ...)
Defensive patterns
Strategy: validation
Validate before calling
// check log table column type before running
ResultSet rs = conn.getMetaData().getColumns(null, schema, tableName, "LOGDATE");
if (!rs.next() || !rs.getString("TYPE_NAME").toUpperCase().contains("TIMESTAMP")) {
throw new IllegalStateException("LOGDATE column must be TIMESTAMP");
} Try / catch
try {
Job job = new Job(...);
} catch (KettleJobException e) {
if (e.getMessage().startsWith("Conversion error after getting last logdate")) {
log.error("Job log table LOGDATE column has wrong type; recreate log table", e);
}
} Prevention
- Generate log table DDL from Kettle rather than hand-writing it
- Keep LOGDATE as TIMESTAMP/DATETIME in all log tables
- Use a current JDBC driver that maps dates properly
- Don't share log tables across unrelated tools with different schemas
When it happens
Trigger: getReturnRowMeta().getDate(row, 0) throws because the first column of the getLastLogDate result is not a Date-compatible value.
Common situations: Custom/shared log table schemas where LOGDATE is stored as VARCHAR or wrong type; database returning dates in an unexpected format/driver type; pointing a job at a log table created by another tool.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- There was an unexpected error while logging job entry…
- Trans.Exception.ConnectionCouldNotBeFound
- Trans.Exception.ErrorCalculatingDateRange
- Trans.Exception.ErrorWritingLogRecordToTable
- Trans.Exception.ErrorWritingStepPerformanceLogRecordToTable
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/34c15dfdcbf9723d.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/Job.java:1045
try {
// See if we have to add a batch id...
Long id_batch = 1L;
if ( jobMeta.getJobLogTable().isBatchIdUsed() ) {
id_batch = logcon.getNextBatchId( ldb, schemaName, tableName, jobLogTable.getKeyField().getFieldName() );
setBatchId( id_batch.longValue() );
if ( getPassedBatchId() <= 0 ) {
setPassedBatchId( id_batch.longValue() );
}
}
Object[] lastr = ldb.getLastLogDate( schemaAndTable, jobMeta.getName(), true, LogStatus.END );
if ( !Utils.isEmpty( lastr ) ) {
Date last;
try {
last = ldb.getReturnRowMeta().getDate( lastr, 0 );
} catch ( KettleValueException e ) {
throw new KettleJobException( BaseMessages.getString( PKG, "Job.Log.ConversionError", "" + tableName ), e );
}
if ( last != null ) {
startDate = last;
}
}
depDate = currentDate;
ldb.writeLogRecord( jobMeta.getJobLogTable(), LogStatus.START, this, null );
if ( !ldb.isAutoCommit() ) {
ldb.commitLog( true, jobMeta.getJobLogTable() );
}
ldb.close();
// If we need to do periodic logging, make sure to install a timer for
// this...
//
if ( intervalInSeconds > 0 ) {View on GitHub (pinned to f3058517a1)