{"record":{"id":"aa1ecf250fd6d9f3","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-step-info-from-xml-addxmlmeta","errorCode":null,"errorMessage":"Unable to load step info from XML","messagePattern":"Unable to load step info from XML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/addxml/AddXMLMeta.java","lineNumber":190,"sourceCode":"      for ( int i = 0; i < nrfields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n\n        outputFields[i] = new XMLField();\n        outputFields[i].setFieldName( XMLHandler.getTagValue( fnode, \"name\" ) );\n        outputFields[i].setElementName( XMLHandler.getTagValue( fnode, \"element\" ) );\n        outputFields[i].setType( XMLHandler.getTagValue( fnode, \"type\" ) );\n        outputFields[i].setFormat( XMLHandler.getTagValue( fnode, \"format\" ) );\n        outputFields[i].setCurrencySymbol( XMLHandler.getTagValue( fnode, \"currency\" ) );\n        outputFields[i].setDecimalSymbol( XMLHandler.getTagValue( fnode, \"decimal\" ) );\n        outputFields[i].setGroupingSymbol( XMLHandler.getTagValue( fnode, \"group\" ) );\n        outputFields[i].setNullString( XMLHandler.getTagValue( fnode, \"nullif\" ) );\n        outputFields[i].setLength( Const.toInt( XMLHandler.getTagValue( fnode, \"length\" ), -1 ) );\n        outputFields[i].setPrecision( Const.toInt( XMLHandler.getTagValue( fnode, \"precision\" ), -1 ) );\n        outputFields[i].setAttribute( \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( fnode, \"attribute\" ) ) );\n        outputFields[i].setAttributeParentName( XMLHandler.getTagValue( fnode, \"attributeParentName\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to load step info from XML\", e );\n    }\n  }\n\n  public void setDefault() {\n    omitXMLheader = true;\n    omitNullValues = false;\n    encoding = Const.XML_ENCODING;\n\n    valueName = \"xmlvaluename\";\n    rootNode = \"Row\";\n\n    int nrfields = 0;\n\n    allocate( nrfields );\n\n    for ( int i = 0; i < nrfields; i++ ) {\n      outputFields[i] = new XMLField();\n","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/addxml/AddXMLMeta.java#L172-L208","documentation":"AddXMLMeta.readData parses the step's XML definition (from a .ktr file) with XMLHandler.getTagValue calls. Any exception (malformed XML, missing nodes producing unexpected state, class issues) is wrapped in KettleXMLException with the fixed message 'Unable to load step info from XML'. It signals the transformation file's step section is not parseable into AddXMLMeta.","triggerScenarios":"loadXML reads a transformation XML whose <fields> entries lack expected child tags or whose XML is malformed, causing getTagValue/loop code to throw inside readData.","commonSituations":"Hand-edited .ktr files; transformation produced by a newer Pentaho version with a changed XML schema opened in an older version; truncated/corrupt file transfer.","solutions":["Open the .ktr in Spoon and fix or delete the broken AddXML step definition","Diff the step's XML block against a known-good AddXML step and repair missing tags","Check Pentaho/PDI version compatibility between the file and the runtime","Restore the transformation from version control or backup"],"exampleFix":"// before (malformed hand-edited step XML)\n<field><name>a</name></field>\n// after (complete field node)\n<field><name>a</name><element>root</element><attribute>N</attribute><length>-1</length><precision>-1</precision></field>","handlingStrategy":"try-catch","validationCode":"Document doc = XMLHandler.loadXMLFile(ktrFile);\nNode stepNode = findStepNode(doc, \"AddXML\");\nif (stepNode == null || XMLHandler.getNodes(stepNode, \"fields\").isEmpty()) {\n  failFast(\"AddXML step XML definition incomplete\");\n}","typeGuard":null,"tryCatchPattern":"try { meta.loadXML(stepNode, databases, metaStore, null); }\ncatch (KettleXMLException e) {\n  logError(\"AddXML step XML unreadable: \" + e.getMessage(), e.getCause());\n}","preventionTips":["Don't hand-edit .ktr XML; edit via Spoon","Keep PDI runtime and file versions aligned","Keep transformations in version control for recovery"],"tags":["xml","serialization","step-metadata","kettle"],"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"}