{"record":{"id":"2030503ef1414b38","repo":"pentaho/pentaho-kettle","slug":"field-0-is-required-and-couldn-t-be-found","errorCode":null,"errorMessage":"Field [{0}] is required and couldn't be found!","messagePattern":"Field \\[(.+?)\\] is required and couldn't be found!","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/update/Update.java","lineNumber":236,"sourceCode":"        meta.getDatabaseMeta().getQuotedSchemaTableCombination(\n          environmentSubstitute( meta.getSchemaName() ), environmentSubstitute( meta.getTableName() ) );\n\n      // lookup the values!\n      if ( log.isDetailed() ) {\n        logDetailed( BaseMessages.getString( PKG, \"Update.Log.CheckingRow\" ) + getInputRowMeta().getString( r ) );\n      }\n\n      ArrayList<Integer> keynrs = new ArrayList<Integer>( meta.getKeyStream().length );\n      ArrayList<Integer> keynrs2 = new ArrayList<Integer>( meta.getKeyStream().length );\n\n      for ( int i = 0; i < meta.getKeyStream().length; i++ ) {\n        int keynr = getInputRowMeta().indexOfValue( meta.getKeyStream()[i] );\n\n        if ( keynr < 0 && // couldn't find field!\n          !\"IS NULL\".equalsIgnoreCase( meta.getKeyCondition()[i] ) && // No field needed!\n          !\"IS NOT NULL\".equalsIgnoreCase( meta.getKeyCondition()[i] ) // No field needed!\n        ) {\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Update.Exception.FieldRequired\", meta\n            .getKeyStream()[i] ) );\n        }\n        keynrs.add( keynr );\n\n        // this operator needs two bindings\n        if ( \"= ~NULL\".equalsIgnoreCase( meta.getKeyCondition()[i] ) ) {\n          keynrs.add( keynr );\n          keynrs2.add( -1 );\n        }\n\n        int keynr2 = getInputRowMeta().indexOfValue( meta.getKeyStream2()[i] );\n        if ( keynr2 < 0 && // couldn't find field!\n          \"BETWEEN\".equalsIgnoreCase( meta.getKeyCondition()[i] ) // 2 fields needed!\n        ) {\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Update.Exception.FieldRequired\", meta\n            .getKeyStream2()[i] ) );\n        }\n        keynrs2.add( keynr2 );","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/update/Update.java#L218-L254","documentation":"The Update step could not find one of the configured key stream fields in the incoming row metadata during processRow initialization. Since the key is required to build the WHERE clause, it throws KettleStepException naming the missing field via the FieldRequired message.","triggerScenarios":"getInputRowMeta().indexOfValue(meta.getKeyStream()[i]) returns -1 for a key condition other than 'IS NULL'/'IS NOT NULL' (which don't need the field value).","commonSituations":"Renaming or removing an upstream field used as a lookup key; connecting the wrong stream into the Update step; copy/pasted transformations where the key field is produced by a disabled predecessor step.","solutions":["Open the Update step dialog and correct the key field name to one present in the incoming stream","Check the upstream step actually emits the field (run with row metadata logging or 'Preview')","Set the key condition to 'IS NULL'/'IS NOT NULL' only when the field value is genuinely not needed"],"exampleFix":"// before\nkey_stream: customer_id_old\n// after\nkey_stream: customer_id","handlingStrategy":"validation","validationCode":"// In a UDJC or via step preview before Update:\nif (getInputRowMeta().indexOfValue(\"customer_id\") < 0) throw new KettleStepException(\"Key field customer_id missing from incoming stream\");","typeGuard":null,"tryCatchPattern":"try { transformation.start(); } catch (KettleStepException e) { if (e.getMessage().contains(\"is required and couldn't be found\")) { /* fix step mapping and retry */ } }","preventionTips":["Preview the incoming stream before the Update step to confirm field names","Avoid hard-coding field names across transformations; re-select them after upstream edits","Keep key field producers enabled and connected"],"tags":["field-not-found","row-metadata","transformation"],"backgroundTag":"missing-required-argument","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"}