{"record":{"id":"30f5a94f30062b9b","repo":"pentaho/pentaho-kettle","slug":"template-plugin-unable-to-read-step-info-from-xml-node","errorCode":null,"errorMessage":"Template Plugin Unable to read step info from XML node","messagePattern":"Template Plugin Unable to read step info from XML node","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/edi2xml/impl/src/main/java/org/pentaho/di/trans/steps/edi2xml/Edi2XmlMeta.java","lineNumber":96,"sourceCode":"\n  @Override\n  public String getXML() throws KettleValueException {\n    StringBuilder retval = new StringBuilder();\n\n    retval.append( \"   \" + XMLHandler.addTagValue( \"inputfield\", inputField ) );\n    retval.append( \"   \" + XMLHandler.addTagValue( \"outputfield\", outputField ) );\n\n    return retval.toString();\n  }\n\n  @Override\n  public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {\n\n    try {\n      setInputField( XMLHandler.getNodeValue( XMLHandler.getSubNode( stepnode, \"inputfield\" ) ) );\n      setOutputField( XMLHandler.getNodeValue( XMLHandler.getSubNode( stepnode, \"outputfield\" ) ) );\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Template Plugin Unable to read step info from XML node\", e );\n    }\n\n  }\n\n  @Override\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      inputField = rep.getStepAttributeString( id_step, \"inputfield\" );\n      outputField = rep.getStepAttributeString( id_step, \"outputfield\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages\n        .getString( PKG, \"Edi2Xml.Exception.UnexpectedErrorInReadingStepInfo\" ), e );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/edi2xml/impl/src/main/java/org/pentaho/di/trans/steps/edi2xml/Edi2XmlMeta.java#L78-L114","documentation":"Edi2XmlMeta.loadXML reads the 'inputfield' and 'outputfield' child nodes of the step's XML definition. Any exception during parsing is wrapped in a KettleXMLException with this message. It indicates the EDI 2 XML step metadata could not be restored from the .ktr XML.","triggerScenarios":"Calling loadXML on a stepnode missing the 'inputfield'/'outputfield' subnodes or with malformed XML, so getNodeValue/getSubNode throws.","commonSituations":"Transformation files edited by hand or by older plugin versions; XMLHandler.getSubNode returning an unexpected node; corrupted .ktr files.","solutions":["Open the .ktr in a text editor and confirm <inputfield> and <outputfield> nodes exist inside the step node","Re-add the Edi2Xml step in Spoon and re-save the transformation","Check the plugin version that wrote the file matches the reading version","Read the wrapped cause 'e' to pinpoint the parse failure"],"exampleFix":"// before\n// <step><name>EDI</name></step> (missing fields)\n// after\n// <step><name>EDI</name><inputfield>line</inputfield><outputfield>xml</outputfield></step>","handlingStrategy":"validation","validationCode":"// confirm the step node has required children before loadXML\nif (XMLHandler.getSubNode(stepnode, \"inputfield\") == null || XMLHandler.getSubNode(stepnode, \"outputfield\") == null) {\n  throw new IllegalArgumentException(\"Edi2Xml step node missing inputfield/outputfield\");\n}","typeGuard":null,"tryCatchPattern":"try { meta.loadXML(stepnode, databases, metaStore); } catch (KettleXMLException e) { logger.error(\"Cannot restore Edi2Xml step from XML\", e); throw e; }","preventionTips":["Avoid hand-editing .ktr files","Keep the edi2xml plugin version consistent across environments","Validate transformation XML in CI before deployment"],"tags":["xml","pdi","step-metadata","deserialization"],"backgroundTag":"schema-validation-failed","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"}