pentaho/pentaho-kettle · error · KettleException

JobGetMailsFromPOP.Error.OutputFolderEmpty

Error message

JobGetMailsFromPOP.Error.OutputFolderEmpty

What it means

createOutputDirectory(folderType) resolves the output folder name (after variable substitution) and throws this KettleException when the resolved folder path is empty for FOLDER_OUTPUT. The job entry must know where to write downloaded mail messages, so an empty output directory is a fatal configuration error.

Solutions

  1. Set a concrete absolute path in the 'Output directory' field of the Get Mails job entry.
  2. If using a variable, define it before execution (kettle.properties, Set Variables entry, or kitchen -param).
  3. Anchor relative variables on a known base, e.g. ${Internal.Job.Filename.Directory}/mails, and ensure the job is saved so that variable is populated.

Example fix

// before (kjb XML)
<output_directory></output_directory>
// after
<output_directory>/data/pentaho/mail_out</output_directory>
Defensive patterns

Strategy: validation

Validate before calling

String out = environmentSubstitute(getOutputFolder());
if (out == null || out.trim().isEmpty()) {
  throw new IllegalArgumentException("Output folder must be set before running the Get Mails entry");
}

Try / catch

try { executeJobEntry(); } catch (KettleException e) {
  if (e.getMessage().contains("OutputFolderEmpty")) {
    logError("Output directory is empty; set output_directory in the job entry");
  } else { throw e; }
}

Prevention

When it happens

Trigger: execute() -> createOutputDirectory(FOLDER_OUTPUT) with Utils.isEmpty(folderName) true: the output directory field is blank or its environment variable resolves to empty.

Common situations: Job entry created/saved without setting 'Output directory'; variable like ${Internal.Job.Filename.Directory}/mail is used but the job is run standalone (kitchen) so it resolves empty; kjb XML edited by hand dropping the field.

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/cc0432a025a5d65d. Report an issue: GitHub.

Appendix: source

Thrown at plugins/email-messages/impl/src/main/java/org/pentaho/di/job/entries/getpop/JobEntryGetPOP.java:1580

      throw new IllegalArgumentException( "Invalid folderType argument" );
    }
    String folderName = "";
    switch ( folderType ) {
      case JobEntryGetPOP.FOLDER_OUTPUT:
        folderName = getRealOutputDirectory();
        break;
      case JobEntryGetPOP.FOLDER_ATTACHMENTS:
        if ( isSaveAttachment() && isDifferentFolderForAttachment() ) {
          folderName = getRealAttachmentFolder();
        } else {
          folderName = getRealOutputDirectory();
        }
        break;
    }
    if ( Utils.isEmpty( folderName ) ) {
      switch ( folderType ) {
        case JobEntryGetPOP.FOLDER_OUTPUT:
          throw new KettleException( BaseMessages.getString( PKG, "JobGetMailsFromPOP.Error.OutputFolderEmpty" ) );
        case JobEntryGetPOP.FOLDER_ATTACHMENTS:
          throw new KettleException( BaseMessages.getString( PKG, "JobGetMailsFromPOP.Error.AttachmentFolderEmpty" ) );
      }
    }
    FileObject folder = KettleVFS.getInstance( parentJobMeta.getBowl() ).getFileObject( folderName, this );
    if ( folder.exists() ) {
      if ( folder.getType() != FileType.FOLDER ) {
        switch ( folderType ) {
          case JobEntryGetPOP.FOLDER_OUTPUT:
            throw new KettleException( BaseMessages.getString(
              PKG, "JobGetMailsFromPOP.Error.NotAFolderNot", folderName ) );
          case JobEntryGetPOP.FOLDER_ATTACHMENTS:
            throw new KettleException( BaseMessages.getString(
              PKG, "JobGetMailsFromPOP.Error.AttachmentFolderNotAFolder", folderName ) );
        }
      }
      if ( isDebug() ) {
        switch ( folderType ) {

View on GitHub (pinned to f3058517a1)