{"record":{"id":"cc5e6754bc077e6e","repo":"pentaho/pentaho-kettle","slug":"source-field","errorCode":null,"errorMessage":"Source field [","messagePattern":"Source field \\[","errorType":"validation","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/validator/Validator.java","lineNumber":217,"sourceCode":"        // The data is stored in data.listValues[i] and data.constantsMeta\n        //\n        String stepName = streams.get( i ).getStepname();\n        if ( inputStepWasProcessed.containsKey( stepName ) ) {\n          // step was processed for other StreamInterface\n          data.listValues[ i ] = data.listValues[ inputStepWasProcessed.get( stepName ) ];\n          data.constantsMeta[ i ] = data.constantsMeta[ inputStepWasProcessed.get( stepName ) ];\n          continue;\n        }\n        RowSet allowedRowSet = findInputRowSet( stepName );\n        int fieldIndex = -1;\n        List<Object> allowedValues = new ArrayList<Object>();\n        Object[] allowedRowData = getRowFrom( allowedRowSet );\n        while ( allowedRowData != null ) {\n          RowMetaInterface allowedRowMeta = allowedRowSet.getRowMeta();\n          if ( fieldIndex < 0 ) {\n            fieldIndex = allowedRowMeta.indexOfValue( field.getSourcingField() );\n            if ( fieldIndex < 0 ) {\n              throw new KettleStepException( \"Source field [\"\n                + field.getSourcingField() + \"] is not found in the source row data\" );\n            }\n            data.constantsMeta[ i ] = allowedRowMeta.getValueMeta( fieldIndex );\n          }\n          Object allowedValue = allowedRowData[ fieldIndex ];\n          if ( allowedValue != null ) {\n            allowedValues.add( allowedValue );\n          }\n\n          // Grab another row too...\n          //\n          allowedRowData = getRowFrom( allowedRowSet );\n        }\n        // Set the list values in the data block...\n        //\n        data.listValues[ i ] = allowedValues.toArray( new Object[ allowedValues.size() ] );\n        inputStepWasProcessed.put( stepName, i );\n      }","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/validator/Validator.java#L199-L235","documentation":"Thrown while the Validator reads allowed values from the source info step's rows: the configured sourcing field is not present in the actual row metadata coming from that step (indexOfValue returns -1). The message names the missing source field and says it was not found in the source row data.","triggerScenarios":"readSourceValuesFromInfoSteps reading rows via getRowFrom(allowedRowSet); fieldIndex stays < 0 and allowedRowMeta.indexOfValue(field.getSourcingField()) returns -1 — source step's row layout doesn't contain the expected column.","commonSituations":"Source step renamed/removed the field; case mismatch between configured and actual field; source step outputs different layout than when configured; wrong source step selected.","solutions":["Check the source step's output fields and correct the sourcing field name (case-sensitive).","Preview the source step (right-click > Preview) to confirm the column exists.","Re-select the correct source step if the hop points to the wrong step.","Add the needed column upstream (e.g. via Select Values) if the source legitimately lacks it."],"exampleFix":"// before\nfield.setSourcingField(\"Status_Codes\");\n// after (match actual output of source step)\nfield.setSourcingField(\"status_code\");","handlingStrategy":"validation","validationCode":"// Before execution: verify sourcing field exists in source step output\nRowMetaInterface srcFields = sourceStepMeta.getStepMetaInterface().getFields(...);\nif (srcFields.indexOfValue(field.getSourcingField()) < 0)\n  throw new IllegalStateException(\"Sourcing field not in source output: \" + field.getSourcingField());","typeGuard":null,"tryCatchPattern":"try {\n  trans.startThreads();\n} catch (KettleStepException e) {\n  if (e.getMessage().startsWith(\"Source field [\")) {\n    String f = e.getMessage().replaceAll(\"Source field \\\\[(.+?)\\\\].*\", \"$1\");\n    logError(\"Sourcing field not found: \" + f);\n  }\n}","preventionTips":["Preview source step output before configuring","Use exact case when typing the sourcing field name","Re-verify after any change to the source step's layout"],"tags":["kettle","validator","row-metadata","info-step"],"backgroundTag":"resource-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"}