pentaho/pentaho-kettle · error · KettleException

ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository

ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository

Error message

ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository

What it means

KettleException thrown by ExecuteJobServlet.loadJob when repository.loadRepositoryDirectoryTree().findDirectory(directoryPath) returns null — the directory path supplied in the job execution request does not exist in the repository. The servlet cannot locate the folder that should contain the job to execute.

Solutions

  1. Verify the directory path exists in the repository (browse it in Spoon)
  2. Correct the directoryPath/job parameter in the request URL
  3. Confirm you are connected to the intended repository (check repositories.xml / repository name)
  4. Check for case-sensitivity or leading/trailing slash issues in the path
  5. Re-create the directory if it was deleted, and move the job back into it

Example fix

// before
String url = "http://host:8080/kettle/executeJob/?rep=repo&user=u&pass=p&job=/home/admn/report_job"; // typo'd dir
// after
String url = "http://host:8080/kettle/executeJob/?rep=repo&user=u&pass=p&job=/home/admin/report_job";
Defensive patterns

Strategy: validation

Validate before calling

RepositoryDirectoryInterface dir =
  repository.loadRepositoryDirectoryTree().findDirectory( directoryPath );
if ( dir == null ) throw new IllegalArgumentException( "Unknown repository dir: " + directoryPath );

Try / catch

try {
  // call executeJob servlet / loadJob
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "DirectoryPathNotFound" ) || e.getMessage().contains( "directory" ) ) {
    LOG.error( "Bad job directory path in request: " + requestedPath );
  }
}

Prevention

When it happens

Trigger: HTTP GET to /kettle/executeJob/ with a repository-connected request whose job parameter encodes a directory path (e.g. /home/admin/myjob) that findDirectory() cannot resolve in the repository tree.

Common situations: Directory renamed or moved in Spoon after a client saved the URL; typo in the path parameter; connecting to a different repository than expected; case-sensitivity mismatch on the directory path; repository not fully synced.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/www/ExecuteJobServlet.java:357

      // With a repository we need to load it from /foo/bar/Job
      // We need to extract the folder name from the path in front of the name...
      //
      String directoryPath;
      String name;
      int lastSlash = job.lastIndexOf( RepositoryDirectory.DIRECTORY_SEPARATOR );
      if ( lastSlash < 0 ) {
        directoryPath = "/";
        name = job;
      } else {
        directoryPath = job.substring( 0, lastSlash );
        name = job.substring( lastSlash + 1 );
      }
      RepositoryDirectoryInterface directory =
        repository.loadRepositoryDirectoryTree().findDirectory( directoryPath );
      if ( directory == null ) {
        String message = BaseMessages.getString( PKG, "ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository", directoryPath );
        throw new KettleException( message );
      }

      ObjectId jobID = repository.getJobId( name, directory );
      if ( jobID == null ) {
        String message = BaseMessages.getString( PKG, "ExecuteJobServlet.Error.JobNotFoundInDirectory", name, directoryPath );
        throw new KettleException( message );
      }
      JobMeta jobMeta = repository.loadJob( jobID, null, parentVariableSpace );
      return jobMeta;
    }
  }

  @VisibleForTesting
  Repository openRepository( String repositoryName, String user, String pass ) throws KettleException {

    if ( Utils.isEmpty( repositoryName ) ) {
      return null;
    }

View on GitHub (pinned to f3058517a1)