{"record":{"id":"d5d123921a2a4258","repo":"pentaho/pentaho-kettle","slug":"executejobservlet-error-directorypathnotfoundinrepository","errorCode":"ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository","errorMessage":"ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository","messagePattern":"ExecuteJobServlet\\.Error\\.DirectoryPathNotFoundInRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/ExecuteJobServlet.java","lineNumber":357,"sourceCode":"\n      // With a repository we need to load it from /foo/bar/Job\n      // We need to extract the folder name from the path in front of the name...\n      //\n      String directoryPath;\n      String name;\n      int lastSlash = job.lastIndexOf( RepositoryDirectory.DIRECTORY_SEPARATOR );\n      if ( lastSlash < 0 ) {\n        directoryPath = \"/\";\n        name = job;\n      } else {\n        directoryPath = job.substring( 0, lastSlash );\n        name = job.substring( lastSlash + 1 );\n      }\n      RepositoryDirectoryInterface directory =\n        repository.loadRepositoryDirectoryTree().findDirectory( directoryPath );\n      if ( directory == null ) {\n        String message = BaseMessages.getString( PKG, \"ExecuteJobServlet.Error.DirectoryPathNotFoundInRepository\", directoryPath );\n        throw new KettleException( message );\n      }\n\n      ObjectId jobID = repository.getJobId( name, directory );\n      if ( jobID == null ) {\n        String message = BaseMessages.getString( PKG, \"ExecuteJobServlet.Error.JobNotFoundInDirectory\", name, directoryPath );\n        throw new KettleException( message );\n      }\n      JobMeta jobMeta = repository.loadJob( jobID, null, parentVariableSpace );\n      return jobMeta;\n    }\n  }\n\n  @VisibleForTesting\n  Repository openRepository( String repositoryName, String user, String pass ) throws KettleException {\n\n    if ( Utils.isEmpty( repositoryName ) ) {\n      return null;\n    }","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/ExecuteJobServlet.java#L339-L375","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the directory path exists in the repository (browse it in Spoon)","Correct the directoryPath/job parameter in the request URL","Confirm you are connected to the intended repository (check repositories.xml / repository name)","Check for case-sensitivity or leading/trailing slash issues in the path","Re-create the directory if it was deleted, and move the job back into it"],"exampleFix":"// before\nString url = \"http://host:8080/kettle/executeJob/?rep=repo&user=u&pass=p&job=/home/admn/report_job\"; // typo'd dir\n// after\nString url = \"http://host:8080/kettle/executeJob/?rep=repo&user=u&pass=p&job=/home/admin/report_job\";","handlingStrategy":"validation","validationCode":"RepositoryDirectoryInterface dir =\n  repository.loadRepositoryDirectoryTree().findDirectory( directoryPath );\nif ( dir == null ) throw new IllegalArgumentException( \"Unknown repository dir: \" + directoryPath );","typeGuard":null,"tryCatchPattern":"try {\n  // call executeJob servlet / loadJob\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"DirectoryPathNotFound\" ) || e.getMessage().contains( \"directory\" ) ) {\n    LOG.error( \"Bad job directory path in request: \" + requestedPath );\n  }\n}","preventionTips":["Generate request URLs from live repository directory lookups","Validate directory paths before building /kettle/executeJob/ URLs","Keep repository directories stable; announce renames to clients","Mind case-sensitivity on Linux-hosted repositories"],"tags":["repository","directory","servlet","pdi"],"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"}