{"record":{"id":"57213aa443a1c355","repo":"pentaho/pentaho-kettle","slug":"jobgetmailsfrompop-error-notafoldernot","errorCode":null,"errorMessage":"JobGetMailsFromPOP.Error.NotAFolderNot","messagePattern":"JobGetMailsFromPOP\\.Error\\.NotAFolderNot","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":1590,"sourceCode":"        } 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 ) {\n          case JobEntryGetPOP.FOLDER_OUTPUT:\n            logDebug( BaseMessages.getString( PKG, \"JobGetMailsFromPOP.Log.OutputFolderExists\", folderName ) );\n            break;\n          case JobEntryGetPOP.FOLDER_ATTACHMENTS:\n            logDebug( BaseMessages.getString( PKG, \"JobGetMailsFromPOP.Log.AttachmentFolderExists\", folderName ) );\n            break;\n        }\n      }\n    } else {\n      if ( isCreateLocalFolder() ) {","sourceCodeStart":1572,"sourceCodeEnd":1608,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/email-messages/impl/src/main/java/org/pentaho/di/job/entries/getpop/JobEntryGetPOP.java#L1572-L1608","documentation":"createOutputDirectory() resolves the output folder via KettleVFS and checks folder.exists(); if the path exists but its VFS FileType is not FileType.FOLDER (e.g. a regular file or symlink to a file), the entry throws this KettleException with the folder name as a message parameter. It prevents attempting folder operations (createFolder, message writes) on a non-directory path.","triggerScenarios":"createOutputDirectory(FOLDER_OUTPUT) where the resolved folderName exists on disk/VFS as a file, not a directory.","commonSituations":"User points the output directory at an existing file (e.g. a zip or log file path); a variable expansion produced a filename rather than a directory; a previous run created a file at the intended folder path.","solutions":["Remove or rename the file that occupies the configured output path, then let the entry create/verify the directory.","Point the 'Output directory' field at a directory path (trailing path segment, not a filename).","Check the resolved variable value (log it or test in a Get Variable step) to make sure it expands to the intended directory."],"exampleFix":"// before\noutput directory = /data/mails.bak   (a file)\n// after\noutput directory = /data/mails      (directory, file moved aside)","handlingStrategy":"validation","validationCode":"File out = new File(environmentSubstitute(getOutputFolder()));\nif (out.exists() && !out.isDirectory()) {\n  throw new IllegalArgumentException(\"Output path exists but is not a directory: \" + out);\n}","typeGuard":null,"tryCatchPattern":"try { executeJobEntry(); } catch (KettleException e) {\n  if (e.getMessage().contains(\"NotAFolderNot\")) {\n    logError(\"Configured output path is a file, not a directory: \" + e.getMessage());\n  } else { throw e; }\n}","preventionTips":["Point output directory at a directory path, never a file.","Check for leftover files at the configured path after archive/cleanup jobs.","Log the resolved variable value before running in production."],"tags":["kettle","email","filesystem","path","configuration"],"backgroundTag":"path-is-not-a-directory","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"}