pentaho/pentaho-kettle · error · KettleException
JobMeta.Exception.AnErrorOccuredReadingJob
Error message
JobMeta.Exception.AnErrorOccuredReadingJob
What it means
Thrown by loadJobMeta as a wrapper around any KettleException (including KettleDatabaseException) that occurs while reading a job from the database repository. The localized message 'AnErrorOccuredReadingJob' plus job name wraps the real cause (dbe), so the root database error is in getCause(). This is the generic 'job read failed' guard of the loader.
Solutions
- Inspect the wrapped cause (e.getCause()) — fix the underlying KettleDatabaseException (connectivity, SQL, schema).
- Verify the repository client and repository schema versions match (run upgrade scripts).
- Reconnect to the repository and retry the load after transient DB failures.
- Restore the job from another source (file backup) if the stored rows are corrupted.
Example fix
// before: treating the wrapper message as the root cause
} catch (KettleException e) {
log.error(e.getMessage());
}
// after: unwrap to surface the database error
} catch (KettleException e) {
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.error("Failed reading job: " + e.getMessage(), root);
} Defensive patterns
Strategy: retry
Validate before calling
// verify connection and name before attempting the load
if (!repo.isConnected()) repo.connect();
if (jobname == null || jobname.trim().isEmpty()) throw new IllegalArgumentException("jobname required");
if (directory == null || directory.getObjectId() == null) throw new IllegalArgumentException("directory must be loaded from repository"); Type guard
boolean isLoadableRequest(String name, RepositoryDirectoryInterface dir) {
return name != null && !name.trim().isEmpty()
&& dir != null && dir.getObjectId() != null;
} Try / catch
try {
jobMeta = repo.loadJobMeta(jobname, dir, monitor);
} catch (KettleException e) {
if (rootCauseIsConnectionError(e)) {
repo.disconnect(); repo.connect();
jobMeta = repo.loadJobMeta(jobname, dir, monitor); // one retry
} else {
throw e; // schema/data problems are not retryable
}
} Prevention
- Match client and repository schema versions; run upgrade scripts after Pentaho upgrades.
- Retry once after reconnecting for transient DB/network failures, then fail fast.
- Inspect e.getCause() — the wrapper message never tells the real problem.
- Avoid loading very large jobs over unstable connections; prefer local file copies for heavy batch work.
When it happens
Trigger: Calling repository.loadJobMeta(name, directory, monitor) when any DB access during loading fails: connection dropped mid-read, a SQL error in r_job/r_jobentry queries, or an exception thrown while hydrating job entries/hops.
Common situations: Network interruption during a large job load; incompatible repository schema versions (older client reading newer repository rows); locked tables or statement timeouts on the database; malformed data in job entry rows.
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
- JobHopMeta.Exception.UnableToLoadHopInfoRep
- AbortMeta.Exception.UnableToSaveStepInfoToRepository
- 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/07dd7bb87382c9f5.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java:507
// Finally, clear the changed flags...
jobMeta.clearChanged();
if ( monitor != null ) {
monitor.subTask( BaseMessages.getString( PKG, "JobMeta.Monitor.FinishedLoadOfJob" ) );
}
if ( monitor != null ) {
monitor.done();
}
// close prepared statements, minimize locking etc.
//
repository.connectionDelegate.closeAttributeLookupPreparedStatements();
return jobMeta;
} else {
throw new KettleException( BaseMessages.getString( PKG, "JobMeta.Exception.CanNotFindJob" ) + jobname );
}
} catch ( KettleException dbe ) {
throw new KettleException( BaseMessages.getString(
PKG, "JobMeta.Exception.AnErrorOccuredReadingJob", jobname ), dbe );
} finally {
jobMeta.initializeVariablesFrom( jobMeta.getParentVariableSpace() );
jobMeta.setInternalKettleVariables();
}
}
}
/**
* Load the parameters of this job from the repository. The current ones already loaded will be erased.
*
* @param jobMeta
* The target job for the parameters
*
* @throws KettleException
* Upon any error.
*
*/View on GitHub (pinned to f3058517a1)