{"record":{"id":"1330b67ff4be6c8e","repo":"pentaho/pentaho-kettle","slug":"clusterschema-noslaveserverdefined","errorCode":null,"errorMessage":"ClusterSchema.NoSlaveServerDefined","messagePattern":"ClusterSchema\\.NoSlaveServerDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/cluster/ClusterSchema.java","lineNumber":282,"sourceCode":"  /**\n   * @param basePort\n   *          the basePort to set\n   */\n  public void setBasePort( String basePort ) {\n    this.basePort = basePort;\n  }\n\n  public SlaveServer findMaster() throws KettleException {\n    for ( int i = 0; i < slaveServers.size(); i++ ) {\n      SlaveServer slaveServer = slaveServers.get( i );\n      if ( slaveServer.isMaster() ) {\n        return slaveServer;\n      }\n    }\n    if ( slaveServers.size() > 0 ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"ClusterSchema.NoMasterServerDefined\", name ) );\n    }\n    throw new KettleException( BaseMessages.getString( PKG, \"ClusterSchema.NoSlaveServerDefined\", name ) );\n  }\n\n  /**\n   * @return The number of slave servers, excluding the master server\n   */\n  public int findNrSlaves() {\n    int nr = 0;\n    for ( int i = 0; i < slaveServers.size(); i++ ) {\n      SlaveServer slaveServer = slaveServers.get( i );\n      if ( !slaveServer.isMaster() ) {\n        nr++;\n      }\n    }\n    return nr;\n  }\n\n  /**\n   * @return the socketFlushInterval","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/cluster/ClusterSchema.java#L264-L300","documentation":"Thrown by ClusterSchema.findMaster when the cluster schema has no slave servers at all (slaveServers is empty). Since even a master is registered as a slave-server entry, an empty list means the cluster is not configured.","triggerScenarios":"findMaster is called on a ClusterSchema whose slaveServers list is empty — e.g. a transformation partitioned onto a cluster schema that was never populated with slave servers.","commonSituations":"Cluster schema created but no slave servers added; wrong cluster schema attached to the transformation; schema fields not saved in the repository metadata.","solutions":["Add at least one slave server (with one marked master) to the cluster schema","Verify the transformation references the intended cluster schema","Check that the schema's slaves were actually saved in the repository before running clustered"],"exampleFix":"// before: empty schema used for clustering\nClusterSchema schema = new ClusterSchema();\ntransMeta.setClusterSchemas(Arrays.asList(schema));\n// after: populate schema before use\nschema.setSlaveServers(Arrays.asList(master, slave1));\nmaster.setMaster(true);\ntransMeta.setClusterSchemas(Arrays.asList(schema));","handlingStrategy":"validation","validationCode":"// Before clustering, verify slaves exist\nif (clusterSchema.getSlaveServers() == null || clusterSchema.getSlaveServers().isEmpty()) {\n  throw new KettleException(\"Cluster schema '\" + clusterSchema.getName() + \"' has no slaves\"); }","typeGuard":"boolean hasSlaves(ClusterSchema s) { return s != null && s.getSlaveServers() != null && !s.getSlaveServers().isEmpty(); }","tryCatchPattern":"try { SlaveServer master = clusterSchema.findMaster(); }\ncatch (KettleException e) { throw new IllegalStateException(\"Cluster schema empty — add slaves and a master\", e); }","preventionTips":["Populate the cluster schema with slaves before attaching it to a transformation","Confirm schema persistence in the repository (slaves saved)","Double-check the transformation references the intended cluster schema"],"tags":["clustering","configuration","kettle"],"backgroundTag":"missing-required-config-field","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"}