{"record":{"id":"1059bf794dcdec79","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-during-job-metadata-load","errorCode":null,"errorMessage":"Unexpected error during job metadata load","messagePattern":"Unexpected error during job metadata load","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/job/JobEntryJob.java","lineNumber":1458,"sourceCode":"    if ( jobMeta != null ) {\n      jobMeta.initializeVariablesFrom( tmpSpace );\n    }\n    return jobMeta;\n  }\n\n  public JobMeta getJobMeta( Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException {\n    try {\n      IMetaFileLoader<JobMeta> metaFileLoader = new MetaFileLoaderImpl<>( this, specificationMethod );\n      JobMeta jobMeta = metaFileLoader.getMetaForEntry( parentJobMeta.getBowl(), rep, metaStore, space );\n\n      if ( jobMeta != null ) {\n        jobMeta.setRepository( rep );\n        jobMeta.setMetaStore( metaStore );\n      }\n\n      return jobMeta;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unexpected error during job metadata load\", e );\n    }\n\n  }\n\n  /**\n   * @return Returns the runEveryResultRow.\n   */\n  public boolean isExecPerRow() {\n    return execPerRow;\n  }\n\n  /**\n   * @param runEveryResultRow\n   *          The runEveryResultRow to set.\n   */\n  public void setExecPerRow( boolean runEveryResultRow ) {\n    this.execPerRow = runEveryResultRow;\n  }","sourceCodeStart":1440,"sourceCodeEnd":1476,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/job/JobEntryJob.java#L1440-L1476","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect e.getCause() (stack trace) to find the true failure and fix it","Validate the referenced .kjb file opens correctly in Spoon (corruption/XML issues)","Verify repository and metastore connectivity and configuration","Ensure all required PDI plugins/dependencies for the sub-job's entries are installed"],"exampleFix":"// caller-side: unwrap the cause for a useful message\ntry {\n  JobMeta jm = jobEntry.getJobMeta(rep, metaStore, space);\n} catch (KettleException e) {\n  Throwable root = e;\n  while (root.getCause() != null) root = root.getCause();\n  logError(\"Job load failed: \" + root.getMessage(), root);\n}","handlingStrategy":"try-catch","validationCode":"// pre-checks before calling getJobMeta\nif (rep != null && specificationMethod != ObjectLocationSpecificationMethod.FILENAME\n    && specificationMethod != ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME\n    && specificationMethod != ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE) {\n  throw new IllegalArgumentException(\"Unknown specification method\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  JobMeta jm = jobEntry.getJobMeta(rep, metaStore, space);\n} catch (KettleException e) {\n  Throwable root = e;\n  while (root.getCause() != null) root = root.getCause();\n  // dispatch on root: KettleXMLException -> file corrupt; repository errors -> connectivity\n  logError(\"Root cause: \" + root.getMessage(), root);\n  throw e;\n}","preventionTips":["Always inspect and log the full cause chain — this message is only a wrapper","Validate .kjb files open in Spoon after manual edits or merges","Keep the metastore and repository configuration verified in each environment","Install all plugins required by the sub-job's entries before running"],"tags":["pdi","kettle","wrapper","metadata"],"backgroundTag":"internal-invariant-violation","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"}