pentaho/pentaho-kettle · error · KettleException

Unexpected error during job metadata load

Error message

Unexpected error during job metadata load

What it means

getJobMeta(rep, metaStore, space) wraps the entire sub-job metadata load (via MetaFileLoaderImpl) in a catch-all that rethrows any Exception as KettleException('Unexpected error during job metadata load', e). It is a generic wrapper: the real cause (repository error, XML parse failure, metastore problem, NPE) is in the chained cause.

Solutions

  1. Inspect e.getCause() (stack trace) to find the true failure and fix it
  2. Validate the referenced .kjb file opens correctly in Spoon (corruption/XML issues)
  3. Verify repository and metastore connectivity and configuration
  4. Ensure all required PDI plugins/dependencies for the sub-job's entries are installed

Example fix

// caller-side: unwrap the cause for a useful message
try {
  JobMeta jm = jobEntry.getJobMeta(rep, metaStore, space);
} catch (KettleException e) {
  Throwable root = e;
  while (root.getCause() != null) root = root.getCause();
  logError("Job load failed: " + root.getMessage(), root);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-checks before calling getJobMeta
if (rep != null && specificationMethod != ObjectLocationSpecificationMethod.FILENAME
    && specificationMethod != ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME
    && specificationMethod != ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE) {
  throw new IllegalArgumentException("Unknown specification method");
}

Try / catch

try {
  JobMeta jm = jobEntry.getJobMeta(rep, metaStore, space);
} catch (KettleException e) {
  Throwable root = e;
  while (root.getCause() != null) root = root.getCause();
  // dispatch on root: KettleXMLException -> file corrupt; repository errors -> connectivity
  logError("Root cause: " + root.getMessage(), root);
  throw e;
}

Prevention

When it happens

Trigger: Any exception thrown inside the load path: repository loadJob failures, KettleXMLException parsing a .kjb file, metastore access errors, missing run configuration, or NPEs when specificationMethod state is inconsistent.

Common situations: Corrupt or hand-edited .kjb file that fails XML parsing; repository exception during load; metaStore misconfigured; plugin dependency missing so job meta cannot be deserialized.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/job/JobEntryJob.java:1458

    if ( jobMeta != null ) {
      jobMeta.initializeVariablesFrom( tmpSpace );
    }
    return jobMeta;
  }

  public JobMeta getJobMeta( Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException {
    try {
      IMetaFileLoader<JobMeta> metaFileLoader = new MetaFileLoaderImpl<>( this, specificationMethod );
      JobMeta jobMeta = metaFileLoader.getMetaForEntry( parentJobMeta.getBowl(), rep, metaStore, space );

      if ( jobMeta != null ) {
        jobMeta.setRepository( rep );
        jobMeta.setMetaStore( metaStore );
      }

      return jobMeta;
    } catch ( Exception e ) {
      throw new KettleException( "Unexpected error during job metadata load", e );
    }

  }

  /**
   * @return Returns the runEveryResultRow.
   */
  public boolean isExecPerRow() {
    return execPerRow;
  }

  /**
   * @param runEveryResultRow
   *          The runEveryResultRow to set.
   */
  public void setExecPerRow( boolean runEveryResultRow ) {
    this.execPerRow = runEveryResultRow;
  }

View on GitHub (pinned to f3058517a1)