{"record":{"id":"81b004258a6a42d6","repo":"pentaho/pentaho-kettle","slug":"mailvalidator-exception-couldnotfindfield","errorCode":null,"errorMessage":"MailValidator.Exception.CouldnotFindField","messagePattern":"MailValidator\\.Exception\\.CouldnotFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail-validator/impl/src/main/java/org/pentaho/di/trans/steps/mailvalidator/MailValidator.java","lineNumber":101,"sourceCode":"        }\n\n        data.msgValidMail = environmentSubstitute( meta.getEMailValideMsg() );\n        data.msgNotValidMail = environmentSubstitute( meta.getEMailNotValideMsg() );\n      }\n\n      // Check is email address field is provided\n      if ( Utils.isEmpty( meta.getEmailField() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"MailValidator.Error.FilenameFieldMissing\" ) );\n      }\n\n      data.realResultErrorsFieldName = environmentSubstitute( meta.getErrorsField() );\n\n      // cache the position of the field\n      if ( data.indexOfeMailField < 0 ) {\n        data.indexOfeMailField = data.previousRowMeta.indexOfValue( meta.getEmailField() );\n        if ( data.indexOfeMailField < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"MailValidator.Exception.CouldnotFindField\", meta.getEmailField() ) );\n        }\n      }\n\n      // SMTP check?\n      if ( meta.isSMTPCheck() ) {\n        if ( meta.isdynamicDefaultSMTP() ) {\n          if ( Utils.isEmpty( meta.getDefaultSMTP() ) ) {\n            throw new KettleException( BaseMessages.getString( PKG, \"MailValidator.Error.DefaultSMTPFieldMissing\" ) );\n          }\n\n          if ( data.indexOfdefaultSMTPField < 0 ) {\n            data.indexOfdefaultSMTPField = data.previousRowMeta.indexOfValue( meta.getDefaultSMTP() );\n            if ( data.indexOfdefaultSMTPField < 0 ) {\n              // The field is unreachable !\n              throw new KettleException( BaseMessages.getString(\n                PKG, \"MailValidator.Exception.CouldnotFindField\", meta.getDefaultSMTP() ) );\n            }","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail-validator/impl/src/main/java/org/pentaho/di/trans/steps/mailvalidator/MailValidator.java#L83-L119","documentation":"MailValidator.processRow() throws this KettleException when the configured email field cannot be found in the incoming row metadata (indexOfValue returns -1). The configured field name exists as a setting but the actual stream does not contain a field with that exact name.","triggerScenarios":"Running the transformation when meta.getEmailField() does not match any field in the previous step's output row metadata.","commonSituations":"Upstream step renamed the field (e.g. 'Email' vs 'email' — matching is case-sensitive); the field-producing step was removed or reordered; a Select Values step dropped the field.","solutions":["Verify the exact field name in the upstream step's output preview and correct the Mail Validator's email field setting.","Fix case sensitivity mismatches between the configured name and the stream field.","Reconnect/rebuild the hop after upstream changes so row metadata refreshes.","Use a Select Values or Get fields (ctrl-space in dialog) to pick the field name rather than typing it."],"exampleFix":"// before\nmeta.setEmailField( \"Email_Address\" ); // stream field is actually \"email\"\n// after\nmeta.setEmailField( \"email\" );","handlingStrategy":"validation","validationCode":"// Guard: field must exist in incoming stream metadata\nint idx = previousRowMeta.indexOfValue( meta.getEmailField() );\nif ( idx < 0 ) {\n  throw new IllegalArgumentException(\n    \"Mail Validator email field '\" + meta.getEmailField() + \"' not found in incoming rows\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"CouldnotFindField\" ) ) {\n    logError( \"Email field missing from stream; check upstream field names/case\" );\n  }\n  throw e;\n}","preventionTips":["Match field names exactly, including case.","Use the dialog's field picker fed by upstream metadata.","Re-derive step settings after editing upstream steps.","Add a Select Values step to normalize field names early."],"tags":["configuration","field-mapping","transformation","email-validation"],"backgroundTag":"entity-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"}