pentaho/pentaho-kettle · error · KettleException

XMLInputStream.FilenameFieldNotFound

Error message

XMLInputStream.FilenameFieldNotFound

What it means

XMLInputStream.processRow throws a KettleException with 'XMLInputStream.FilenameFieldNotFound' (parameterized with the field name) when the configured source field does not exist in the incoming row metadata. The step must be told which incoming field holds the XML source, and that field must be present.

Solutions

  1. Open the XML Input Stream step and re-select the 'Source field name' from the current incoming stream fields.
  2. Make sure the upstream step actually emits a field with exactly that name (names are case-sensitive).
  3. Add/rename the field upstream (e.g. Select Values rename) so the XML content field matches the configured name.

Example fix

// before: upstream renamed the field
meta.setSourceFieldName( "xml_content" ); // stream now has "xml_string"
// after
meta.setSourceFieldName( "xml_string" ); // match the actual upstream field
Defensive patterns

Strategy: type-guard

Validate before calling

// Java API: confirm the configured source field exists in the incoming layout before running
RowMetaInterface in = transMeta.getPrevStepFields( xmlInputStreamStep );
if ( in.indexOfValue( meta.getSourceFieldName() ) < 0 ) {
  throw new IllegalStateException( "Field not in stream: " + meta.getSourceFieldName() );
}

Type guard

boolean fieldExists( RowMetaInterface rowMeta, String name ) { return rowMeta != null && rowMeta.indexOfValue( name ) >= 0; }

Try / catch

try { trans.execute( null ); } catch ( KettleException e ) { if ( e.getMessage().contains( "FilenameFieldNotFound" ) ) { log.error( "Re-select the source field in the XML Input Stream step" ); } else { throw e; } }

Prevention

When it happens

Trigger: First processRow: inputFieldIndex = getInputRowMeta().indexOfValue( meta.sourceFieldName ) returns < 0, i.e. the 'Source field name' configured in the step does not match any field of the incoming stream.

Common situations: Renaming or removing the upstream field without updating the step, selecting a field from the wrong upstream step, case-sensitive name mismatch, or switching the upstream step that produces the XML column.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xmlinputstream/XMLInputStream.java:104

      }
      openNextFile();
      resetElementCounters();
      prepareProcessPreviousFields();
    }

    Object[] outputRowData;
    if ( meta.sourceFromInput ) {
      Object[] row = null;
      if ( first ) {
        first = false;
        row = getRow();
        // get input field index
        if ( getInputRowMeta() == null ) {
          throw new KettleException( BaseMessages.getString( PKG, "XMLInputStream.NoIncomingRowsFound" ) );
        }
        inputFieldIndex = getInputRowMeta().indexOfValue( meta.sourceFieldName );
        if ( inputFieldIndex < 0 ) {
          throw new KettleException( BaseMessages.getString( PKG, "XMLInputStream.FilenameFieldNotFound",
              meta.sourceFieldName ) );
        }
        prepareProcessPreviousFields();
      }
      if ( data.xmlEventReader == null ) {
        if ( row == null ) {
          row = getRow();
        }
        if ( row == null ) {
          setOutputDone(); // signal end to receiver(s)
          return false; // This is the end of this step.
        }
        String xml = getInputRowMeta().getString( row, inputFieldIndex );
        try {
          data.xmlEventReader = data.staxInstance.createXMLEventReader( new StringReader( xml ) );
        } catch ( XMLStreamException e ) {
          throw new KettleException( e );
        }

View on GitHub (pinned to f3058517a1)