{"record":{"id":"4187062c90d3c346","repo":"pentaho/pentaho-kettle","slug":"error-0002-cannot-load-job-from-repository","errorCode":"ERROR_0002_Cannot_Load_Job_From_Repository","errorMessage":"JobEntryFileExists.ERROR_0002_Cannot_Load_Job_From_Repository","messagePattern":"JobEntryFileExists\\.ERROR_0002_Cannot_Load_Job_From_Repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/fileexists/JobEntryFileExists.java","lineNumber":104,"sourceCode":"  }\n\n  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    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"JobEntryFileExists.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    } catch ( KettleException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryFileExists.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    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryFileExists.ERROR_0003_Cannot_Save_Job_Entry\", id_job ), dbe );\n    }\n  }\n\n  public void setFilename( String filename ) {\n    this.filename = filename;\n  }\n\n  public String getFilename() {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/fileexists/JobEntryFileExists.java#L86-L122","documentation":"Thrown by JobEntryFileExists.loadRep when reading the 'filename' attribute of this job entry from a repository fails. The KettleException is wrapped with a localized message including the entry ObjectId. It indicates a repository read failure for this entry's attributes.","triggerScenarios":"Loading a job from a database repository when getJobEntryAttributeString(id_jobentry, \"filename\") throws — missing rows, dead connection, or repository API error.","commonSituations":"Repository schema mismatch after upgrade; orphaned job entry without attribute rows; transient DB outage while opening a job.","solutions":["Test repository connectivity and reload the job","Verify r_jobentry_attribute contains a 'filename' row for this id_jobentry","Run repository upgrade scripts if the Kettle version changed","Re-save the entry from Spoon to recreate the rows"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Confirm the entry has attribute rows before load\nlong n = rep.countNumJobEntryAttributes(id_jobentry);\nif (n == 0) { throw new IllegalStateException(\"entry \" + id_jobentry + \" has no attributes\"); }","typeGuard":null,"tryCatchPattern":"try {\n    jobEntry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);\n} catch (KettleException e) {\n    logError(\"Repository load failed for entry \" + id_jobentry + \": \" + e.getMessage(), e);\n    // reconnect/retry or fall back to XML\n}","preventionTips":["Keep repository schema in sync with the engine version","Monitor repository DB availability","Avoid orphaning job entries by deleting jobs only via the API/UI"],"tags":["repository","database","job-entry"],"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"}