pentaho/pentaho-kettle · error · KettleObjectExistsException
Failed to save object to repository. Object [name] already…
Error message
Failed to save object to repository. Object [name] already exists.
What it means
savePartitionSchema throws KettleObjectExistsException when a partition schema with the same name already exists in the repository and overwrite=false. The delegate refuses to silently clobber the existing object; callers must explicitly opt into overwriting.
Solutions
- Pass overwrite=true to replace the existing partition schema
- Rename the partition schema to a unique name before saving
- Check the existing schema first via getPartitionSchemaID and merge changes instead of duplicating
- Catch KettleObjectExistsException and surface a clear UI message to the user
Example fix
// before
ObjectId id = delegate.savePartitionSchema(schema, false);
// after
ObjectId id;
try {
id = delegate.savePartitionSchema(schema, false);
} catch (KettleObjectExistsException e) {
id = delegate.savePartitionSchema(schema, true); // intentional overwrite
} Defensive patterns
Strategy: try-catch
Validate before calling
ObjectId existing = delegate.getPartitionSchemaID(schema.getName()); boolean willCollide = existing != null && !existing.equals(schema.getObjectId());
Try / catch
try { delegate.savePartitionSchema(schema, false); } catch (KettleObjectExistsException e) { /* prompt user or pass overwrite=true */ } Prevention
- Check getPartitionSchemaID(name) before saving with overwrite=false
- Use overwrite=true deliberately in import/CI pipelines
- Adopt naming conventions to avoid cross-team collisions
- Catch KettleObjectExistsException explicitly rather than generic KettleException
When it happens
Trigger: Calling savePartitionSchema(partitionSchema, overwrite=false) where getPartitionSchemaID(name) finds an existing R_PARTITION_SCHEMA row with the same name that isn't the same object.
Common situations: Importing transformations that define a partition schema name that already exists in the repository; two teams independently creating identically named schemas; re-running an import without the overwrite flag.
Understand the failure class
Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.
Related errors
- Failed to create object in repository. Object
- Failed to create object in repository. Object
- Failed to save object to repository. Object
- Can not create element type with id…
- Namespace with name ''+namespace+'' already exists
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/aa362d55b21e2fa4.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryPartitionSchemaDelegate.java:93
partitionSchema.setObjectId( getPartitionSchemaID( partitionSchema.getName() ) );
}
if ( partitionSchema.getObjectId() == null ) {
// New Slave Server
partitionSchema.setObjectId( insertPartitionSchema( partitionSchema ) );
} else {
ObjectId existingPartitionSchemaId = partitionSchema.getObjectId();
// If we received a partitionSchemaId and it is different from the partition schema we are working with...
if ( existingPartitionSchemaId != null && !partitionSchema.getObjectId().equals( existingPartitionSchemaId ) ) {
// A partition with this name already exists
if ( overwrite ) {
// Proceed with save, removing the original version from the repository first
repository.deletePartitionSchema( existingPartitionSchemaId );
updatePartitionSchema( partitionSchema );
repository.delPartitions( partitionSchema.getObjectId() );
} else {
throw new KettleObjectExistsException( "Failed to save object to repository. Object ["
+ partitionSchema.getName() + "] already exists." );
}
} else {
// There are no naming collisions (either it is the same object or the name is unique)
updatePartitionSchema( partitionSchema );
repository.delPartitions( partitionSchema.getObjectId() );
}
}
// Save the partitionschema-partition relationships
//
for ( int i = 0; i < partitionSchema.getPartitionIDs().size(); i++ ) {
insertPartition( partitionSchema.getObjectId(), partitionSchema.getPartitionIDs().get( i ) );
}
// Save a link to the transformation to keep track of the use of this partition schema
// Otherwise, we shouldn't bother with this
//View on GitHub (pinned to f3058517a1)