pentaho/pentaho-kettle · error · KettleException

JobMeta.Exception.CanNotFindJob

Error message

JobMeta.Exception.CanNotFindJob

What it means

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.

Solutions

  1. Delete the orphaned job row and re-save the job into the repository.
  2. Verify the job name and directory path match exactly (case, leading slashes) what is stored.
  3. Rebuild or repair the repository metadata tables if multiple rows are inconsistent.
  4. Catch KettleException and prompt the user to re-create the job since the stored record is unusable.
Defensive patterns

Strategy: fallback

Validate before calling

// verify the job really resolves to a loadable record before relying on it
RepositoryObject meta = repo.getJobAndSubJobsMetaInformation(jobname, directory); // or loadJobMeta in a probe
if (meta == null) throw new IllegalStateException("Job row exists but is not loadable: " + jobname);

Type guard

boolean isLoadableJobName(String name) {
  return name != null && !name.trim().isEmpty();
}

Try / catch

try {
  jobMeta = repo.loadJobMeta(jobname, dir, null);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("CanNotFindJob")) {
    // treat as corrupted/orphaned row: offer re-save or import from file
    jobMeta = loadJobFromFileFallback();
  } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java:504

          loadRepParameters( jobMeta );

          // 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

View on GitHub (pinned to f3058517a1)