{"record":{"id":"17dfc255fe050164","repo":"pentaho/pentaho-kettle","slug":"executejobservlet-error-jobnotfoundindirectory","errorCode":"ExecuteJobServlet.Error.JobNotFoundInDirectory","errorMessage":"ExecuteJobServlet.Error.JobNotFoundInDirectory","messagePattern":"ExecuteJobServlet\\.Error\\.JobNotFoundInDirectory","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/ExecuteJobServlet.java","lineNumber":363,"sourceCode":"      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    }\n\n    RepositoriesMeta repositoriesMeta = new RepositoriesMeta();\n    repositoriesMeta.readData();\n    RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName );\n    if ( repositoryMeta == null ) {\n      String message = BaseMessages.getString( PKG, \"ExecuteJobServlet.Error.UnableToFindRepository\", repositoryName );","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/ExecuteJobServlet.java#L345-L381","documentation":"KettleException thrown by ExecuteJobServlet.loadJob when repository.getJobId(name, directory) returns null — the job exists in the URL but no job metadata object with that name is stored in the resolved repository directory. The directory was found but the job inside it was not.","triggerScenarios":"HTTP GET /kettle/executeJob/ with job=/path/name pointing at a valid directory, but getJobId() finds no job named 'name' in that directory (job renamed, deleted, or never saved there).","commonSituations":"Job renamed or moved to another directory; wrong directory in the URL while the job lives elsewhere; request cached from before the job was deleted; name mismatch including extension or case.","solutions":["Verify the job name exists in the target directory via Spoon's repository explorer","Correct the job parameter in the request URL to the actual job name","Search the repository for the job and update clients to the new path/name","If the job was deleted, redeploy or restore it","Check for case-sensitivity or extra extension (.kjb) issues in the name"],"exampleFix":"// before\nString jobParam = \"/home/admin/nightly_load\"; // job was renamed\n// after\nString jobParam = \"/home/admin/nightly_etl_load\"; // matches repository name","handlingStrategy":"validation","validationCode":"RepositoryDirectoryInterface dir = repo.loadRepositoryDirectoryTree().findDirectory( dirPath );\nboolean exists = dir != null && repo.getJobId( jobName, dir ) != null;","typeGuard":null,"tryCatchPattern":"try {\n  // executeJob request\n} catch ( KettleException e ) {\n  LOG.error( \"Job not found: \" + jobName + \" in \" + dirPath + \" — check rename/move\", e );\n}","preventionTips":["Look up job ObjectIds instead of hardcoding name/path in URLs","Update all clients/schedulers when jobs are renamed or moved","Verify job names with repository explorer before external execution","Avoid embedding repository paths in long-lived scripts"],"tags":["repository","job","servlet","pdi"],"backgroundTag":"entity-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"}