{"record":{"id":"1e7850173f49d68f","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-field-0","errorCode":null,"errorMessage":"Unable to find field : {0}","messagePattern":"Unable to find field : (.+?)","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/simplemapping/SimpleMappingMeta.java","lineNumber":315,"sourceCode":"    List<MappingValueRename> inputRenameList = new ArrayList<MappingValueRename>();\n\n    //\n    // Before we ask the mapping outputs anything, we should teach the mapping\n    // input steps in the sub-transformation about the data coming in...\n    //\n\n    RowMetaInterface inputRowMeta;\n\n    // The row metadata, what we pass to the mapping input step\n    // definition.getOutputStep(), is \"row\"\n    // However, we do need to re-map some fields...\n    //\n    inputRowMeta = row.clone();\n    if ( !inputRowMeta.isEmpty() ) {\n      for ( MappingValueRename valueRename : inputMapping.getValueRenames() ) {\n        ValueMetaInterface valueMeta = inputRowMeta.searchValueMeta( valueRename.getSourceValueName() );\n        if ( valueMeta == null ) {\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"SimpleMappingMeta.Exception.UnableToFindField\", valueRename.getSourceValueName() ) );\n        }\n        valueMeta.setName( valueRename.getTargetValueName() );\n      }\n    }\n\n    // What is this mapping input step?\n    //\n    StepMeta mappingInputStep = mappingTransMeta.findMappingInputStep( null );\n\n    // We're certain it's a MappingInput step...\n    //\n    MappingInputMeta mappingInputMeta = (MappingInputMeta) mappingInputStep.getStepMetaInterface();\n\n    // Inform the mapping input step about what it's going to receive...\n    //\n    mappingInputMeta.setInputRowMeta( inputRowMeta );\n","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/simplemapping/SimpleMappingMeta.java#L297-L333","documentation":"When computing the Simple Mapping step's input field layout, getFields applies each input MappingIODefinition's value renames: it looks up the source field in the cloned input row metadata and renames it to the target name. If a configured source field does not exist in the incoming row, searchValueMeta returns null and a KettleStepException 'Unable to find field: {0}' is thrown.","triggerScenarios":"getFields() iterates inputMapping.getValueRenames() and valueRename.getSourceValueName() is not present in the parent transformation's incoming row metadata (row is non-empty but lacks that field).","commonSituations":"Upstream step was changed and a field renamed/deleted so the mapping's configured rename no longer matches; mapping configured against a different data shape (e.g. wrong table or file version); case-sensitive field name mismatch; stale saved metadata after upstream column changes.","solutions":["Open the Simple Mapping step's Input mapping tab and update/remove the rename entry whose source field no longer exists.","Check the upstream step output (right-click hop > Show fields) and align the mapping's source field names exactly, including case.","Refresh/regenerate the step metadata after upstream changes, then re-save the transformation.","If the field is genuinely optional, remove the rename and handle it downstream instead."],"exampleFix":"// before: mapping rename references a removed field\nrename: source \"cust_id\" -> target \"customerId\"  (upstream now emits \"customer_id\")\n// after\nrename: source \"customer_id\" -> target \"customerId\"","handlingStrategy":"validation","validationCode":"// Check every configured rename source exists in the incoming row before execution\nRowMetaInterface inputRow = transMeta.getPrevStepFields(stepMeta);\nfor (MappingIODefinition def : simpleMappingMeta.getInputMapping()) {\n  for (MappingValueRename r : def.getValueRenames()) {\n    if (inputRow.searchValueMeta(r.getSourceValueName()) == null) {\n      throw new IllegalStateException(\"Mapping rename source field not in input row: \" + r.getSourceValueName());\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  meta.getFields(row, origin, info, target, repository, metaStore, space);\n} catch (KettleStepException e) {\n  logError(\"Field rename refers to a missing input field: \" + e.getMessage());\n}","preventionTips":["Re-open and re-save the mapping when upstream field layouts change","Check hop field listings (right-click > Show fields) before configuring renames","Watch field-name case: lookups are case-sensitive"],"tags":["kettle","pdi","mapping-step","field-mapping","schema"],"backgroundTag":"record-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"}