{"record":{"id":"af8364c2448a96ad","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-id-for-job-name","errorCode":null,"errorMessage":"Unable to get ID for job [name]","messagePattern":"Unable to get ID for job \\[name\\]","errorType":"exception","errorClass":"IdNotFoundException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":1552,"sourceCode":"    // implemented by RepositoryProxy\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public boolean getJobEntryAttributeBoolean( ObjectId arg0, int arg1, String arg2, boolean arg3 )\n    throws KettleException {\n    // implemented by RepositoryProxy\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public ObjectId getJobId( final String name, final RepositoryDirectoryInterface repositoryDirectory )\n    throws KettleException {\n    try {\n      return getObjectId( name, repositoryDirectory, RepositoryObjectType.JOB, false );\n    } catch ( Exception e ) {\n      String path = repositoryDirectory != null ? repositoryDirectory.toString() : \"null\";\n      throw new IdNotFoundException( \"Unable to get ID for job [\" + name + \"]\", e, name, path,\n        RepositoryObjectType.JOB );\n    }\n  }\n\n  @Override\n  public String[] getJobNames( ObjectId idDirectory, boolean includeDeleted ) throws KettleException {\n    try {\n      List<RepositoryFile> children = getAllFilesOfType( idDirectory, RepositoryObjectType.JOB, includeDeleted );\n      List<String> names = new ArrayList<String>();\n      for ( RepositoryFile file : children ) {\n        names.add( file.getTitle() );\n      }\n      return names.toArray( new String[ 0 ] );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to get all job names\", e );\n    }\n  }\n","sourceCodeStart":1534,"sourceCodeEnd":1570,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L1534-L1570","documentation":"Repository lookup failure in PurRepository.getJobId: resolving the object id for the named job in the given directory failed. The IdNotFoundException carries the job name, directory path, and type so callers can distinguish missing jobs from other repository errors.","triggerScenarios":"Calling getJobId(name, directory) when no job file with that exact name exists in the given repository directory (or the directory is null/invalid), or the listing/lookup call itself fails.","commonSituations":"Hardcoded job paths broken after renames/moves; case-sensitivity mismatch on job names; passing null directory expecting root; saving to a different folder than the lookup expects.","solutions":["Verify the job name and directory path (list the directory with getJobNames(directory, false)).","Use repository directory objects from loadRepositoryDirectory/getRepositoryDirectory instead of hand-built paths.","Handle IdNotFoundException explicitly to distinguish 'not found' from infrastructure errors.","Search the whole repository (getJobNames with root dir) if the location is uncertain."],"exampleFix":"// before\nObjectId id = repository.getJobId(\"ETL_Job\", dir); // NPE / IdNotFound if missing\n// after\nObjectId id;\ntry {\n  id = repository.getJobId(\"ETL_Job\", dir);\n} catch (IdNotFoundException e) {\n  id = null; // job absent; create or report to user\n}","handlingStrategy":"try-catch","validationCode":"// pre-check existence\nString[] existing = repository.getJobNames(dir == null ? rootDir : dir, false);\nboolean present = Arrays.asList(existing).contains(name);","typeGuard":"boolean jobPresent = (String n, RepositoryDirectoryInterface d) -> d != null && Arrays.asList(repository.getJobNames(d, false)).contains(n);","tryCatchPattern":"try { id = repository.getJobId(name, dir); } catch (IdNotFoundException e) { log.warn(\"job not found: \" + e.getMessage()); id = null; }","preventionTips":["Use actual RepositoryDirectory objects, never hand-built paths.","Confirm job names case-sensitively before lookup.","Catch IdNotFoundException specifically, not generic KettleException.","Search root directory when the exact location is unknown."],"tags":["repository","kettle","job","not-found"],"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"}