{"record":{"id":"e47e0c15cba5ead9","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-directory-structure-from-repository","errorCode":null,"errorMessage":"Unable to load directory structure from repository","messagePattern":"Unable to load directory structure from repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":820,"sourceCode":"      if ( children != null ) {\n        for ( RepositoryFileTree child : children ) {\n          if ( child.getFile().isFolder() ) {\n            RepositoryDirectory dir = new RepositoryDirectory( parentDir, child.getFile().getName() );\n            dir.setObjectId( new StringObjectId( child.getFile().getId().toString() ) );\n            parentDir.addSubdirectory( dir );\n            fillRepositoryDirectoryFromTree( dir, child );\n          } else {\n            // a real file, like a Transformation or Job\n            RepositoryLock lock = unifiedRepositoryLockService.getLock( child.getFile() );\n            RepositoryObjectType objectType = getObjectType( child.getFile().getName() );\n\n            fileChildren.add( new EERepositoryObject( child, parentDir, null, objectType, null, lock, false ) );\n          }\n        }\n        parentDir.setRepositoryObjects( fileChildren );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to load directory structure from repository\", e );\n    }\n  }\n\n  @Override\n  public String[] getDirectoryNames( final ObjectId idDirectory ) throws KettleException {\n    try {\n      readWriteLock.readLock().lock();\n      List<RepositoryFile> children;\n      try {\n        children = pur.getChildren( idDirectory.getId() );\n      } finally {\n        readWriteLock.readLock().unlock();\n      }\n\n      List<String> childNames = new ArrayList<String>();\n      for ( RepositoryFile child : children ) {\n        if ( child.isFolder() ) {\n          childNames.add( child.getName() );","sourceCodeStart":802,"sourceCodeEnd":838,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L802-L838","documentation":"Failure while loading the children (repository objects) of a directory in the PUR repository: any exception during traversal of the folder's files and construction of EERepositoryObject entries is wrapped as this KettleException. It means the directory structure could not be materialized from the enterprise repository.","triggerScenarios":"Directory-tree loading code that calls the repository's folder-loading routine (as used by getRepositoryDirectory tree building); any exception listing children or building EERepositoryObject (bad metadata, unsupported object type, server error) triggers it.","commonSituations":"Corrupted or partially deleted repository objects; server returning unexpected file metadata; permission issues reading a subfolder; stale repository cache after server upgrade.","solutions":["Inspect the wrapped cause to identify which child file failed to load.","Refresh/reconnect the repository connection and retry loading the tree.","Check server logs for metadata corruption on the affected folder.","Repair or remove the offending repository object via the BA server admin tools."],"exampleFix":"// before\nRepositoryDirectoryInterface tree = repo.loadRepositoryDirectoryTree();\n// after\ntry {\n  RepositoryDirectoryInterface tree = repo.loadRepositoryDirectoryTree();\n} catch (KettleException e) {\n  log.error(\"Tree load failed: {}\", e.getCause(), e);\n  throw e;\n}","handlingStrategy":"retry","validationCode":"if (!repo.isConnected()) repo.connect(user, pass);\nObjectId dirId = repo.getRepositoryDirectoryTree().findDirectory(path).getObjectId();\nif (dirId == null) throw new KettleException(\"Directory missing: \" + path);","typeGuard":"null","tryCatchPattern":"try {\n  tree = repo.loadRepositoryDirectoryTree();\n} catch (KettleException e) {\n  log.error(\"Cause: {}\", e.getCause());\n  throw e;\n}","preventionTips":["Reconnect and rebuild the tree after server upgrades.","Check server logs when tree loading fails intermittently.","Avoid holding stale ObjectIds across sessions."],"tags":["repository","directory-tree","pentaho","metadata"],"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"}