{"record":{"id":"2ce0545edcf0324a","repo":"pentaho/pentaho-kettle","slug":"jobhopmeta-exception-unabletoloadhopinfoxml","errorCode":null,"errorMessage":"JobHopMeta.Exception.UnableToLoadHopInfoXML","messagePattern":"JobHopMeta\\.Exception\\.UnableToLoadHopInfoXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/JobHopMeta.java","lineNumber":86,"sourceCode":"      fromNr = Const.toInt( fromNrValue, 0 );\n      toNr = Const.toInt( toNrValue, 0 );\n\n      this.from = job.findJobEntry( fromNameValue, fromNr, true );\n      this.to = job.findJobEntry( toNameValue, toNr, true );\n\n      if ( enabledValue == null ) {\n        enabled = true;\n      } else {\n        enabled = \"Y\".equalsIgnoreCase( enabledValue );\n      }\n      if ( evaluationValue == null ) {\n        evaluation = true;\n      } else {\n        evaluation = \"Y\".equalsIgnoreCase( evaluationValue );\n      }\n      unconditional = \"Y\".equalsIgnoreCase( unconditionalValue );\n    } catch ( Exception e ) {\n      throw new KettleXMLException(\n        BaseMessages.getString( PKG, \"JobHopMeta.Exception.UnableToLoadHopInfoXML\" ), e );\n    }\n  }\n\n  public String getXML() {\n    StringBuilder retval = new StringBuilder( 200 );\n    String shortSpaces = \"    \";\n    String longSpaces = \"      \";\n    if ( ( null != this.from ) && ( null != this.to ) ) {\n      retval.append( shortSpaces ).append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"from\", this.from.getName() ) );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"to\", this.to.getName() ) );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"from_nr\", this.from.getNr() ) );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"to_nr\", this.to.getNr() ) );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"enabled\", enabled ) );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"evaluation\", evaluation ) );\n      retval.append( longSpaces ).append( XMLHandler.addTagValue( \"unconditional\", unconditional ) );\n      retval.append( shortSpaces ).append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR );","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/JobHopMeta.java#L68-L104","documentation":"JobHopMeta's XML-loading constructor parses a <hop> node (from/unidirectional/enable/evaluation/unconditional attributes and nested flows). Any exception during that parsing is wrapped in a KettleXMLException with this localized message. It means a job hop definition in the job's XML is malformed or incompatible.","triggerScenarios":"Loading a JobMeta from XML where a hop element has missing/invalid attributes (e.g. non-boolean 'unconditional' or 'enabled' values) or a corrupt nested <from>/<to> node, causing the generic catch to fire.","commonSituations":"Hand-edited .kjb files; XML produced by newer/older Pentaho versions with schema drift; truncated or corrupted files from bad transfer (FTP ASCII mode, partial checkout).","solutions":["Open the .kjb file and inspect each <hop> element for missing or invalid attributes; fix or delete the bad hop.","Get a clean copy of the job file from version control or backup; diff against the corrupt one.","Open the job in Spoon; it may repair/ignore minor hop issues, then re-save.","Regenerate the job programmatically rather than editing XML by hand.","Check the chained cause (getCause()) for the exact parse failure."],"exampleFix":"// before: corrupted hop XML\n// <hop from=\"Start\" to=\"Transform\" unconditional=\"maybe\"/>\n// after\n// <hop from=\"Start\" to=\"Transform\" unconditional=\"Y\" enabled=\"Y\"/>","handlingStrategy":"validation","validationCode":"Document doc = XMLHandler.loadXMLFile(kjbFile);\nfor (Node hop : XMLHandler.getNodes(doc.getDocumentElement(), \"hop\")) {\n  for (String attr : new String[]{\"from\",\"to\",\"unconditional\",\"enabled\"}) {\n    if (XMLHandler.getAttributeValue(hop, attr) == null)\n      throw new IllegalArgumentException(\"hop missing attribute \" + attr);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobMeta = new JobMeta(fileName, repo, metaStore, null);\n} catch (KettleXMLException e) {\n  if (e.getMessage().contains(\"UnableToLoadHopInfoXML\") || BaseMessages.getString(PKG, \"JobHopMeta.Exception.UnableToLoadHopInfoXML\").contains(\"\")) {\n    log.error(\"Corrupt hop in {}: {}\", fileName, e.getCause());\n  }\n  throw e;\n}","preventionTips":["Never hand-edit .kjb hop elements; edit in Spoon and re-save.","Store job files in version control to diff against clean copies.","Transfer job files in binary mode to avoid truncation.","After Pentaho upgrades, re-save legacy jobs to normalize hop XML."],"tags":["xml","parsing","job-hop"],"backgroundTag":"xml-parse-error","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"}