{"record":{"id":"27eb37c12bcaabf1","repo":"pentaho/pentaho-kettle","slug":"mail-exception-couldnotfinddestinationbccfield","errorCode":null,"errorMessage":"Mail.Exception.CouldnotFindDestinationBCcField","messagePattern":"Mail\\.Exception\\.CouldnotFindDestinationBCcField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java","lineNumber":274,"sourceCode":"    if ( !Utils.isEmpty( meta.getDestinationCc() ) ) {\n      // cache the position of the Cc field\n      if ( data.indexOfDestinationCc < 0 ) {\n        String realDestinationCcFieldname = meta.getDestinationCc();\n        data.indexOfDestinationCc = data.previousRowMeta.indexOfValue( realDestinationCcFieldname );\n        if ( data.indexOfDestinationCc < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindDestinationCcField\", realDestinationCcFieldname ) );\n        }\n      }\n    }\n    // BCc\n    if ( !Utils.isEmpty( meta.getDestinationBCc() ) ) {\n      // cache the position of the BCc field\n      if ( data.indexOfDestinationBCc < 0 ) {\n        String realDestinationBCcFieldname = meta.getDestinationBCc();\n        data.indexOfDestinationBCc = data.previousRowMeta.indexOfValue( realDestinationBCcFieldname );\n        if ( data.indexOfDestinationBCc < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindDestinationBCcField\", realDestinationBCcFieldname ) );\n        }\n      }\n    }\n    // Sender Name\n    if ( !Utils.isEmpty( meta.getReplyName() ) ) {\n      // cache the position of the sender field\n      if ( data.indexOfSenderName < 0 ) {\n        String realSenderName = meta.getReplyName();\n        data.indexOfSenderName = data.previousRowMeta.indexOfValue( realSenderName );\n        if ( data.indexOfSenderName < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindReplyNameField\", realSenderName ) );\n        }\n      }\n    }\n    // Sender address\n    // cache the position of the sender field","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java#L256-L292","documentation":"Thrown by cacheFieldsPosition when the Bcc destination field configured in the Mail meta cannot be found in the incoming row's RowMeta. Checked only when a Bcc field name is configured; the lookup returns -1 so the step aborts with a KettleException before sending.","triggerScenarios":"meta.getDestinationBCc() is non-empty and previousRowMeta.indexOfValue returns -1, leaving data.indexOfDestinationBCc == -1.","commonSituations":"Bcc column removed or renamed by an upstream step; wrong field typed in the Mail step dialog; running with a different input layout than when configured.","solutions":["Fix the 'Destination BCc fieldname' in the Mail step to an existing column","Guarantee the column upstream with Select Values / Add constants","Clear the Bcc setting if hidden-copy recipients are not used"],"exampleFix":"// before\nmeta.setDestinationBCc(\"bcc\");\n// after\nmeta.setDestinationBCc(\"bcc_address\"); // matches stream field","handlingStrategy":"validation","validationCode":"// ensure the Bcc field exists when configured\nif (!isEmpty(meta.getDestinationBCc()) && rowMeta.indexOfValue(meta.getDestinationBCc()) < 0) {\n  logError(\"Bcc field not in stream: \" + meta.getDestinationBCc());\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"CouldnotFindDestinationBCcField\")) {\n    logError(\"Bcc field missing: \" + e.getMessage());\n  }\n}","preventionTips":["Configure Bcc only when the column is guaranteed upstream","Preview rows at the Mail step to confirm the field list","Keep step metadata in sync after upstream renames"],"tags":["kettle","mail","field-lookup","configuration"],"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"}