{"record":{"id":"a1aa497b1f06f187","repo":"pentaho/pentaho-kettle","slug":"jobwritetofile-log-parentfoldetnotexist","errorCode":null,"errorMessage":"JobWriteToFile.Log.ParentFoldetNotExist","messagePattern":"JobWriteToFile\\.Log\\.ParentFoldetNotExist","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/writetofile/JobEntryWriteToFile.java","lineNumber":256,"sourceCode":"  }\n\n  private void createParentFolder( String realFilename ) throws KettleException {\n    FileObject parent = null;\n    try {\n      parent = KettleVFS.getInstance( parentJobMeta.getBowl() ).getFileObject( realFilename, this ).getParent();\n      if ( !parent.exists() ) {\n        if ( isCreateParentFolder() ) {\n          if ( isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"JobWriteToFile.Log.ParentFoldetNotExist\", parent\n              .getName().toString() ) );\n          }\n          parent.createFolder();\n          if ( isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"JobWriteToFile.Log.ParentFolderCreated\", parent\n              .getName().toString() ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"JobWriteToFile.Log.ParentFoldetNotExist\", parent.getName().toString() ) );\n        }\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobWriteToFile.Error.CheckingParentFolder\", realFilename ), e );\n    } finally {\n      if ( parent != null ) {\n        try {\n          parent.close();\n        } catch ( Exception e ) { /* Ignore */\n        }\n      }\n    }\n  }\n\n  public boolean evaluates() {\n    return true;","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/writetofile/JobEntryWriteToFile.java#L238-L274","documentation":"KettleException with message key JobWriteToFile.Log.ParentFoldetNotExist thrown by JobEntryWriteToFile.createParentFolder when the file's parent folder does not exist, folder creation was not requested (createParentFolder=false) or the attempt to create it failed (e.g. FileObject.createFolder threw, caught upstream and reported here via CheckingParentFolder wrap only in outer catch... specifically this inner throw means the parent is not creatable/existing). The folder path is included in the message.","triggerScenarios":"Executing the Write to File job entry where the target filename's parent directory does not exist and cannot be created — createParentFolder is enabled but createFolder fails or the parent still does not exist after the attempt.","commonSituations":"Typo in the output directory path; running on an OS with different path separators; job running as a user without write permission on the parent; relative paths resolving against an unexpected working directory when run on a server/cluster.","solutions":["Create the missing parent directory manually or fix the filename path","Enable the 'Create parent folder' option in the job entry","Check OS user permissions on the target directory","Use absolute paths to avoid surprises from the process working directory"],"exampleFix":"// before\nString filename = \"/data/out/report.txt\"; // /data/out missing, throws\n// after\nnew File(\"/data/out\").mkdirs();\nString filename = \"/data/out/report.txt\";","handlingStrategy":"validation","validationCode":"// before execute\nFile out = new File(filename);\nFile parent = out.getAbsoluteFile().getParentFile();\nif (parent == null || (!parent.exists() && !createParentFolder)) {\n  throw new IllegalStateException(\"Parent folder missing and createParentFolder disabled: \" + parent);\n}","typeGuard":null,"tryCatchPattern":"try {\n  entry.execute(prev, nr);\n} catch (KettleException e) {\n  logError(\"Parent folder problem for \" + filename + \": \" + e.getMessage(), e);\n}","preventionTips":["Always enable 'Create parent folder' for dynamic output paths","Use absolute paths in server/cluster environments","Verify the executing OS user has write access to output directories","Pre-create output directories during deployment"],"tags":["kettle","filesystem","directory","job-entry"],"backgroundTag":"directory-not-found","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"}