{"record":{"id":"2beead49efb13db9","repo":"pentaho/pentaho-kettle","slug":"nullifmeta-exception-unabletoreadstepinfofromxml","errorCode":null,"errorMessage":"NullIfMeta.Exception.UnableToReadStepInfoFromXML","messagePattern":"NullIfMeta\\.Exception\\.UnableToReadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/nullif/NullIfMeta.java","lineNumber":158,"sourceCode":"    }\n    return retval;\n  }\n\n  private void readData( Node stepnode ) throws KettleXMLException {\n    try {\n      Node fieldNodes = XMLHandler.getSubNode( stepnode, \"fields\" );\n      int count = XMLHandler.countNodes( fieldNodes, \"field\" );\n\n      allocate( count );\n\n      for ( int i = 0; i < count; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fieldNodes, \"field\", i );\n\n        fields[i].setFieldName( XMLHandler.getTagValue( fnode, \"name\" ) );\n        fields[i].setFieldValue( XMLHandler.getTagValue( fnode, \"value\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"NullIfMeta.Exception.UnableToReadStepInfoFromXML\" ),\n          e );\n    }\n  }\n\n  public void setDefault() {\n    int count = 0;\n\n    allocate( count );\n\n    for ( int i = 0; i < count; i++ ) {\n      fields[i].setFieldName( \"field\" + i );\n      fields[i].setFieldValue( \"\" );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,\n      VariableSpace space, Repository repository, IMetaStore metaStore ) {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/nullif/NullIfMeta.java#L140-L176","documentation":"NullIfMeta.readData(), invoked by loadXML(), parses the step's <fields> node from the transformation XML, reading per-field <field><name>/<value> tags. Any exception during XML parsing (malformed XML, missing nodes, unexpected structure) is wrapped in a KettleXMLException with this message and the original cause.","triggerScenarios":"Calling loadXML(stepNode, databases, metaStore) on a <step node> whose XML lacks the 'fields'/'field' sub-nodes or contains malformed/invalid markup that XMLHandler cannot navigate.","commonSituations":"Hand-edited or truncated .ktr file; XML generated by an older/newer Pentaho version with a different schema; copy-paste of step XML between transformations with missing child nodes; corrupted file transfer.","solutions":["Open the .ktr file in a text editor and verify each Null If step has a well-formed <fields> block with <field><name> and <value> children.","Re-open the transformation in Spoon; if it fails, rebuild the step and re-enter field mappings.","Validate the XML against the expected Pentaho schema; restore the file from backup or version control.","Check Pentaho version compatibility of the file with your runtime."],"exampleFix":"// before (malformed: field missing name tag)\n<fields><field><value>NULL</value></field></fields>\n// after\n<fields><field><name>amount</name><value>NULL</value></field></fields>","handlingStrategy":"try-catch","validationCode":"// Pre-validate the .ktr XML is well-formed\nDocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(\"trans.ktr\"));","typeGuard":null,"tryCatchPattern":"try { TransMeta tm = new TransMeta(inputStream, \"UTF-8\", true, vars, listener); } catch (KettleXMLException e) { log.error(\"Unparseable step XML: \" + e.getCause(), e); }","preventionTips":["Never hand-edit .ktr XML without validating afterwards.","Always edit transformations through Spoon.","Keep source files in version control to restore known-good metadata.","Match the Pentaho version used to create the file with the runtime version."],"tags":["kettle","xml","parse-error","metadata-load"],"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"}