pentaho/pentaho-kettle · error · KettleException
JobEntryTruncateTables.UnableSaveRep
Error message
JobEntryTruncateTables.UnableSaveRep
What it means
JobEntryTruncateTables.saveRep() wraps a KettleDatabaseException from rep.saveJobEntryAttribute(...) into a KettleException with message 'JobEntryTruncateTables.UnableSaveRep' plus the id_job. It means the job entry's table list could not be written to the repository database.
Solutions
- Check the repository database is writable and the user has INSERT/UPDATE rights on R_JOBENTRY_ATTRIBUTE.
- Retry the save after confirming DB connectivity; inspect the cause for the exact SQL error.
- Free up space / resolve lock contention on the repository tables.
- If the repository is consistently failing, export the job to XML (.kjb) as a workaround and fix the DB.
Example fix
// before: saving with a disconnected repository
rep.saveRep(...); // fails silently earlier, then saveRep throws
// after: check connection before saving
if ( !rep.isConnected() ) { rep.connect(user, pass); }
rep.saveRep(metaStore, id_job); Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-flight checks before saveRep
if ( !rep.isConnected() ) throw new KettleException("Repository not connected");
for ( String arg : jobEntry.getArguments() ) {
if ( arg == null ) throw new KettleException("Null table name in truncate-tables entry");
} Type guard
boolean canSaveToRepository(Repository rep, ObjectId id_job) {
return rep != null && rep.isConnected() && id_job != null;
} Try / catch
try {
jobEntry.saveRep(rep, metaStore, id_job);
} catch ( KettleException e ) {
logError("Repository save failed for id_job=" + id_job + ": " + e.getCause(), e);
// export to .kjb as fallback so work is not lost
jobMeta.saveXMLFile(fallbackPath);
throw e;
} Prevention
- Ensure the repository DB user has INSERT/UPDATE grants on R_JOBENTRY_ATTRIBUTE.
- Avoid two users saving the same job simultaneously.
- Monitor DB disk space and lock waits.
- Export jobs to .kjb before risky repository maintenance.
When it happens
Trigger: Calling saveRep(rep, metaStore, id_job) when the repository DB insert/update of the 'name'/'schemaname' attributes fails — connection loss, constraint violation, read-only schema, or null arguments/schemaname array entries on a repository that rejects them.
Common situations: Repository database read-only or out of space; network drop mid-save; concurrent edits causing lock timeouts; missing write privileges for the repository user.
Related errors
- ERROR_0002
- HTTPMeta.Exception.UnableToSaveStepInfo
- JobEntryEval.UnableToSaveToRepo
- JobEntryEvalTableContent.UnableSaveRep
- JobEntrySimple.Error.Exception.UnableSaveRep
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/860839941938a59a.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/entries/truncatetables/JobEntryTruncateTables.java:180
throw new KettleException( BaseMessages.getString( PKG, "JobEntryTruncateTables.UnableLoadRep", ""
+ id_jobentry ), dbe );
}
}
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {
try {
rep.saveDatabaseMetaJobEntryAttribute( id_job, getObjectId(), "connection", "id_database", connection );
rep.saveJobEntryAttribute( id_job, getObjectId(), "arg_from_previous", this.argFromPrevious );
// save the arguments...
if ( this.arguments != null ) {
for ( int i = 0; i < this.arguments.length; i++ ) {
rep.saveJobEntryAttribute( id_job, getObjectId(), i, "name", this.arguments[i] );
rep.saveJobEntryAttribute( id_job, getObjectId(), i, "schemaname", this.schemaname[i] );
}
}
} catch ( KettleDatabaseException dbe ) {
throw new KettleException(
BaseMessages.getString( PKG, "JobEntryTruncateTables.UnableSaveRep", "" + id_job ), dbe );
}
}
public void setDatabase( DatabaseMeta database ) {
this.connection = database;
}
public DatabaseMeta getDatabase() {
return this.connection;
}
public boolean evaluates() {
return true;
}
public boolean isUnconditional() {
return true;View on GitHub (pinned to f3058517a1)