{"record":{"id":"bf22533dbe82f6c1","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-list-of-objects-from-directory-dirid","errorCode":null,"errorMessage":"Unable to get list of objects from directory [dirId]","messagePattern":"Unable to get list of objects from directory \\[dirId\\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":1805,"sourceCode":"      }\n      if ( includeDeleted ) {\n        String dirPath = null;\n        if ( dirId != null ) {\n          // derive path using id\n          dirPath = pur.getFileById( dirId.getId() ).getPath();\n        }\n\n        List<RepositoryFile> deletedChildren = getAllDeletedFilesOfType( dirPath, objectTypes );\n        for ( RepositoryFile file : deletedChildren ) {\n          RepositoryLock lock = unifiedRepositoryLockService.getLock( file );\n          RepositoryObjectType objectType = getObjectType( file.getName() );\n          list.add( new EERepositoryObject( file, repDir, null, objectType, null, lock, true ) );\n        }\n      }\n\n      return list;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to get list of objects from directory [\" + dirId + \"]\", e );\n    } finally {\n      readWriteLock.readLock().unlock();\n    }\n  }\n\n  public static RepositoryObjectType getObjectType( final String filename ) throws KettleException {\n    if ( filename.endsWith( RepositoryObjectType.TRANSFORMATION.getExtension() ) ) {\n      return RepositoryObjectType.TRANSFORMATION;\n    } else if ( filename.endsWith( RepositoryObjectType.JOB.getExtension() ) ) {\n      return RepositoryObjectType.JOB;\n    } else if ( filename.endsWith( RepositoryObjectType.DATABASE.getExtension() ) ) {\n      return RepositoryObjectType.DATABASE;\n    } else if ( filename.endsWith( RepositoryObjectType.SLAVE_SERVER.getExtension() ) ) {\n      return RepositoryObjectType.SLAVE_SERVER;\n    } else if ( filename.endsWith( RepositoryObjectType.CLUSTER_SCHEMA.getExtension() ) ) {\n      return RepositoryObjectType.CLUSTER_SCHEMA;\n    } else if ( filename.endsWith( RepositoryObjectType.PARTITION_SCHEMA.getExtension() ) ) {\n      return RepositoryObjectType.PARTITION_SCHEMA;","sourceCodeStart":1787,"sourceCodeEnd":1823,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L1787-L1823","documentation":"PurRepository.getObjects(dirId, objectType...) builds RepositoryObject lists for a directory and wraps any exception in this KettleException including the directory id. Failures come from the pur getChildren/versioning/lock calls during object assembly.","triggerScenarios":"Calling getObjects(dirId, includeDeleted, objectType) when the directory lookup fails, files were deleted mid-iteration, version summary retrieval throws, or the repository connection is broken.","commonSituations":"Referencing a directory id from a previous repository connection; concurrent deletion by another user; Pentaho server version mismatch breaking pur API calls; permission problems on the folder.","solutions":["Inspect e.getCause() for the underlying pur failure (likely connection or missing folder).","Re-resolve the directory by path (findDirectory) instead of reusing a cached id.","Reconnect to the repository and retry.","Check server/client plugin version compatibility and folder read permissions."],"exampleFix":"// before\nList<RepositoryObject> objs = repo.getObjects(staleDirId, false, type);\n// after\nRepositoryDirectory dir = repo.findDirectory(\"/public\");\nList<RepositoryObject> objs = dir != null\n    ? repo.getObjects(dir.getObjectId(), false, type)\n    : Collections.emptyList();","handlingStrategy":"try-catch","validationCode":"RepositoryDirectory dir = repo.findDirectory(path);\nif (dir == null) throw new IllegalArgumentException(\"directory missing: \" + path);","typeGuard":"boolean listable(PurRepository repo, ObjectId dirId) { try { return dirId != null && repo.getDirectory(dirId) != null; } catch (Exception e) { return false; } }","tryCatchPattern":"try { return repo.getObjects(dirId, false, type); } catch (KettleException e) { log.error(\"dir \" + dirId + \" cause: \", e.getCause()); return Collections.emptyList(); }","preventionTips":["Refresh directory ids before each listing","Avoid sharing ids across repository instances","Check client/server plugin version compatibility"],"tags":["kettle","repository","pur","metadata-listing"],"backgroundTag":"api-request-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"}