{"record":{"id":"28f5d7ae9e2eaaf2","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-the-directory-tree-from-this-file-repository","errorCode":null,"errorMessage":"Unable to load the directory tree from this file repository","messagePattern":"Unable to load the directory tree from this file repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"critical","filePath":"engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java","lineNumber":992,"sourceCode":"      FileObject folder = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( folderName );\n\n      for ( FileObject child : folder.getChildren() ) {\n        if ( child.getType().equals( FileType.FOLDER ) ) {\n          if ( !child.isHidden() || !repositoryMeta.isHidingHiddenFiles() ) {\n            if ( !\".meta\".equals( child.getName().getBaseName() ) ) {\n              RepositoryDirectory subDir = new RepositoryDirectory( dir, child.getName().getBaseName() );\n              subDir.setObjectId( new StringObjectId( calcObjectId( subDir ) ) );\n              dir.addSubdirectory( subDir );\n\n              loadRepositoryDirectoryTree( subDir );\n            }\n          }\n        }\n      }\n\n      return dir;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to load the directory tree from this file repository\", e );\n    }\n  }\n\n  @Override\n  public RepositoryDirectoryInterface findDirectory( String directory ) throws KettleException {\n    return loadRepositoryDirectoryTree().findDirectory( directory );\n  }\n\n  @Override\n  public RepositoryDirectoryInterface findDirectory( ObjectId directory ) throws KettleException {\n    return loadRepositoryDirectoryTree().findDirectory( directory );\n  }\n\n  @Override\n  public List<RepositoryElementMetaInterface> getTransformationObjects( ObjectId idDirectory,\n    boolean includeDeleted ) throws KettleException {\n\n    try {","sourceCodeStart":974,"sourceCodeEnd":1010,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java#L974-L1010","documentation":"loadRepositoryDirectoryTree() reconstructs the full RepositoryDirectory hierarchy by reading the repository's directory metadata file; any exception during this read/parse is wrapped in this fixed-message KettleException. Since nearly every repository operation depends on the directory tree, this failure typically makes the whole repository unusable until fixed.","triggerScenarios":"Calling loadRepositoryDirectoryTree() (directly or via findDirectory/getDirectoryID) when the directory metadata file is missing, unreadable, corrupt, or its XML cannot be parsed into RepositoryDirectory nodes.","commonSituations":"Wrong base directory configured so the .kdb/.xml directory file is absent; the directory file truncated by an aborted write or disk-full event; permission problems; the repository folder synchronized between machines leaving conflicts.","solutions":["Verify the repository directory metadata file exists in the base folder and is valid XML","Restore the directory file from backup if it is truncated or corrupt","Fix filesystem permissions or the base-directory configuration","Recreate the repository structure (re-save folders from Spoon) if no backup exists"],"exampleFix":"// before\nRepositoryDirectoryInterface tree = repository.loadRepositoryDirectoryTree();\n// after\nRepositoryDirectoryInterface tree;\ntry {\n  tree = repository.loadRepositoryDirectoryTree();\n} catch (KettleException e) {\n  throw new KettleException(\"Repository unusable: directory tree unreadable — check base dir/metadata file\", e);\n}","handlingStrategy":"fallback","validationCode":"File dirFile = new File(repoBaseDirectory, DIRECTORY_ELEMENTS_FILENAME); // metadata file used by the file repo\nif (!dirFile.isFile()) throw new KettleException(\"Repository directory metadata file missing: \" + dirFile);\nif (!dirFile.canRead()) throw new KettleException(\"Repository directory metadata not readable\");","typeGuard":null,"tryCatchPattern":"try {\n  RepositoryDirectoryInterface tree = repository.loadRepositoryDirectoryTree();\n} catch (KettleException e) {\n  logger.fatal(\"Repository directory tree unreadable; restore metadata file from backup\", e);\n  throw new KettleException(\"Repository unusable — check base directory and metadata file\", e);\n}","preventionTips":["Back up the repository directory metadata file regularly","Ensure writes complete cleanly (avoid disk-full and kill during saves)","Verify base-directory configuration before opening the repository in scripts","Avoid multi-writer sync tools that can corrupt the metadata file"],"tags":["file-repository","kettle","directory-tree","io-exception"],"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"}