{"record":{"id":"6d219205d2d0a61f","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-field-field-in-the-input-rows-keystream","errorCode":null,"errorMessage":"Unable to find field [<field>] in the input rows (keyStream)","messagePattern":"Unable to find field \\[<field>\\] in the input rows \\(keyStream\\)","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMergeMeta.java","lineNumber":913,"sourceCode":"    Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    SQLStatement retval = new SQLStatement( stepMeta.getName(), databaseMeta, null ); // default: nothing to do!\n\n    if ( databaseMeta != null ) {\n      if ( prev != null && prev.size() > 0 ) {\n        // Copy the row\n        RowMetaInterface tableFields = new RowMeta();\n\n        // Now change the field names\n        // the key fields\n        if ( keyLookup != null ) {\n          for ( int i = 0; i < keyLookup.length; i++ ) {\n            ValueMetaInterface v = prev.searchValueMeta( keyStream[i] );\n            if ( v != null ) {\n              ValueMetaInterface tableField = v.clone();\n              tableField.setName( keyLookup[i] );\n              tableFields.addValueMeta( tableField );\n            } else {\n              throw new KettleStepException( \"Unable to find field [\" + keyStream[i] + \"] in the input rows\" );\n            }\n          }\n        }\n        // the lookup fields\n        for ( int i = 0; i < updateLookup.length; i++ ) {\n          ValueMetaInterface v = prev.searchValueMeta( updateStream[i] );\n          if ( v != null ) {\n            ValueMetaInterface vk = tableFields.searchValueMeta( updateStream[i] );\n            if ( vk == null ) { // do not add again when already added as key fields\n              ValueMetaInterface tableField = v.clone();\n              tableField.setName( updateLookup[i] );\n              tableFields.addValueMeta( tableField );\n            }\n          } else {\n            throw new KettleStepException( \"Unable to find field [\" + updateStream[i] + \"] in the input rows\" );\n          }\n        }\n","sourceCodeStart":895,"sourceCodeEnd":931,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMergeMeta.java#L895-L931","documentation":"During metadata validation (getFields/table-fields resolution in SynchronizeAfterMergeMeta), the step looks up each keyStream[i] field in the previous step's row layout (prev.searchValueMeta). If absent, it throws KettleStepException 'Unable to find field [x] in the input rows'. This is a design-time check mirroring error 2280 but raised while building table field metadata.","triggerScenarios":"The step's key field grid references a field that the previous step does not output; typically discovered when opening/validating the step dialog or during transformation compilation (getFields).","commonSituations":"Deleting or renaming an upstream column after configuration; running the step in a different transformation where the upstream schema differs; typos from manually maintained mappings.","solutions":["Correct the key stream field names in the step dialog to match the actual upstream fields","Add a Select values rename step upstream to produce the expected field names","Use 'Get Fields' in the dialog instead of typing names to eliminate typos","Preview the previous step to confirm the exact field names at runtime"],"exampleFix":"// before\nkeyStream[0] = \"order_id\"  (stream has \"orderId\") -> throw\n// after\nkeyStream[0] = \"orderId\"\n// or upstream rename orderId -> order_id","handlingStrategy":"validation","validationCode":"var m = stepMeta.getStepMetaInterface();\nvar prev = transMeta.getPrevStepFields(stepMeta);\nm.getKeyStream().forEach(function(k) { if (k != null && prev.searchValueMeta(k) == null) throw new Error(\"Missing key field: \" + k); });","typeGuard":"function fieldExists(rowMeta, name) { return name != null && rowMeta != null && rowMeta.searchValueMeta(name) != null; }","tryCatchPattern":"try { stepMeta.getStepMetaInterface().getFields(prev, \"keyFields\", rowMetaInterfaces, stepMeta, metaStore, transMeta); }\ncatch (KettleStepException e) { log.error(\"Key field mapping invalid: \" + e.getMessage()); /* correct mapping then retry */ }","preventionTips":["Pick fields via the dialog dropdown ('Get Fields')","Validate transformations (Ctrl+V style check) before scheduling","Track upstream schema changes with code review","Keep consistent field naming across environments"],"tags":["kettle","field-not-found","validation","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"}