pentaho/pentaho-kettle · error · KettleException
TransDependency.Exception.UnableToSaveTransformationDepency
Error message
TransDependency.Exception.UnableToSaveTransformationDepency
What it means
Thrown by saveTransDependency() when inserting a transformation dependency row into the repository fails with a KettleException. The message includes the transformation ObjectId being saved. It wraps failures of insertDependency(), typically SQL insert errors or constraint violations.
Solutions
- Ensure the transformation and its database connections are saved before dependencies (ids must exist)
- Check the chained cause for SQL constraint violations and fix the missing parent rows
- Verify tablename/fieldname values are populated on the TransDependency
- Confirm the DB user has INSERT privilege on R_DEPENDENCY
Example fix
// before TransDependency dep = new TransDependency(null, "tbl", "fld"); // databaseMeta null rep.save(transMeta, "comment", null); // after dep.setDatabase(dbMeta); // ensure saved DatabaseMeta with ObjectId rep.save(databases); // persist connection first rep.save(transMeta, "comment", null);
Defensive patterns
Strategy: try-catch
Validate before calling
// Java: pre-save checks before persisting dependencies
if (transDependency.getDatabase() == null
|| transDependency.getDatabase().getObjectId() == null) {
throw new IllegalStateException("Save the DatabaseMeta before saving dependencies");
}
if (transDependency.getTablename() == null || transDependency.getFieldname() == null) {
throw new IllegalStateException("Dependency table/field must be set");
} Try / catch
try {
delegate.saveTransDependency(dep, transId);
} catch (KettleException e) {
log.error("Dependency save failed for transformation " + transId + ": " + e.getCause(), e);
throw e; // abort transactional save to keep repo consistent
} Prevention
- Always save database connections before the transformation that depends on them
- Ensure parent ObjectIds (transformation, database) are non-null before inserts
- Use the repository's save() API rather than delegate methods out of order
- Verify INSERT grants on R_DEPENDENCY for the repository account
When it happens
Trigger: Saving a TransMeta (or explicitly calling saveTransDependency) where insertDependency(id_transformation, id_database, tablename, fieldname) fails: FK violation because the transformation or database id does not exist, null tablename/fieldname in a schema that disallows it, or connection failure.
Common situations: Saving a transformation to a repository where the referenced DatabaseMeta was never saved, transaction rollback after partial save, or DB storage full / read-only account.
Related errors
- TransDependency.Exception.UnableToLoadTransformationDependen…
- TransHopMeta.Exception.UnableToSaveTransformationHopInfo
- AccessInputMeta.Exception.ErrorReadingRepository
- AddSequenceMeta.Exception.UnableToReadStepInfo
- AggregateRowsMeta.Exception.UnexpectedErrorWhileReadingStepInfo
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/d23eb5c87ce72f6e.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java:1086
}
return transDependency;
} catch ( KettleException dbe ) {
throw new KettleException( BaseMessages.getString(
PKG, "TransDependency.Exception.UnableToLoadTransformationDependency" )
+ id_dependency, dbe );
}
}
public void saveTransDependency( TransDependency transDependency, ObjectId id_transformation ) throws KettleException {
try {
ObjectId id_database =
transDependency.getDatabase() == null ? null : transDependency.getDatabase().getObjectId();
transDependency.setObjectId( insertDependency( id_transformation, id_database, transDependency
.getTablename(), transDependency.getFieldname() ) );
} catch ( KettleException dbe ) {
throw new KettleException( BaseMessages.getString(
PKG, "TransDependency.Exception.UnableToSaveTransformationDepency" )
+ id_transformation, dbe );
}
}
public void saveTransHopMeta( TransHopMeta transHopMeta, ObjectId id_transformation ) throws KettleException {
try {
// See if a transformation hop with the same fromstep and tostep is
// already available...
ObjectId id_step_from = transHopMeta.getFromStep() == null ? null : transHopMeta.getFromStep().getObjectId();
ObjectId id_step_to = transHopMeta.getToStep() == null ? null : transHopMeta.getToStep().getObjectId();
// Insert new transMeta hop in repository
transHopMeta.setObjectId( insertTransHop( id_transformation, id_step_from, id_step_to, transHopMeta
.isEnabled() ) );
} catch ( KettleDatabaseException dbe ) {
throw new KettleException( BaseMessages.getString(
PKG, "TransHopMeta.Exception.UnableToSaveTransformationHopInfo" )View on GitHub (pinned to f3058517a1)