{"record":{"id":"57474a45346caf52","repo":"pentaho/pentaho-kettle","slug":"fuzzymatchmeta-exception-returnvaluecannotbefound","errorCode":null,"errorMessage":"FuzzyMatchMeta.Exception.ReturnValueCanNotBeFound","messagePattern":"FuzzyMatchMeta\\.Exception\\.ReturnValueCanNotBeFound","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fuzzymatch/FuzzyMatchMeta.java","lineNumber":495,"sourceCode":"      isGetCloserValue()\n        || ( getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_DOUBLE_METAPHONE )\n        || ( getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_SOUNDEX )\n        || ( getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_REFINED_SOUNDEX )\n        || ( getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_METAPHONE );\n\n    if ( activateAdditionalFields ) {\n      if ( info != null && info.length == 1 && info[0] != null ) {\n        for ( int i = 0; i < valueName.length; i++ ) {\n          v = info[0].searchValueMeta( value[i] );\n          if ( v != null ) {\n            // Configuration error/missing resources...\n\n            v.setName( valueName[i] );\n            v.setOrigin( name );\n            v.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL ); // Only normal storage goes into the cache\n            inputRowMeta.addValueMeta( v );\n          } else {\n            throw new KettleStepException( BaseMessages.getString(\n              PKG, \"FuzzyMatchMeta.Exception.ReturnValueCanNotBeFound\", value[i] ) );\n          }\n        }\n      } else {\n        for ( int i = 0; i < valueName.length; i++ ) {\n          v = new ValueMetaString( valueName[i] );\n          v.setOrigin( name );\n          inputRowMeta.addValueMeta( v );\n        }\n      }\n    }\n  }\n\n  public String getXML() {\n    StringBuilder retval = new StringBuilder();\n\n    StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"from\", infoStream.getStepname() ) );","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fuzzymatch/FuzzyMatchMeta.java#L477-L513","documentation":"In getFields(), after the transformation is configured the step maps each configured return value name (value[i]) to a field produced by the lookup stream; if the requested return field cannot be found in the lookup row meta, it throws KettleStepException 'FuzzyMatchMeta.Exception.ReturnValueCanNotBeFound' with the missing field name.","triggerScenarios":"getFields(inputRowMeta, ...) is called with a 'value' entry that has no matching ValueMetaInterface in the lookup input row meta (the inner branch), typically because the lookup stream no longer contains that field.","commonSituations":"Renaming or deleting a column in the lookup transform after configuring FuzzyMatch return values; passing a lookup stream whose field names changed case; copy-pasting steps between transformations with different schemas.","solutions":["Open the FuzzyMatch step dialog and re-select the return values so they match fields actually present in the lookup stream","Verify the upstream lookup transform still produces the missing field (name and case)","Refresh field metadata in Spoon (right-click step > 'Update fields' or re-run 'Get Fields')","Rename the return value in the step config to the new field name"],"exampleFix":"// before (step meta references a removed field)\nvalue[0] = \"customer_name_old\"\n// after\nvalue[0] = \"customer_name\"  // matches a field in the lookup stream","handlingStrategy":"validation","validationCode":"RowMetaInterface lookupFields = lookupTransform.getOutputRowMeta();\nfor (String returnField : stepMeta.getReturnValueNames()) {\n  if (lookupFields.searchValueMeta(returnField) == null) {\n    throw new IllegalStateException(\"FuzzyMatch return value not in lookup stream: \" + returnField);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  stepMeta.getStepMetaInterface().getFields(inputRowMeta, origin, info, targetStepMeta, metaStore, space);\n} catch (KettleStepException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"ReturnValueCanNotBeFound\")) {\n    // re-open the step dialog and re-select return values to match the lookup stream\n  } else throw e;\n}","preventionTips":["After changing upstream lookup transform fields, always re-open FuzzyMatch and refresh return values","Avoid renaming fields consumed by FuzzyMatch without updating the step","Use consistent field name casing across transforms","Run transformation metadata validation before production execution"],"tags":["schema","field-mismatch","metadata","pentaho-kettle"],"backgroundTag":"field-not-found-in-stream","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"}