{"record":{"id":"d9b1f293510d14db","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-list-of-jobs-in-folder-with-id-id-directory","errorCode":null,"errorMessage":"Unable to get list of jobs in folder with id : + id_directory","messagePattern":"Unable to get list of jobs in folder with id : \\+ id_directory","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java","lineNumber":1076,"sourceCode":"          if ( !child.isHidden() || !repositoryMeta.isHidingHiddenFiles() ) {\n            String name = child.getName().getBaseName();\n\n            if ( name.endsWith( EXT_JOB ) ) {\n\n              String jobName = name.substring( 0, name.length() - 4 );\n\n              ObjectId id = new StringObjectId( calcObjectId( directory, jobName, EXT_JOB ) );\n              Date date = new Date( child.getContent().getLastModifiedTime() );\n              list.add( new RepositoryObject(\n                id, jobName, directory, \"-\", date, RepositoryObjectType.JOB, \"\", false ) );\n            }\n          }\n        }\n      }\n\n      return list;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to get list of jobs in folder with id : \" + id_directory, e );\n    }\n  }\n\n  public int getNrSubDirectories( ObjectId id_directory ) throws KettleException {\n\n    return 0;\n  }\n\n  @Override\n  public SlaveServer loadSlaveServer( ObjectId id_slave_server, String versionName ) throws KettleException {\n    try {\n      return new SlaveServer( loadNodeFromXML( id_slave_server, SlaveServer.XML_TAG ) );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to load slave server from the file repository\", e );\n    }\n  }\n\n  @Override","sourceCodeStart":1058,"sourceCodeEnd":1094,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java#L1058-L1094","documentation":"KettleFileRepository.getJobObjects() wraps any failure while listing job files in a repository directory in this KettleException. The file repository stores jobs as .kjb files on disk; the message includes the directory ObjectId whose listing failed. The original cause (IO error, VFS failure, invalid directory id) is attached as the cause.","triggerScenarios":"Calling getJobObjects(ObjectId id_directory) when the directory id does not resolve to a valid path on disk, the base directory is unreadable, or KettleVFS cannot list the folder's contents.","commonSituations":"Repository base directory moved, renamed, or deleted while the repository is open; incorrect base_directory configured in the repository connection settings; permissions changed on the folder; stale directory ObjectId passed after the tree changed.","solutions":["Check the cause stack trace (getCause()) to see the underlying VFS/IO error","Verify the base directory configured for the file repository exists and is readable","Reload the repository directory tree and re-resolve the directory ObjectId instead of using a cached id","Check filesystem permissions on the repository folder"],"exampleFix":"// before\nList<RepositoryElementMetaInterface> jobs = repo.getJobObjects(staleDirId);\n// after\nRepositoryDirectoryInterface dir = repo.loadRepositoryDirectoryTree().findDirectory(\"/production\");\nif (dir != null) {\n  List<RepositoryElementMetaInterface> jobs = repo.getJobObjects(dir.getObjectId());\n}","handlingStrategy":"try-catch","validationCode":"RepositoryDirectoryInterface dir = repo.loadRepositoryDirectoryTree().findDirectory(\"/production\");\nif (dir == null) throw new IllegalStateException(\"Directory does not exist; cannot list jobs\");","typeGuard":null,"tryCatchPattern":"try {\n  List<RepositoryElementMetaInterface> jobs = repo.getJobObjects(dirId);\n} catch (KettleException e) {\n  log.error(\"Job listing failed for dir \" + dirId, e); // inspect e.getCause()\n}","preventionTips":["Always resolve directory ids from a freshly loaded directory tree","Verify the repository base directory exists and is readable at startup","Never cache ObjectIds across repository reconnections"],"tags":["repository","file-system","vfs","kettle"],"backgroundTag":"file-read-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"}