pentaho/pentaho-kettle · error · KettleException

Mail.Log.DynamicZipFilenameFieldEmpty

Error message

Mail.Log.DynamicZipFilenameFieldEmpty

What it means

Thrown by Mail.validateMetaFields when zipping attachments is dynamic (meta.isZipFilenameDynamic() is true) but meta.getDynamicZipFilenameField() — the row field supplying the zip file name — is empty. The step needs to know which incoming field holds the zip target name before it can process attached files, so it fails fast in processRow.

Solutions

  1. Select the field holding the zip filename in the Mail step's dynamic zip-filename field setting.
  2. Call meta.setDynamicZipFilenameField("zipNameField") when enabling setZipFilenameDynamic(true) in code.
  3. Turn off the dynamic zip-filename option if a static zip name is intended, and set the static zip filename instead.

Example fix

// before
meta.setZipFilenameDynamic(true);
// after
meta.setZipFilenameDynamic(true);
meta.setDynamicZipFilenameField("zipNameField");
Defensive patterns

Strategy: validation

Validate before calling

if ( meta.isZipFilenameDynamic() && ( meta.getDynamicZipFilenameField() == null || meta.getDynamicZipFilenameField().trim().isEmpty() ) ) {
  throw new IllegalArgumentException("Mail step: dynamic zip filename field must be selected");
}

Try / catch

try { transformation.execute(); } catch ( KettleException e ) { if ( e.getMessage().contains("DynamicZipFilenameFieldEmpty") ) { /* set setDynamicZipFilenameField or disable dynamic zip */ } else { throw e; } }

Prevention

When it happens

Trigger: Enabling the dynamic zip-filename option in the Mail step without selecting the source field; code-built MailMeta with setZipFilenameDynamic(true) but no setDynamicZipFilenameField(...).

Common situations: Configuring dynamic attachments plus zipping and missing the zip-name field dropdown; field reference lost during transformation copy/import between environments.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

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

    // Check is replyname field is provided
    if ( Utils.isEmpty( meta.getReplyAddress() ) ) {
      throw new KettleException( BaseMessages.getString( PKG, "Mail.Log.ReplyFieldEmpty" ) );
    }

    // Check is SMTP server is provided
    if ( Utils.isEmpty( meta.getServer() ) ) {
      throw new KettleException( BaseMessages.getString( PKG, "Mail.Log.ServerFieldEmpty" ) );
    }

    // Check Attached filenames when dynamic
    if ( meta.isDynamicFilename() && Utils.isEmpty( meta.getDynamicFieldname() ) ) {
      throw new KettleException( BaseMessages.getString( PKG, "Mail.Log.DynamicFilenameFieldEmpty" ) );
    }

    // Check Attached zipfilename when dynamic
    if ( meta.isZipFilenameDynamic() && Utils.isEmpty( meta.getDynamicZipFilenameField() ) ) {
      throw new KettleException( BaseMessages.getString( PKG, "Mail.Log.DynamicZipFilenameFieldEmpty" ) );
    }

    validateZipFiles( meta );

    // check authentication
    if ( meta.isUsingAuthentication().equals( AUTENTICATION_BASIC ) ) {
      // check authentication user
      if ( Utils.isEmpty( meta.getAuthenticationUser() ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "Mail.Log.AuthenticationUserFieldEmpty" ) );
      }

      // check authentication pass
      if ( Utils.isEmpty( meta.getAuthenticationPassword() ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "Mail.Log.AuthenticationPasswordFieldEmpty" ) );
      }
    }
  }

View on GitHub (pinned to f3058517a1)