{"record":{"id":"120c65a825e1d9d0","repo":"pentaho/pentaho-kettle","slug":"xmlinputstream-filenamefieldnotfound","errorCode":null,"errorMessage":"XMLInputStream.FilenameFieldNotFound","messagePattern":"XMLInputStream\\.FilenameFieldNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xmlinputstream/XMLInputStream.java","lineNumber":104,"sourceCode":"      }\n      openNextFile();\n      resetElementCounters();\n      prepareProcessPreviousFields();\n    }\n\n    Object[] outputRowData;\n    if ( meta.sourceFromInput ) {\n      Object[] row = null;\n      if ( first ) {\n        first = false;\n        row = getRow();\n        // get input field index\n        if ( getInputRowMeta() == null ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"XMLInputStream.NoIncomingRowsFound\" ) );\n        }\n        inputFieldIndex = getInputRowMeta().indexOfValue( meta.sourceFieldName );\n        if ( inputFieldIndex < 0 ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"XMLInputStream.FilenameFieldNotFound\",\n              meta.sourceFieldName ) );\n        }\n        prepareProcessPreviousFields();\n      }\n      if ( data.xmlEventReader == null ) {\n        if ( row == null ) {\n          row = getRow();\n        }\n        if ( row == null ) {\n          setOutputDone(); // signal end to receiver(s)\n          return false; // This is the end of this step.\n        }\n        String xml = getInputRowMeta().getString( row, inputFieldIndex );\n        try {\n          data.xmlEventReader = data.staxInstance.createXMLEventReader( new StringReader( xml ) );\n        } catch ( XMLStreamException e ) {\n          throw new KettleException( e );\n        }","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xmlinputstream/XMLInputStream.java#L86-L122","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the XML Input Stream step and re-select the 'Source field name' from the current incoming stream fields.","Make sure the upstream step actually emits a field with exactly that name (names are case-sensitive).","Add/rename the field upstream (e.g. Select Values rename) so the XML content field matches the configured name."],"exampleFix":"// before: upstream renamed the field\nmeta.setSourceFieldName( \"xml_content\" ); // stream now has \"xml_string\"\n// after\nmeta.setSourceFieldName( \"xml_string\" ); // match the actual upstream field","handlingStrategy":"type-guard","validationCode":"// Java API: confirm the configured source field exists in the incoming layout before running\nRowMetaInterface in = transMeta.getPrevStepFields( xmlInputStreamStep );\nif ( in.indexOfValue( meta.getSourceFieldName() ) < 0 ) {\n  throw new IllegalStateException( \"Field not in stream: \" + meta.getSourceFieldName() );\n}","typeGuard":"boolean fieldExists( RowMetaInterface rowMeta, String name ) { return rowMeta != null && rowMeta.indexOfValue( name ) >= 0; }","tryCatchPattern":"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; } }","preventionTips":["After renaming upstream fields, always re-open and re-save the XML Input Stream step.","Field names are case-sensitive - keep naming consistent across steps.","Use Spoon's field-mapping view to verify hops carry the expected fields."],"tags":["pentaho-kettle","xml","streaming","field-mapping"],"backgroundTag":"resource-not-found","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"}