{"record":{"id":"e02eadd8fea368aa","repo":"pentaho/pentaho-kettle","slug":"jobmeta-exception-cannotfindjob","errorCode":null,"errorMessage":"JobMeta.Exception.CanNotFindJob","messagePattern":"JobMeta\\.Exception\\.CanNotFindJob","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java","lineNumber":504,"sourceCode":"\n          loadRepParameters( jobMeta );\n\n          // Finally, clear the changed flags...\n          jobMeta.clearChanged();\n          if ( monitor != null ) {\n            monitor.subTask( BaseMessages.getString( PKG, \"JobMeta.Monitor.FinishedLoadOfJob\" ) );\n          }\n          if ( monitor != null ) {\n            monitor.done();\n          }\n\n          // close prepared statements, minimize locking etc.\n          //\n          repository.connectionDelegate.closeAttributeLookupPreparedStatements();\n\n          return jobMeta;\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"JobMeta.Exception.CanNotFindJob\" ) + jobname );\n        }\n      } catch ( KettleException dbe ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"JobMeta.Exception.AnErrorOccuredReadingJob\", jobname ), dbe );\n      } finally {\n        jobMeta.initializeVariablesFrom( jobMeta.getParentVariableSpace() );\n        jobMeta.setInternalKettleVariables();\n      }\n    }\n  }\n\n  /**\n   * Load the parameters of this job from the repository. The current ones already loaded will be erased.\n   *\n   * @param jobMeta\n   *          The target job for the parameters\n   *\n   * @throws KettleException","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java#L486-L522","documentation":"Thrown by loadJobMeta when the job row lookup succeeds in finding an id for the given name/directory, but the subsequent load produces a null or empty JobMeta — effectively 'I have an ID but could not find/load the job'. The message is a localized string from JobMeta messages, concatenated with the job name. It signals an inconsistent repository row state rather than a read failure.","triggerScenarios":"Calling repository.loadJobMeta(name, directory, monitor) where r_job contains a row matching the name but the returned job metadata is null after loading — e.g. the row's fields are empty, partially deleted, or the name/directory match resolved an ID but the load returned nothing.","commonSituations":"Orphaned or partially deleted job rows after an aborted save; case-sensitivity mismatches causing the ID lookup to match a stale row; manual DB manipulation of r_job; repository corruption after a failed migration.","solutions":["Delete the orphaned job row and re-save the job into the repository.","Verify the job name and directory path match exactly (case, leading slashes) what is stored.","Rebuild or repair the repository metadata tables if multiple rows are inconsistent.","Catch KettleException and prompt the user to re-create the job since the stored record is unusable."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// verify the job really resolves to a loadable record before relying on it\nRepositoryObject meta = repo.getJobAndSubJobsMetaInformation(jobname, directory); // or loadJobMeta in a probe\nif (meta == null) throw new IllegalStateException(\"Job row exists but is not loadable: \" + jobname);","typeGuard":"boolean isLoadableJobName(String name) {\n  return name != null && !name.trim().isEmpty();\n}","tryCatchPattern":"try {\n  jobMeta = repo.loadJobMeta(jobname, dir, null);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"CanNotFindJob\")) {\n    // treat as corrupted/orphaned row: offer re-save or import from file\n    jobMeta = loadJobFromFileFallback();\n  } else { throw e; }\n}","preventionTips":["Do not edit repository tables (r_job) manually; use repository APIs for deletes.","Avoid concurrent deletes/saves of the same job from multiple client sessions.","Back up jobs as .kjb files so corrupted repository rows can be re-imported.","Periodically validate the repository schema with the repository repair/upgrade tools."],"tags":["repository","job","not-found","corrupt-data"],"backgroundTag":"record-not-found","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"}