{"record":{"id":"93baafdb6bf870b8","repo":"pentaho/pentaho-kettle","slug":"error-0002-cannot-load-job-from-repository-93baaf","errorCode":"ERROR_0002_Cannot_Load_Job_From_Repository","errorMessage":"JobEntryTalendJobExec.ERROR_0002_Cannot_Load_Job_From_Repository","messagePattern":"JobEntryTalendJobExec\\.ERROR_0002_Cannot_Load_Job_From_Repository","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/talendjobexec/JobEntryTalendJobExec.java","lineNumber":116,"sourceCode":"  public void loadXML( Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers,\n    Repository rep, IMetaStore metaStore ) throws KettleXMLException {\n    try {\n      super.loadXML( entrynode, databases, slaveServers );\n      filename = XMLHandler.getTagValue( entrynode, \"filename\" );\n      className = XMLHandler.getTagValue( entrynode, \"class_name\" );\n    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"JobEntryTalendJobExec.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node\" ), xe );\n    }\n  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      filename = rep.getJobEntryAttributeString( id_jobentry, \"filename\" );\n      className = rep.getJobEntryAttributeString( id_jobentry, \"class_name\" );\n    } catch ( KettleException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryTalendJobExec.ERROR_0002_Cannot_Load_Job_From_Repository\", id_jobentry ), dbe );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"filename\", filename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"class_name\", className );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryTalendJobExec.ERROR_0003_Cannot_Save_Job_Entry\", id_job ), dbe );\n    }\n  }\n\n  public void setFilename( String filename ) {\n    this.filename = filename;\n  }\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/talendjobexec/JobEntryTalendJobExec.java#L98-L134","documentation":"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.","triggerScenarios":"Calling loadRep when rep.getJobEntryAttributeString throws for filename or class_name: nonexistent id_jobentry, repository connection failure, or corrupted/locked attribute rows.","commonSituations":"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.","solutions":["Check the chained KettleException/dbe cause for the root database error","Verify id_jobentry has filename and class_name rows in r_jobentry_attribute","Confirm repository connectivity and credentials, then reload the job","Re-save the entry from Spoon to recreate missing attribute rows","Migrate repository content consistently between source and target repositories"],"exampleFix":"// before: loading entry whose rows were dropped in migration\nentry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers); // throws\n// after: verify rows exist (or recreate via Spoon save) before loading\nif (rep.getJobEntryAttributeString(id_jobentry, \"filename\") != null) {\n  entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);\n}","handlingStrategy":"try-catch","validationCode":"// Java: confirm repository session and entry id before loadRep\nif (rep == null || !rep.isConnected() || id_jobentry == null) {\n  throw new KettleException(\"Repository not ready or missing id_jobentry\");\n}","typeGuard":"if (id_jobentry != null && rep != null && rep.isConnected()) { /* safe to loadRep */ }","tryCatchPattern":"try {\n  entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"ERROR_0002 for \" + id_jobentry + \": \" + e.getCause(), e);\n  // reconnect/re-login to repository and retry\n}","preventionTips":["Verify repository connectivity before opening jobs","Confirm filename/class_name attribute rows after migrations","Avoid referencing entries across mismatched repositories","Re-save entries in Spoon to recreate missing attribute rows"],"tags":["pentaho-kettle","repository","talend"],"backgroundTag":"database-query-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}