pentaho/pentaho-kettle · error · KettleException

Field '' was not found in step's input fields

Error message

Field '' was not found in step's input fields

What it means

When the Avro Input step is configured to read its data stream from an incoming field (LocationDescriptor.FIELD_NAME), initializeSource looks up that field by name in the row metadata. If indexOfValue returns -1 the configured field does not exist among the step's input fields, so a KettleException is thrown naming the missing field.

Solutions

  1. Correct the field name in the Avro Input 'data location' setting to match an actual input field
  2. Add/restore the upstream step that produces the field
  3. Use Get Fields / preview upstream to confirm the exact field name

Example fix

// before
meta.setDataLocation("avro_payload "); // trailing space, not in input
// after
meta.setDataLocation("avro_payload"); // matches upstream field exactly
Defensive patterns

Strategy: validation

Validate before calling

String fieldName = meta.getDataLocation();
if (fieldName != null && getInputRowMeta() != null
    && getInputRowMeta().indexOfValue(fieldName) == -1) {
  throw new KettleException("Configured Avro source field '" + fieldName
      + "' missing from input fields: " + getInputRowMeta().getFieldNames());
}

Try / catch

try {
  initializeSource(row);
} catch (KettleException e) {
  logError("Check the Avro Input field-name location: " + e.getMessage());
  setErrors(1);
}

Prevention

When it happens

Trigger: meta.getDataLocation() names a field that is not present in the rows arriving at the Avro Input step at runtime.

Common situations: Upstream step renamed or removed the field; the field name was entered with wrong case or extra spaces; hop ordering changed so the field is no longer produced before this step.

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/321bc07ac3244e98. Report an issue: GitHub.

Appendix: source

Thrown at plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInput.java:250

    if ( getInputRowMeta() != null ) {
      for ( AvroLookupField lookupField : meta.getLookupFields() ) {
        IndexedLookupField indexedLookupField = resolveLookupField( lookupField );
        if ( indexedLookupField != null ) {
          lookupFields.add( indexedLookupField );
        }
      }
    }
    data.input.setLookupFields( lookupFields );

    if ( inputFileName != null ) {
      data.input.setInputFile( inputFileName );
      data.input.setInputStreamFieldName( null );
    } else if ( meta.getDataLocationType() == AvroInputMetaBase.LocationDescriptor.FIELD_NAME ) {
      data.input.setInputStreamFieldName( meta.getDataLocation() );
      data.input.setUseFieldAsInputStream( true );
      int fieldIndex = getInputRowMeta().indexOfValue( data.input.getInputStreamFieldName() );
      if ( fieldIndex == -1 ) {
        throw new KettleException(
          "Field '" + data.input.getInputStreamFieldName() + "' was not found in step's input fields" );
      }
      data.input
        .setInputStream( new ByteArrayInputStream( getInputRowMeta().getBinary( inputToStepRow, fieldIndex ) ) );
    } else {
      throw new KettleException( "Unknown field location type" );
    }

    data.input.setIncomingFields( inputToStepRow );
    data.reader = data.input.createRecordReader( null );
    data.rowIterator = data.reader.iterator();

    return true;
  }


  public void checkForLegacyFieldNames( String schemaFileName, String avroFileName ) {
    // This routine will detect any field names in the schema that use the "_delimiter_" hack introduced in 8.0, find

View on GitHub (pinned to f3058517a1)