pentaho/pentaho-kettle · error · KettleXMLException

NullIfMeta.Exception.UnableToReadStepInfoFromXML

Error message

NullIfMeta.Exception.UnableToReadStepInfoFromXML

What it means

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.

Solutions

  1. 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.
  2. Re-open the transformation in Spoon; if it fails, rebuild the step and re-enter field mappings.
  3. Validate the XML against the expected Pentaho schema; restore the file from backup or version control.
  4. Check Pentaho version compatibility of the file with your runtime.

Example fix

// before (malformed: field missing name tag)
<fields><field><value>NULL</value></field></fields>
// after
<fields><field><name>amount</name><value>NULL</value></field></fields>
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate the .ktr XML is well-formed
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File("trans.ktr"));

Try / catch

try { TransMeta tm = new TransMeta(inputStream, "UTF-8", true, vars, listener); } catch (KettleXMLException e) { log.error("Unparseable step XML: " + e.getCause(), e); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/2beead49efb13db9. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/nullif/NullIfMeta.java:158

    }
    return retval;
  }

  private void readData( Node stepnode ) throws KettleXMLException {
    try {
      Node fieldNodes = XMLHandler.getSubNode( stepnode, "fields" );
      int count = XMLHandler.countNodes( fieldNodes, "field" );

      allocate( count );

      for ( int i = 0; i < count; i++ ) {
        Node fnode = XMLHandler.getSubNodeByNr( fieldNodes, "field", i );

        fields[i].setFieldName( XMLHandler.getTagValue( fnode, "name" ) );
        fields[i].setFieldValue( XMLHandler.getTagValue( fnode, "value" ) );
      }
    } catch ( Exception e ) {
      throw new KettleXMLException( BaseMessages.getString( PKG, "NullIfMeta.Exception.UnableToReadStepInfoFromXML" ),
          e );
    }
  }

  public void setDefault() {
    int count = 0;

    allocate( count );

    for ( int i = 0; i < count; i++ ) {
      fields[i].setFieldName( "field" + i );
      fields[i].setFieldValue( "" );
    }
  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ) {

View on GitHub (pinned to f3058517a1)