{"record":{"id":"702f2aab9fbb7b92","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-step-info-from-xml-datagridmeta","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":"engine/src/main/java/org/pentaho/di/trans/steps/datagrid/DataGridMeta.java","lineNumber":328,"sourceCode":"        if ( \"line\".equals( lineNode.getNodeName() ) ) {\n          List<String> line = new ArrayList<>();\n          Node itemNode = lineNode.getFirstChild();\n          while ( itemNode != null ) {\n            if ( \"item\".equals( itemNode.getNodeName() ) ) {\n              String itemNodeValue = XMLHandler.getNodeValue( itemNode );\n              line.add( itemNodeValue );\n            }\n            itemNode = itemNode.getNextSibling();\n          }\n\n          dataLines.add( line );\n\n        }\n\n        lineNode = lineNode.getNextSibling();\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to load step info from XML\", e );\n    }\n  }\n\n  @Override\n  public void setDefault() {\n    int i;\n    int nrfields = 0;\n\n    allocate( nrfields );\n\n    DecimalFormat decimalFormat = new DecimalFormat();\n\n    for ( i = 0; i < nrfields; i++ ) {\n      fieldName[i] = FIELD + i;\n      fieldType[i] = \"Number\";\n      fieldFormat[i] = \"\\u00A40,000,000.00;\\u00A4-0,000,000.00\";\n      fieldLength[i] = 9;\n      fieldPrecision[i] = 2;","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/datagrid/DataGridMeta.java#L310-L346","documentation":"DataGridMeta.readData parses the step's XML definition (field and data line nodes) into step metadata. Any exception thrown while walking the XML tree is wrapped in this KettleXMLException so the transformation fails to load with a clear message and the underlying cause attached.","triggerScenarios":"loadXML is called with a malformed or unexpected <step> node: missing <fields>/<data> elements, wrong child node types, or XMLHandler.getTagValue returning values that break parsing (e.g. null where an attribute list is expected).","commonSituations":"Hand-edited or truncated .ktr files; transformations produced by a newer Pentaho version with extra/renamed XML elements being read by an older engine; XML copied between transformations with missing sections.","solutions":["Open the .ktr in a text editor and validate the <fields> and <data> sections of the Data Grid step against a working example.","Reload the step by deleting and re-adding the Data Grid step in Spoon so defaults are regenerated.","Check that the engine version matches the file version; upgrade the engine or re-save the transformation with the current Spoon.","Inspect the chained cause ('Caused by') of the KettleXMLException for the real parsing failure."],"exampleFix":"// before: hand-edited XML missing <fields> node\n<step><name>Grid</name><type>DataGrid</type><data>...</data></step>\n// after: complete structure\n<step><name>Grid</name><type>DataGrid</type><fields>...</fields><data>...</data></step>","handlingStrategy":"try-catch","validationCode":"// validate the Data Grid step XML before load\nNode stepnode = ...;\nif (XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode,\"fields\")) == null && XMLHandler.getSubNode(stepnode,\"fields\") == null)\n  throw new IllegalArgumentException(\"DataGrid step is missing <fields> section\");","typeGuard":"boolean hasFields(Node n){ return XMLHandler.getSubNode(n,\"fields\") != null; }","tryCatchPattern":"try { meta.loadXML(stepnode, databases, metaStore); }\ncatch (KettleXMLException e) {\n  logError(\"DataGrid step XML invalid: \" + e.getCause(), e);\n  // fall back to defaults or abort the load\n}","preventionTips":["Never hand-edit .ktr XML; edit steps in Spoon.","Keep the Pentaho engine version aligned with the file version.","Validate .ktr files against the schema/version before loading.","Always inspect the chained cause of KettleXMLException."],"tags":["kettle","xml-parsing","transformation-load"],"backgroundTag":"json-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"}