{"record":{"id":"50996f6b728a0326","repo":"pentaho/pentaho-kettle","slug":"yamlinput-exception-couldnotfindfield","errorCode":null,"errorMessage":"YamlInput.Exception.CouldnotFindField","messagePattern":"YamlInput\\.Exception\\.CouldnotFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/yaml-input/impl/src/main/java/org/pentaho/di/trans/steps/yamlinput/YamlInput.java","lineNumber":112,"sourceCode":"        data.outputRowMeta = getInputRowMeta().clone();\n        // Get total previous fields\n        data.totalPreviousFields = data.outputRowMeta.size();\n        data.totalOutFields = data.totalPreviousFields + data.nrInputFields;\n        meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n          metaStore );\n\n        // Check is Yaml field is provided\n        if ( Utils.isEmpty( meta.getYamlField() ) ) {\n          logError( BaseMessages.getString( PKG, \"YamlInput.Log.NoField\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"YamlInput.Log.NoField\" ) );\n        }\n\n        // cache the position of the field\n        data.indexOfYamlField = getInputRowMeta().indexOfValue( meta.getYamlField() );\n        if ( data.indexOfYamlField < 0 ) {\n          // The field is unreachable !\n          logError( BaseMessages.getString( PKG, \"YamlInput.Log.ErrorFindingField\", meta.getYamlField() ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"YamlInput.Exception.CouldnotFindField\", meta\n            .getYamlField() ) );\n        }\n      }\n\n      // get field value\n      String Fieldvalue = getInputRowMeta().getString( data.readrow, data.indexOfYamlField );\n\n      getLinesInput();\n\n      if ( log.isDetailed() ) {\n        logDetailed( BaseMessages.getString( PKG, \"YamlInput.Log.YAMLStream\", meta.getYamlField(), Fieldvalue ) );\n      }\n\n      if ( meta.getIsAFile() ) {\n\n        // source is a file.\n\n        data.yaml = new YamlReader( getTransMeta().getBowl() );","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/yaml-input/impl/src/main/java/org/pentaho/di/trans/steps/yamlinput/YamlInput.java#L94-L130","documentation":"readNextString throws this KettleException when the configured YAML field name cannot be found in the incoming row's metadata: getInputRowMeta().indexOfValue(meta.getYamlField()) returns -1. The step logs which field it could not find and fails the transformation.","triggerScenarios":"readNextString on first row after the field name passes the emptiness check: indexOfValue returns < 0 because the upstream stream has no column matching meta.getYamlField() (exact, case-sensitive name match).","commonSituations":"Upstream step renamed or removed the column, case mismatch between configured name and actual field name, extra spaces in the configured field name, transformation run out of order so the expected field never appears.","solutions":["Compare the configured 'Yaml field name' with the actual incoming row fields (use a 'Fields' preview or Get Fields button) and correct the name.","Fix case/space mismatches — matching is exact.","Ensure the upstream step that produces the YAML column runs before and feeds this step.","If upstream metadata is dynamic, add a Select Values step to normalize the field name before YAML Input."],"exampleFix":"// before: meta.setYamlField(\"Yaml Content\"); // upstream emits 'yaml_content'\n// after: match exactly\nmeta.setYamlField(\"yaml_content\");","handlingStrategy":"validation","validationCode":"// verify the field exists in the incoming row before the step runs\nRowMetaInterface rmi = transMeta.getPrevStepFields(stepMeta);\nif (rmi.indexOfValue(yamlFieldName) < 0) {\n  throw new IllegalArgumentException(\"Field not in stream: \" + yamlFieldName);\n}","typeGuard":null,"tryCatchPattern":"try { getOneRow(); } catch (KettleException e) {\n  if (e.getMessage().contains(\"CouldnotFindField\")) { logActualStreamFields(getInputRowMeta()); }\n}","preventionTips":["Pin upstream field names with a Select Values step so renames upstream don't break this step.","Use 'Get Fields' in the dialog instead of typing names.","Re-run metadata impact checks after changing upstream steps."],"tags":["field-not-found","row-metadata","kettle"],"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"}