{"record":{"id":"398c9c6252d12ca3","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-all-job-names","errorCode":null,"errorMessage":"Unable to get all job names","messagePattern":"Unable to get all job names","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":1567,"sourceCode":"      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\n  @Override\n  public List<RepositoryElementMetaInterface> getJobObjects( ObjectId idDirectory, boolean includeDeleted )\n    throws KettleException {\n    return getPdiObjects( idDirectory, Arrays.asList( new RepositoryObjectType[] { RepositoryObjectType.JOB } ),\n      includeDeleted );\n  }\n\n  @Override\n  public LogChannelInterface getLog() {\n    return log;\n  }\n\n  @Override\n  public String getName() {\n    return repositoryMeta.getName();","sourceCodeStart":1549,"sourceCodeEnd":1585,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L1549-L1585","documentation":"PurRepository.getJobNames wraps failures from getAllFilesOfType (the Pentaho repository listing of JOB-type files, optionally including deleted ones) in a generic KettleException with this message. It fires when the underlying repository call fails — typically due to connectivity, authentication, permissions, or a bad directory ObjectId — so the list of job names for the directory cannot be retrieved. Fix by checking repository connectivity/permissions and validating the directory ObjectId.","triggerScenarios":"Calling getJobNames(idDirectory, includeDeleted) when the directory ID is invalid/deleted or the repository file service fails to list children.","commonSituations":"Directory deleted or renamed by another user; stale cached directory ObjectId; transient repository outage while browsing in Spoon.","solutions":["Re-resolve the directory ObjectId (it may be stale) via getRepositoryDirectory(true).","Verify the directory still exists in the repository explorer.","Check the cause chain for the underlying repository exception.","Catch KettleException and return an empty list for read-only browsing."],"exampleFix":"// before\nString[] names = repository.getJobNames(dirId, false);\n// after\nString[] names;\ntry {\n  names = repository.getJobNames(dirId, false);\n} catch (KettleException e) {\n  logError(\"Directory listing failed\", e);\n  names = new String[0];\n}","handlingStrategy":"try-catch","validationCode":"// refresh the directory object to avoid stale IDs\nRepositoryDirectoryInterface fresh = repository.getRepositoryDirectory(true);\nif (fresh == null) throw new IllegalStateException(\"no root directory\");","typeGuard":"boolean dirValid = id -> id != null && !id.equals(new StringObjectId(\"\"));","tryCatchPattern":"try { names = repository.getJobNames(dirId, false); } catch (KettleException e) { log.error(\"job listing failed\", e); names = new String[0]; }","preventionTips":["Re-load directory ObjectIds rather than caching them long-term.","Handle concurrent renames/deletes by other users.","Check cause chain for service-level errors.","Use repository explorer to confirm directory state."],"tags":["repository","kettle","job","directory-listing"],"backgroundTag":"database-query-failed","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"}