{"record":{"id":"cc0432a025a5d65d","repo":"pentaho/pentaho-kettle","slug":"jobgetmailsfrompop-error-outputfolderempty","errorCode":null,"errorMessage":"JobGetMailsFromPOP.Error.OutputFolderEmpty","messagePattern":"JobGetMailsFromPOP\\.Error\\.OutputFolderEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/email-messages/impl/src/main/java/org/pentaho/di/job/entries/getpop/JobEntryGetPOP.java","lineNumber":1580,"sourceCode":"      throw new IllegalArgumentException( \"Invalid folderType argument\" );\n    }\n    String folderName = \"\";\n    switch ( folderType ) {\n      case JobEntryGetPOP.FOLDER_OUTPUT:\n        folderName = getRealOutputDirectory();\n        break;\n      case JobEntryGetPOP.FOLDER_ATTACHMENTS:\n        if ( isSaveAttachment() && isDifferentFolderForAttachment() ) {\n          folderName = getRealAttachmentFolder();\n        } else {\n          folderName = getRealOutputDirectory();\n        }\n        break;\n    }\n    if ( Utils.isEmpty( folderName ) ) {\n      switch ( folderType ) {\n        case JobEntryGetPOP.FOLDER_OUTPUT:\n          throw new KettleException( BaseMessages.getString( PKG, \"JobGetMailsFromPOP.Error.OutputFolderEmpty\" ) );\n        case JobEntryGetPOP.FOLDER_ATTACHMENTS:\n          throw new KettleException( BaseMessages.getString( PKG, \"JobGetMailsFromPOP.Error.AttachmentFolderEmpty\" ) );\n      }\n    }\n    FileObject folder = KettleVFS.getInstance( parentJobMeta.getBowl() ).getFileObject( folderName, this );\n    if ( folder.exists() ) {\n      if ( folder.getType() != FileType.FOLDER ) {\n        switch ( folderType ) {\n          case JobEntryGetPOP.FOLDER_OUTPUT:\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"JobGetMailsFromPOP.Error.NotAFolderNot\", folderName ) );\n          case JobEntryGetPOP.FOLDER_ATTACHMENTS:\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"JobGetMailsFromPOP.Error.AttachmentFolderNotAFolder\", folderName ) );\n        }\n      }\n      if ( isDebug() ) {\n        switch ( folderType ) {","sourceCodeStart":1562,"sourceCodeEnd":1598,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/email-messages/impl/src/main/java/org/pentaho/di/job/entries/getpop/JobEntryGetPOP.java#L1562-L1598","documentation":"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.","triggerScenarios":"execute() -> createOutputDirectory(FOLDER_OUTPUT) with Utils.isEmpty(folderName) true: the output directory field is blank or its environment variable resolves to empty.","commonSituations":"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.","solutions":["Set a concrete absolute path in the 'Output directory' field of the Get Mails job entry.","If using a variable, define it before execution (kettle.properties, Set Variables entry, or kitchen -param).","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."],"exampleFix":"// before (kjb XML)\n<output_directory></output_directory>\n// after\n<output_directory>/data/pentaho/mail_out</output_directory>","handlingStrategy":"validation","validationCode":"String out = environmentSubstitute(getOutputFolder());\nif (out == null || out.trim().isEmpty()) {\n  throw new IllegalArgumentException(\"Output folder must be set before running the Get Mails entry\");\n}","typeGuard":null,"tryCatchPattern":"try { executeJobEntry(); } catch (KettleException e) {\n  if (e.getMessage().contains(\"OutputFolderEmpty\")) {\n    logError(\"Output directory is empty; set output_directory in the job entry\");\n  } else { throw e; }\n}","preventionTips":["Always configure an absolute output directory in the dialog.","Prefer absolute paths over variables for scheduled/kitchen runs.","If a variable is needed, set it via Set Variables at the very start of the job."],"tags":["kettle","email","configuration","filesystem","empty-field"],"backgroundTag":"empty-required-field","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"}