pentaho/pentaho-kettle · error · KettleException
GetXMLData.Exception.CouldnotFindField (localized message…
Error message
GetXMLData.Exception.CouldnotFindField (localized message with field name)
What it means
Thrown by ReadNextString when the configured XML source field cannot be found in the incoming row stream: getInputRowMeta().indexOfValue(meta.getXMLField()) returns -1. The step logs 'ErrorFindingField' with the field name and throws this KettleException including the field name.
Solutions
- Compare the field name in the step dialog with the actual incoming row fields (view input metadata / 'Preview' the upstream step) and fix the name or casing.
- Re-select the field from the dropdown in the step dialog instead of typing it, so it binds to real stream metadata.
- If an upstream step conditionally drops the field, make its presence guaranteed before GetXMLData runs.
Example fix
// before
meta.setXMLField( "XmlString" ); // upstream field is actually 'xml_string'
// after
int idx = getInputRowMeta().indexOfValue( "xml_string" );
if ( idx < 0 ) {
throw new KettleException( "Field xml_string not found in input row" );
}
meta.setXMLField( "xml_string" ); Defensive patterns
Strategy: validation
Validate before calling
RowMetaInterface in = transMeta.getPrevStepFields(stepMeta);
if (in.indexOfValue(meta.getXMLField()) < 0) {
throw new IllegalStateException("Field " + meta.getXMLField()
+ " not found in input row of GetXMLData");
} Try / catch
try {
trans.execute(null);
} catch (KettleException e) {
if (e.getMessage().contains("CouldnotFindField")) {
logError("Upstream row no longer contains field; check upstream renames");
} else { throw e; }
} Prevention
- Re-select fields from the dropdown after changing upstream steps.
- Use 'Check transformations' (F9 metadata check) before running.
- Avoid renaming stream fields without searching for downstream references.
- Keep field names case-consistent across steps.
When it happens
Trigger: The 'XML field' name set in the step does not match any field of the input row at runtime — upstream step renamed/removed the field, a case mismatch, or the step's row metadata changed after the field name was entered.
Common situations: Renaming a column in an upstream step (e.g. Text File Input or Table Input) without updating GetXMLData; field name typed with wrong casing; feeding the step from a stream that no longer emits the XML column; reordering steps so GetXMLData runs before the field is added.
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
- MappingInput.Exception.UnableToFindMappedValue
- MappingInput.Exception.UnableToFindMappedValue
- SalesforceUpsert.FieldNotFound
- ScriptMeta.Exception.FieldToReplaceNotFound
- TableExists.Exception.CouldnotFindField
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/8d07bbaed07307d0.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLData.java:377
}
// For String to <type> conversions, we allocate a conversion meta data row as well...
//
data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );
// Check is XML field is provided
if ( Utils.isEmpty( meta.getXMLField() ) ) {
logError( BaseMessages.getString( PKG, "GetXMLData.Log.NoField" ) );
throw new KettleException( BaseMessages.getString( PKG, "GetXMLData.Log.NoField" ) );
}
// cache the position of the field
if ( data.indexOfXmlField < 0 ) {
data.indexOfXmlField = getInputRowMeta().indexOfValue( meta.getXMLField() );
if ( data.indexOfXmlField < 0 ) {
// The field is unreachable !
logError( BaseMessages.getString( PKG, "GetXMLData.Log.ErrorFindingField", meta.getXMLField() ) );
throw new KettleException( BaseMessages.getString( PKG, "GetXMLData.Exception.CouldnotFindField", meta
.getXMLField() ) );
}
}
}
if ( meta.isInFields() ) {
// get XML field value
String Fieldvalue = getInputRowMeta().getString( data.readrow, data.indexOfXmlField );
if ( log.isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "GetXMLData.Log.XMLStream", meta.getXMLField(), Fieldvalue ) );
}
if ( meta.getIsAFile() ) {
FileObject file = null;
try {
// XML source is a file.
file = KettleVFS.getInstance( getTransMeta().getBowl() )View on GitHub (pinned to f3058517a1)