pentaho/pentaho-kettle · error · KettleException
Unable to insert new version log record into
Error message
Unable to insert new version log record into {schemaTable} What it means
During repository creation the helper inserts the initial version-log row into R_VERSION using a prepared INSERT; any KettleException from that statement is wrapped as 'Unable to insert new version log record into <schemaTable>'. Without this row the repository version stamp is missing.
Solutions
- Check if R_VERSION already has a row; skip version seeding or delete the duplicate first.
- Verify R_VERSION has exactly the 5 expected columns of the current Pentaho version.
- Grant INSERT privilege on the repository schema to the connecting user.
- Inspect the wrapped KettleException for the exact JDBC error.
Example fix
// before
repo.connect(...); // re-seeds R_VERSION, duplicate key
// after
if (!database.checkTableExists(TABLE_R_VERSION) || database.getOneRow("SELECT * FROM " + TABLE_R_VERSION) == null) {
repo.connect(...); // safe to create/seed
} Defensive patterns
Strategy: validation
Validate before calling
// skip seeding when R_VERSION already populated
if (database.checkTableExists(KettleDatabaseRepository.TABLE_R_VERSION)
&& database.getOneRow("SELECT * FROM " + KettleDatabaseRepository.TABLE_R_VERSION) != null) {
return; // version already seeded
} Try / catch
try {
repo.createRepositorySchema(monitor, false);
} catch (KettleException e) {
if (e.getMessage().contains("R_VERSION")) {
// handle duplicate/seed conflict
}
} Prevention
- Never re-run creation against an already-seeded R_VERSION.
- Keep R_VERSION column layout aligned with the Pentaho version.
- Ensure INSERT privileges on the repository schema.
- Inspect cause chain for duplicate-key JDBC errors.
When it happens
Trigger: createRepositorySchema() (or its test callers) executes INSERT INTO R_VERSION VALUES(?,?,?,?,?) and the database rejects it — e.g. table exists with different column count, duplicate key from a prior install, or insert privileges missing.
Common situations: Re-running repository creation on an existing schema where R_VERSION is already populated; table created manually with a wrong column layout; user lacking INSERT privileges.
Related errors
- Error inserting 'unknown' row in dimension [
- No fields in row, can't insert!
- TransDependency.Exception.UnableToSaveTransformationDepency
- TransHopMeta.Exception.UnableToSaveTransformationHopInfo
- Unable to prepare dimension insert :
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/42b28cfd47352941.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/KettleDatabaseRepositoryCreationHelper.java:227
} else {
nextId = new LongObjectId( 1L );
}
Object[] data =
new Object[] {
nextId.longValue(),
Long.valueOf( KettleDatabaseRepositoryConnectionDelegate.REQUIRED_MAJOR_VERSION ),
Long.valueOf( KettleDatabaseRepositoryConnectionDelegate.REQUIRED_MINOR_VERSION ), new Date(),
Boolean.valueOf( upgrade ), };
if ( dryrun ) {
sql = database.getSQLOutput( null, KettleDatabaseRepository.TABLE_R_VERSION, table, data, null );
statements.add( sql );
} else {
database.execStatement( "INSERT INTO "
+ databaseMeta.getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_VERSION )
+ " VALUES(?, ?, ?, ?, ?)", table, data );
}
} catch ( KettleException e ) {
throw new KettleException( "Unable to insert new version log record into " + schemaTable, e );
}
// ////////////////////////////////////////////////////////////////////////////////
// R_DATABASE_TYPE
//
// Create table...
//
boolean ok_database_type = true;
table = new RowMeta();
tablename = KettleDatabaseRepository.TABLE_R_DATABASE_TYPE;
schemaTable = databaseMeta.getQuotedSchemaTableCombination( null, tablename );
if ( monitor != null ) {
monitor.subTask( "Checking table " + schemaTable );
}
table.addValueMeta( new ValueMetaInteger(
KettleDatabaseRepository.FIELD_DATABASE_TYPE_ID_DATABASE_TYPE, KEY, 0 ) );
table.addValueMeta( new ValueMetaString(
KettleDatabaseRepository.FIELD_DATABASE_TYPE_CODE,View on GitHub (pinned to f3058517a1)