{"record":{"id":"c2d8106f9cb87cb2","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-all-slave-server-names","errorCode":null,"errorMessage":"Unable to get all slave server names","messagePattern":"Unable to get all slave server names","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":1665,"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 slave server IDs\", e );\n    }\n  }\n\n  @Override\n  public String[] getSlaveNames( boolean includeDeleted ) throws KettleException {\n    try {\n      List<RepositoryFile> children = getAllFilesOfType( null, RepositoryObjectType.SLAVE_SERVER, 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 slave server names\", e );\n    }\n  }\n\n  @Override\n  @SuppressWarnings( \"unchecked\" )\n  public List<SlaveServer> getSlaveServers() throws KettleException {\n    return (List<SlaveServer>) loadAndCacheSharedObjects( true ).get( RepositoryObjectType.SLAVE_SERVER );\n  }\n\n  @Override\n  @SuppressWarnings( \"unchecked\" )\n  public List<DatabaseMeta> getConnections( boolean cached ) throws KettleException {\n    return (List<DatabaseMeta>) getRepositoryObjects( RepositoryObjectType.DATABASE, cached );\n  }\n\n  @Override\n  @SuppressWarnings( \"unchecked\" )\n  public List<SlaveServer> getSlaveServers( boolean cached ) throws KettleException {","sourceCodeStart":1647,"sourceCodeEnd":1683,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L1647-L1683","documentation":"PurRepository.getSlaveNames() collects titles of slave-server files in a directory and wraps any exception from the listing in this KettleException. It is a generic wrapper; the actionable information is in the cause chain.","triggerScenarios":"Calling getSlaveNames(idDirectory, includeDeleted) when the underlying pur getChildren/file title access throws (bad directory id, connection loss, permission denial).","commonSituations":"Listing slaves from a stale or disconnected repository session; referencing a deleted directory; user lacks read rights on the folder; server-side repository error.","solutions":["Check e.getCause() for the underlying pur exception.","Reconnect to the repository and retry the listing.","Validate the directory id exists (getRepositoryDirectory) before listing.","Verify read permissions on the target folder for the repository user."],"exampleFix":"// before\nString[] names = repo.getSlaveNames(dirId, false);\n// after\ntry {\n  String[] names = repo.getSlaveNames(dirId, false);\n} catch (KettleException e) {\n  log.error(\"slave name listing failed: \" + e.getCause());\n  reconnectIfNeeded();\n}","handlingStrategy":"try-catch","validationCode":"if (repo == null || !repo.isConnected()) throw new IllegalStateException(\"repository not connected\");\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.getSlaveNames(dirId, false); } catch (KettleException e) { log.error(\"cause: \", e.getCause()); return new String[0]; }","preventionTips":["Keep sessions alive or reconnect on expiry","Log the cause chain for diagnosis","Validate directory existence before listing"],"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"}