pentaho/pentaho-kettle · error · KettleException
JobEntryTruncateTables.UnableLoadRep
Error message
JobEntryTruncateTables.UnableLoadRep
What it means
JobEntryTruncateTables.loadRep() wraps a KettleDatabaseException thrown while reading the job entry's 'name'/'schemaname' attributes from the repository into a KettleException with message 'JobEntryTruncateTables.UnableLoadRep' plus the id_jobentry. It signals that the stored repository rows for this job entry could not be read.
Solutions
- Verify the repository database is reachable and credentials in the repository connection are valid.
- Inspect R_JOBENTRY_ATTRIBUTE rows for the reported id_jobentry and fix or delete corrupt rows.
- Run the repository upgrade scripts matching your Pentaho version.
- Re-save the job entry from Spoon to rebuild its repository attributes.
Example fix
// before: job loaded against a stale/broken repository connection
KettleEnvironment.init();
Repository rep = new KettleDatabaseRepository();
rep.connect("old_repo", "user", "pass");
// after: validate connection first and recreate repository metadata
KettleEnvironment.init();
RepositoriesMeta meta = new RepositoriesMeta();
meta.readData();
Repository rep = meta.searchRepository("prod_repo").getRepositoryElement();
rep.connect("user", "pass"); Defensive patterns
Strategy: try-catch
Validate before calling
// Verify repository reachability and row presence before loadRep
if ( !rep.isConnected() ) throw new KettleException("Repository not connected");
// optionally check attribute rows exist
ObjectId id = jobEntry.getObjectId();
if ( id == null ) throw new KettleException("Job entry not persisted yet"); Type guard
boolean canLoadFromRepository(Repository rep, ObjectId id) {
return rep != null && rep.isConnected() && id != null;
} Try / catch
try {
jobEntry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);
} catch ( KettleException e ) {
logError("Repository load failed for id_jobentry=" + id_jobentry + ": " + e.getCause(), e);
throw e; // or fall back to XML load
} Prevention
- Monitor repository database health before batch-loading jobs.
- Apply repository schema upgrade scripts after Pentaho upgrades.
- Re-save entries after manual DB maintenance on R_JOBENTRY_ATTRIBUTE.
- Use the XML (.kjb) storage format when repository reliability is a concern.
When it happens
Trigger: Calling loadRep(rep, metaStore, id_jobentry, ...) against a repository whose database connection fails, whose R_JOBENTRY_ATTRIBUTE rows for id_jobentry are locked/corrupt, or whose schema is missing the expected attribute rows.
Common situations: Repository database down or networked DB unreachable; stale repository schema after a Pentaho upgrade; repository transaction left locked by a crashed client; corrupt id_jobentry referenced by a job.
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
- 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/25d6152c0bd1c3b1.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/entries/truncatetables/JobEntryTruncateTables.java:162
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
List<SlaveServer> slaveServers ) throws KettleException {
try {
connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );
this.argFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
// How many arguments?
int argnr = rep.countNrJobEntryAttributes( id_jobentry, "name" );
allocate( argnr );
// Read them all...
for ( int a = 0; a < argnr; a++ ) {
this.arguments[a] = rep.getJobEntryAttributeString( id_jobentry, a, "name" );
this.schemaname[a] = rep.getJobEntryAttributeString( id_jobentry, a, "schemaname" );
}
} catch ( KettleDatabaseException dbe ) {
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(View on GitHub (pinned to f3058517a1)