pentaho/pentaho-kettle · error · KettleException

ERROR_0002_Cannot_Load_Job_From_Repository

ERROR_0002_Cannot_Load_Job_From_Repository

Error message

JobEntryTalendJobExec.ERROR_0002_Cannot_Load_Job_From_Repository

What it means

JobEntryTalendJobExec.loadRep reads filename and class_name attributes from the repository; any KettleException is rethrown as a KettleException with the code-tagged message 'JobEntryTalendJobExec.ERROR_0002_Cannot_Load_Job_From_Repository' (id_jobentry interpolated) and the original as cause. It indicates the entry's repository record could not be loaded.

Solutions

  1. Check the chained KettleException/dbe cause for the root database error
  2. Verify id_jobentry has filename and class_name rows in r_jobentry_attribute
  3. Confirm repository connectivity and credentials, then reload the job
  4. Re-save the entry from Spoon to recreate missing attribute rows
  5. Migrate repository content consistently between source and target repositories

Example fix

// before: loading entry whose rows were dropped in migration
entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers); // throws
// after: verify rows exist (or recreate via Spoon save) before loading
if (rep.getJobEntryAttributeString(id_jobentry, "filename") != null) {
  entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Java: confirm repository session and entry id before loadRep
if (rep == null || !rep.isConnected() || id_jobentry == null) {
  throw new KettleException("Repository not ready or missing id_jobentry");
}

Type guard

if (id_jobentry != null && rep != null && rep.isConnected()) { /* safe to loadRep */ }

Try / catch

try {
  entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);
} catch (KettleException e) {
  logError("ERROR_0002 for " + id_jobentry + ": " + e.getCause(), e);
  // reconnect/re-login to repository and retry
}

Prevention

When it happens

Trigger: Calling loadRep when rep.getJobEntryAttributeString throws for filename or class_name: nonexistent id_jobentry, repository connection failure, or corrupted/locked attribute rows.

Common situations: Repository database migrated with attribute data lost; job entry referenced across repositories with mismatched IDs; transient DB outage or expired session while opening the 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


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/93baafdb6bf870b8. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/talendjobexec/JobEntryTalendJobExec.java:116

  public void loadXML( Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers,
    Repository rep, IMetaStore metaStore ) throws KettleXMLException {
    try {
      super.loadXML( entrynode, databases, slaveServers );
      filename = XMLHandler.getTagValue( entrynode, "filename" );
      className = XMLHandler.getTagValue( entrynode, "class_name" );
    } catch ( KettleXMLException xe ) {
      throw new KettleXMLException( BaseMessages.getString(
        PKG, "JobEntryTalendJobExec.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node" ), xe );
    }
  }

  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
    try {
      filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
      className = rep.getJobEntryAttributeString( id_jobentry, "class_name" );
    } catch ( KettleException dbe ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "JobEntryTalendJobExec.ERROR_0002_Cannot_Load_Job_From_Repository", id_jobentry ), dbe );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {
    try {
      rep.saveJobEntryAttribute( id_job, getObjectId(), "filename", filename );
      rep.saveJobEntryAttribute( id_job, getObjectId(), "class_name", className );
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "JobEntryTalendJobExec.ERROR_0003_Cannot_Save_Job_Entry", id_job ), dbe );
    }
  }

  public void setFilename( String filename ) {
    this.filename = filename;
  }

View on GitHub (pinned to f3058517a1)