pentaho/pentaho-kettle · error · KettleException

Mail.Exception.CouldnotFindReplyToAddressesField

Error message

Mail.Exception.CouldnotFindReplyToAddressesField

What it means

Thrown by cacheFieldsPosition when the Reply-To addresses field configured in Mail meta cannot be found in the incoming row's RowMeta. Checked only when the reply-to field is configured; indexOfValue returning -1 throws the KettleException.

Solutions

  1. Correct the 'Reply To (from field)' setting to match an existing column
  2. Ensure the upstream step always emits the reply-to column
  3. Clear the reply-to field setting if not needed

Example fix

// before
meta.setReplyToAddresses("replyto");
// after
meta.setReplyToAddresses("reply_to_addresses");
Defensive patterns

Strategy: validation

Validate before calling

// ensure the reply-to field exists when configured
if (!isEmpty(meta.getReplyToAddresses()) && rowMeta.indexOfValue(meta.getReplyToAddresses()) < 0) {
  logError("Reply-To field not in stream: " + meta.getReplyToAddresses());
}

Try / catch

try {
  step.processRow();
} catch (KettleException e) {
  if (e.getMessage().contains("CouldnotFindReplyToAddressesField")) {
    logError("Reply-To field missing: " + e.getMessage());
  }
}

Prevention

When it happens

Trigger: meta.getReplyToAddresses() is non-empty and data.indexOfReplyToAddresses == -1 after indexOfValue on previousRowMeta.

Common situations: Reply-To column renamed upstream; optional reply-to column absent on some input paths; stale step configuration after transformation refactor.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/a2120daabbce1a05. Report an issue: GitHub.

Appendix: source

Thrown at plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java:309

    // Sender address
    // cache the position of the sender field
    if ( data.indexOfSenderAddress < 0 ) {
      String realSenderAddress = meta.getReplyAddress();
      data.indexOfSenderAddress = data.previousRowMeta.indexOfValue( realSenderAddress );
      if ( data.indexOfSenderAddress < 0 ) {
        throw new KettleException( BaseMessages.getString(
          PKG, "Mail.Exception.CouldnotFindReplyAddressField", realSenderAddress ) );
      }
    }

    // Reply to
    if ( !Utils.isEmpty( meta.getReplyToAddresses() ) ) {
      // cache the position of the reply to field
      if ( data.indexOfReplyToAddresses < 0 ) {
        String realReplyToAddresses = meta.getReplyToAddresses();
        data.indexOfReplyToAddresses = data.previousRowMeta.indexOfValue( realReplyToAddresses );
        if ( data.indexOfReplyToAddresses < 0 ) {
          throw new KettleException( BaseMessages.getString(
            PKG, "Mail.Exception.CouldnotFindReplyToAddressesField", realReplyToAddresses ) );
        }
      }
    }

    // Contact Person
    if ( !Utils.isEmpty( meta.getContactPerson() ) ) {
      // cache the position of the destination field
      if ( data.indexOfContactPerson < 0 ) {
        String realContactPerson = meta.getContactPerson();
        data.indexOfContactPerson = data.previousRowMeta.indexOfValue( realContactPerson );
        if ( data.indexOfContactPerson < 0 ) {
          throw new KettleException( BaseMessages.getString(
            PKG, "Mail.Exception.CouldnotFindContactPersonField", realContactPerson ) );
        }
      }
    }
    // Contact Phone

View on GitHub (pinned to f3058517a1)