pentaho/pentaho-kettle · error · KettleException

GPLoad.Exception.DirectoryDoesNotExist

Error message

GPLoad.Exception.DirectoryDoesNotExist

What it means

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.

Solutions

  1. Create the missing parent directory (mkdir -p) on the host running the transformation, with write permission for the Pentaho user.
  2. Correct the directory portion of the path in the step settings.
  3. Add a preceding 'Create a folder' step or shell script to ensure the directory exists before GPLoad runs.
  4. Verify mount points on all nodes if executing in a clustered environment.

Example fix

// before
/var/pentaho/gpload_out/control.gpctl  // directory missing
// after (shell)
mkdir -p /var/pentaho/gpload_out && chown pentaho:pentaho /var/pentaho/gpload_out
Defensive patterns

Strategy: validation

Validate before calling

File dir = new File("/var/pentaho/gpload_out");
if (!dir.exists() || !dir.isDirectory() || !dir.canWrite()) {
  throw new IllegalStateException("Output directory missing or unwritable: " + dir);
}

Try / catch

try {
  execute();
} catch (KettleException ke) {
  if (ke.getMessage().contains("DirectoryDoesNotExist")) {
    logError("Parent directory missing; create it before running", ke);
  }
  throw ke;
}

Prevention

When it happens

Trigger: The output/control file path points into a directory that does not exist on the executing host, so fileObject.getParent().exists() returns false.

Common situations: 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.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/eb5af02adaaf9171. Report an issue: GitHub.

Appendix: source

Thrown at plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java:469

    // make sure the variable substitution is not empty
    pathToFile = environmentSubstitute( pathToFile ).trim();
    if ( Utils.isEmpty( pathToFile ) ) {
      throw new KettleException( exceptionMessage );
    }

    FileObject fileObject = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( pathToFile, getTransMeta() );
    try {
      // we either check the existence of the file
      if ( checkExistenceOfFile ) {
        if ( !fileObject.exists() ) {
          throw new KettleException( BaseMessages.getString( PKG, "GPLoad.Execption.FileDoesNotExist", pathToFile ) );
        }
      } else { // if the file does not have to exist, the parent, or source folder, does.
        FileObject parentFolder = fileObject.getParent();
        if ( parentFolder.exists() ) {
          return KettleVFS.getFilename( fileObject );
        } else {
          throw new KettleException( BaseMessages.getString( PKG, "GPLoad.Exception.DirectoryDoesNotExist",
              parentFolder.getURL().getPath() ) );
        }

      }

      // if Windows is the OS
      if ( Const.getOS().startsWith( "Windows" ) ) {
        return addQuotes( pathToFile );
      } else {
        return KettleVFS.getFilename( fileObject );
      }
    } catch ( FileSystemException fsex ) {
      throw new KettleException( BaseMessages.getString( PKG, "GPLoad.Exception.GPLoadCommandBuild", fsex.getMessage() ) );
    }
  }

  /**
   * Create the command line for GPLoad depending on the meta information supplied.

View on GitHub (pinned to f3058517a1)