{"record":{"id":"321bc07ac3244e98","repo":"pentaho/pentaho-kettle","slug":"field-was-not-found-in-step-s-input-fields","errorCode":null,"errorMessage":"Field '' was not found in step's input fields","messagePattern":"Field '' was not found in step's input fields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInput.java","lineNumber":250,"sourceCode":"    if ( getInputRowMeta() != null ) {\n      for ( AvroLookupField lookupField : meta.getLookupFields() ) {\n        IndexedLookupField indexedLookupField = resolveLookupField( lookupField );\n        if ( indexedLookupField != null ) {\n          lookupFields.add( indexedLookupField );\n        }\n      }\n    }\n    data.input.setLookupFields( lookupFields );\n\n    if ( inputFileName != null ) {\n      data.input.setInputFile( inputFileName );\n      data.input.setInputStreamFieldName( null );\n    } else if ( meta.getDataLocationType() == AvroInputMetaBase.LocationDescriptor.FIELD_NAME ) {\n      data.input.setInputStreamFieldName( meta.getDataLocation() );\n      data.input.setUseFieldAsInputStream( true );\n      int fieldIndex = getInputRowMeta().indexOfValue( data.input.getInputStreamFieldName() );\n      if ( fieldIndex == -1 ) {\n        throw new KettleException(\n          \"Field '\" + data.input.getInputStreamFieldName() + \"' was not found in step's input fields\" );\n      }\n      data.input\n        .setInputStream( new ByteArrayInputStream( getInputRowMeta().getBinary( inputToStepRow, fieldIndex ) ) );\n    } else {\n      throw new KettleException( \"Unknown field location type\" );\n    }\n\n    data.input.setIncomingFields( inputToStepRow );\n    data.reader = data.input.createRecordReader( null );\n    data.rowIterator = data.reader.iterator();\n\n    return true;\n  }\n\n\n  public void checkForLegacyFieldNames( String schemaFileName, String avroFileName ) {\n    // This routine will detect any field names in the schema that use the \"_delimiter_\" hack introduced in 8.0, find","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInput.java#L232-L268","documentation":"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.","triggerScenarios":"meta.getDataLocation() names a field that is not present in the rows arriving at the Avro Input step at runtime.","commonSituations":"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.","solutions":["Correct the field name in the Avro Input 'data location' setting to match an actual input field","Add/restore the upstream step that produces the field","Use Get Fields / preview upstream to confirm the exact field name"],"exampleFix":"// before\nmeta.setDataLocation(\"avro_payload \"); // trailing space, not in input\n// after\nmeta.setDataLocation(\"avro_payload\"); // matches upstream field exactly","handlingStrategy":"validation","validationCode":"String fieldName = meta.getDataLocation();\nif (fieldName != null && getInputRowMeta() != null\n    && getInputRowMeta().indexOfValue(fieldName) == -1) {\n  throw new KettleException(\"Configured Avro source field '\" + fieldName\n      + \"' missing from input fields: \" + getInputRowMeta().getFieldNames());\n}","typeGuard":null,"tryCatchPattern":"try {\n  initializeSource(row);\n} catch (KettleException e) {\n  logError(\"Check the Avro Input field-name location: \" + e.getMessage());\n  setErrors(1);\n}","preventionTips":["Verify the source field exists via a preview of the previous step","Avoid renaming upstream fields without updating the Avro Input location setting","Trim whitespace and match case exactly when typing field names"],"tags":["pdi","avro","field-lookup"],"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"}