{"record":{"id":"641177948e4fca81","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-all-partition-schema-names","errorCode":null,"errorMessage":"Unable to get all partition schema names","messagePattern":"Unable to get all partition schema names","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":1617,"sourceCode":"        ids.add( new StringObjectId( file.getId().toString() ) );\n      }\n      return ids.toArray( new ObjectId[ 0 ] );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to get all partition schema IDs\", e );\n    }\n  }\n\n  @Override\n  public String[] getPartitionSchemaNames( boolean includeDeleted ) throws KettleException {\n    try {\n      List<RepositoryFile> children = getAllFilesOfType( null, RepositoryObjectType.PARTITION_SCHEMA, 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 partition schema names\", e );\n    }\n  }\n\n  @Override\n  public RepositoryMeta getRepositoryMeta() {\n    return repositoryMeta;\n  }\n\n  @Override\n  public RepositorySecurityProvider getSecurityProvider() {\n    return securityProvider;\n  }\n\n  @Override\n  public RepositorySecurityManager getSecurityManager() {\n    return securityManager;\n  }\n","sourceCodeStart":1599,"sourceCodeEnd":1635,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L1599-L1635","documentation":"PurRepository.getPartitionSchemaNames() lists partition-schema files in the Pentaho Enterprise Repository and wraps any failure (children lookup, title read) in this KettleException. It is a wrapper over the underlying pur/JCR service exception, so the real cause is always in the attached cause.","triggerScenarios":"Calling getPartitionSchemaNames(idDirectory, includeDeleted) when the repository connection is down, the directory object id is invalid, or the underlying getChildren(fileId, includeDeleted) pur call throws.","commonSituations":"Stale repository session after server restart or timeout; listing a directory that was deleted by another user; network failure to the Pentaho server; insufficient permissions on the folder holding partition schemas.","solutions":["Log/print e.getCause() to find the real failure (connection, permission, or missing folder).","Reconnect/re-authenticate to the repository (repository.connect) and retry the listing.","Verify the directory id exists via getDirectory(idDirectory) before listing.","Check Pentaho server availability and user permissions for the folder."],"exampleFix":"// before\nString[] names = repo.getPartitionSchemaNames(dirId, false);\n// after\ntry {\n  String[] names = repo.getPartitionSchemaNames(dirId, false);\n} catch (KettleException e) {\n  log.error(\"partition schema listing failed: \" + e.getCause(), e);\n  repo.disconnect(); repo.connect(user, pass); // reconnect then retry\n}","handlingStrategy":"try-catch","validationCode":"if (repo == null || !repo.isConnected()) throw new IllegalStateException(\"connect to repository first\");\nif (dirId == null) throw new IllegalArgumentException(\"dirId required\");","typeGuard":"boolean usable(Repository repo) { try { return repo != null && repo.isConnected(); } catch (Throwable t) { return false; } }","tryCatchPattern":"try { return repo.getPartitionSchemaNames(dirId, false); } catch (KettleException e) { log.error(\"cause: \", e.getCause()); return new String[0]; }","preventionTips":["Always connect before repository calls","Log getCause(), not just the wrapper message","Re-resolve directory ids by path instead of caching them"],"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"}