{"record":{"id":"68431824c9707b86","repo":"pentaho/pentaho-kettle","slug":"concatfields-error-fieldnotfoundinputstream","errorCode":"ConcatFields.Error.FieldNotFoundInputStream","errorMessage":"ConcatFields.Error.FieldNotFoundInputStream","messagePattern":"ConcatFields\\.Error\\.FieldNotFoundInputStream","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java","lineNumber":87,"sourceCode":"\n      // the field precisions and lengths are altered! see TextFileOutputMeta.getFields().\n      // otherwise trim(), padding etc. will not work\n      data.inputRowMetaModified = getInputRowMeta().clone();\n      meta\n        .getFieldsModifyInput( getTransMeta().getBowl(), data.inputRowMetaModified, getStepname(), null, null,\n           this, repository, metaStore );\n\n      data.posTargetField = data.outputRowMeta.indexOfValue( meta.getTargetFieldName() );\n      if ( data.posTargetField < 0 ) {\n        throw new KettleStepException( BaseMessages.getString(\n          PKG, \"ConcatFields.Error.TargetFieldNotFoundOutputStream\", \"\" + meta.getTargetFieldName() ) );\n      }\n\n      data.fieldnrs = new int[ meta.getOutputFields().length ];\n      for ( int i = 0; i < meta.getOutputFields().length; i++ ) {\n        data.fieldnrs[ i ] = data.inputRowMetaModified.indexOfValue( meta.getOutputFields()[ i ].getName() );\n        if ( data.fieldnrs[ i ] < 0 ) {\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"ConcatFields.Error.FieldNotFoundInputStream\", \"\" + meta.getOutputFields()[ i ].getName() ) );\n        }\n      }\n\n      meta.calcMetaWithFieldOptions( data );\n\n      // prepare for fast data dump (StringBuilder size)\n      data.targetFieldLengthFastDataDump = meta.getTargetFieldLength();\n      if ( data.targetFieldLengthFastDataDump <= 0 ) { // try it as a guess: 50 * size\n        if ( meta.getOutputFields().length == 0 ) {\n          data.targetFieldLengthFastDataDump = 50 * getInputRowMeta().size();\n        } else {\n          data.targetFieldLengthFastDataDump = 50 * meta.getOutputFields().length;\n        }\n      }\n      prepareForReMap();\n\n      checkAndWriteHeader();","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java#L69-L105","documentation":"ConcatFields validates each configured output (source) field exists in the modified input row metadata. If any field listed in the step's output fields is not found in the incoming stream (indexOfValue returns -1), this KettleStepException names the missing field.","triggerScenarios":"meta.getOutputFields()[i].getName() does not exist in data.inputRowMetaModified — a configured concat source field was renamed, removed upstream, or never existed.","commonSituations":"Upstream step changes break the field list; users type field names manually instead of picking from the dropdown; tests build input row metadata without all the fields the meta declares.","solutions":["Add the missing field to the input stream (fix the upstream step producing it).","Update the step's output field list to match fields actually present in the stream.","Re-select fields from the dropdown in the step dialog to refresh names.","In tests, ensure the input RowMeta contains every field listed in meta.getOutputFields()."],"exampleFix":"// before\nrowMeta.addValueMeta( new ValueMetaString( \"wrongName\" ) );\n// after\nrowMeta.addValueMeta( new ValueMetaString( \"expectedField\" ) );","handlingStrategy":"validation","validationCode":"for ( String f : Arrays.stream( meta.getOutputFields() ).map( ConcatField::getName ).collect( toList() ) ) {\n  if ( inputRowMeta.indexOfValue( f ) < 0 ) throw new IllegalArgumentException( \"Missing input field: \" + f );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleStepException e ) {\n  if ( e.getMessage().contains( \"FieldNotFoundInputStream\" ) ) {\n    logError( \"Add or rename the field in the upstream step: \" + e.getMessage() );\n  }\n}","preventionTips":["Pick fields from the dropdown rather than typing names.","Re-check field mappings after changing upstream steps.","Keep input row metadata in tests in sync with meta.getOutputFields()."],"tags":["kettle","pdi","field-lookup","stream-metadata"],"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"}