{"record":{"id":"7f3c8f6ae4641a61","repo":"pentaho/pentaho-kettle","slug":"mappingmeta-exception-unabletofindfield","errorCode":"MappingMeta.Exception.UnableToFindField","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/mapping/MappingMeta.java","lineNumber":457,"sourceCode":"    /*\n     * Before we ask the mapping outputs anything, we should teach the mapping input steps in the sub-transformation\n     * about the data coming in...\n     */\n    for ( MappingIODefinition definition : inputMappings ) {\n\n      RowMetaInterface inputRowMeta;\n\n      if ( definition.isMainDataPath() || Utils.isEmpty( definition.getInputStepname() ) ) {\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 : definition.getValueRenames() ) {\n            ValueMetaInterface valueMeta = inputRowMeta.searchValueMeta( valueRename.getSourceValueName() );\n            if ( valueMeta == null ) {\n              throw new KettleStepException( BaseMessages.getString(\n                PKG, \"MappingMeta.Exception.UnableToFindField\", valueRename.getSourceValueName() ) );\n            }\n            valueMeta.setName( valueRename.getTargetValueName() );\n          }\n        }\n      } else {\n        // The row metadata that goes to the info mapping input comes from the\n        // specified step\n        // In fact, it's one of the info steps that is going to contain this\n        // information...\n        //\n        String[] infoSteps = getInfoSteps();\n        int infoStepIndex = Const.indexOfString( definition.getInputStepname(), infoSteps );\n        if ( infoStepIndex < 0 ) {\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"MappingMeta.Exception.UnableToFindMetadataInfo\", definition.getInputStepname() ) );\n        }\n        if ( info[infoStepIndex] != null ) {","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mapping/MappingMeta.java#L439-L475","documentation":"Thrown in MappingMeta.getFields while applying value renames from a mapping definition: searchValueMeta cannot find the source field named in a MappingValueRename within the input row. The rename is a hard requirement — the field must exist or the step fails.","triggerScenarios":"getFields -> definition.getValueRenames() loop, where valueRename.getSourceValueName() is absent from inputRowMeta (searchValueMeta returns null).","commonSituations":"Upstream step renamed or dropped a field the mapping definition expects; field removed by a Select Values step; mapping definition stale after the sub-transformation's output changed.","solutions":["Update the mapping definition's value renames to match the actual incoming field names","Check upstream steps (Select Values, renames) that may drop or rename the field","Re-run the Mapping step dialog field mapping after changing the sub-transformation"],"exampleFix":"// before\nrenames.add(new MappingValueRename(\"old_price\", \"price\")); // upstream now emits 'unit_price'\n// after\nrenames.add(new MappingValueRename(\"unit_price\", \"price\"));","handlingStrategy":"validation","validationCode":"// before applying renames\nfor (MappingValueRename rename : definition.getValueRenames()) {\n  if (inputRowMeta.searchValueMeta(rename.getSourceValueName()) == null) {\n    logError(\"Field missing before rename: \" + rename.getSourceValueName());\n  }\n}","typeGuard":"boolean allRenameSourcesExist(RowMetaInterface row, List<MappingValueRename> renames) { return renames.stream().allMatch(r -> row.searchValueMeta(r.getSourceValueName()) != null); }","tryCatchPattern":"try {\n  meta.getFields(...);\n} catch (KettleStepException e) {\n  logError(\"Rename source field not found: \" + e.getMessage());\n  // update the mapping definition's field list\n}","preventionTips":["Re-run the field mapping in the Mapping dialog after upstream schema changes","Avoid renaming/removing fields upstream of a Mapping step without updating its definition","Log the input row fields during development to catch schema drift early"],"tags":["kettle","mapping","field-not-found","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"}