{"record":{"id":"eb5af02adaaf9171","repo":"pentaho/pentaho-kettle","slug":"gpload-exception-directorydoesnotexist","errorCode":null,"errorMessage":"GPLoad.Exception.DirectoryDoesNotExist","messagePattern":"GPLoad\\.Exception\\.DirectoryDoesNotExist","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java","lineNumber":469,"sourceCode":"    // make sure the variable substitution is not empty\n    pathToFile = environmentSubstitute( pathToFile ).trim();\n    if ( Utils.isEmpty( pathToFile ) ) {\n      throw new KettleException( exceptionMessage );\n    }\n\n    FileObject fileObject = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( pathToFile, getTransMeta() );\n    try {\n      // we either check the existence of the file\n      if ( checkExistenceOfFile ) {\n        if ( !fileObject.exists() ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoad.Execption.FileDoesNotExist\", pathToFile ) );\n        }\n      } else { // if the file does not have to exist, the parent, or source folder, does.\n        FileObject parentFolder = fileObject.getParent();\n        if ( parentFolder.exists() ) {\n          return KettleVFS.getFilename( fileObject );\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoad.Exception.DirectoryDoesNotExist\",\n              parentFolder.getURL().getPath() ) );\n        }\n\n      }\n\n      // if Windows is the OS\n      if ( Const.getOS().startsWith( \"Windows\" ) ) {\n        return addQuotes( pathToFile );\n      } else {\n        return KettleVFS.getFilename( fileObject );\n      }\n    } catch ( FileSystemException fsex ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPLoad.Exception.GPLoadCommandBuild\", fsex.getMessage() ) );\n    }\n  }\n\n  /**\n   * Create the command line for GPLoad depending on the meta information supplied.","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java#L451-L487","documentation":"When checkExistenceOfFile is false (e.g., for a control or data file that will be created), getPath() instead requires the file's PARENT directory to exist and throws this KettleException (key GPLoad.Exception.DirectoryDoesNotExist) with the parent's URL path if it does not.","triggerScenarios":"The output/control file path points into a directory that does not exist on the executing host, so fileObject.getParent().exists() returns false.","commonSituations":"Typo in the directory portion of the path; output directory never created on the Pentaho server; NFS mount not mounted; different working directories across cluster nodes.","solutions":["Create the missing parent directory (mkdir -p) on the host running the transformation, with write permission for the Pentaho user.","Correct the directory portion of the path in the step settings.","Add a preceding 'Create a folder' step or shell script to ensure the directory exists before GPLoad runs.","Verify mount points on all nodes if executing in a clustered environment."],"exampleFix":"// before\n/var/pentaho/gpload_out/control.gpctl  // directory missing\n// after (shell)\nmkdir -p /var/pentaho/gpload_out && chown pentaho:pentaho /var/pentaho/gpload_out","handlingStrategy":"validation","validationCode":"File dir = new File(\"/var/pentaho/gpload_out\");\nif (!dir.exists() || !dir.isDirectory() || !dir.canWrite()) {\n  throw new IllegalStateException(\"Output directory missing or unwritable: \" + dir);\n}","typeGuard":null,"tryCatchPattern":"try {\n  execute();\n} catch (KettleException ke) {\n  if (ke.getMessage().contains(\"DirectoryDoesNotExist\")) {\n    logError(\"Parent directory missing; create it before running\", ke);\n  }\n  throw ke;\n}","preventionTips":["Create output directories during deployment provisioning","Add a 'Create a folder' step before GPLoad in the transformation","Keep paths consistent across all cluster nodes"],"tags":["pdi","kettle","gpload","directory-not-found","filesystem"],"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"}