pentaho/pentaho-kettle · error · KettleException

ClusterSchema.NoSlaveServerDefined

Error message

ClusterSchema.NoSlaveServerDefined

What it means

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.

Solutions

  1. Add at least one slave server (with one marked master) to the cluster schema
  2. Verify the transformation references the intended cluster schema
  3. Check that the schema's slaves were actually saved in the repository before running clustered

Example fix

// before: empty schema used for clustering
ClusterSchema schema = new ClusterSchema();
transMeta.setClusterSchemas(Arrays.asList(schema));
// after: populate schema before use
schema.setSlaveServers(Arrays.asList(master, slave1));
master.setMaster(true);
transMeta.setClusterSchemas(Arrays.asList(schema));
Defensive patterns

Strategy: validation

Validate before calling

// Before clustering, verify slaves exist
if (clusterSchema.getSlaveServers() == null || clusterSchema.getSlaveServers().isEmpty()) {
  throw new KettleException("Cluster schema '" + clusterSchema.getName() + "' has no slaves"); }

Type guard

boolean hasSlaves(ClusterSchema s) { return s != null && s.getSlaveServers() != null && !s.getSlaveServers().isEmpty(); }

Try / catch

try { SlaveServer master = clusterSchema.findMaster(); }
catch (KettleException e) { throw new IllegalStateException("Cluster schema empty — add slaves and a master", e); }

Prevention

When it happens

Trigger: 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.

Common situations: Cluster schema created but no slave servers added; wrong cluster schema attached to the transformation; schema fields not saved in the repository metadata.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/1330b67ff4be6c8e. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/cluster/ClusterSchema.java:282

  /**
   * @param basePort
   *          the basePort to set
   */
  public void setBasePort( String basePort ) {
    this.basePort = basePort;
  }

  public SlaveServer findMaster() throws KettleException {
    for ( int i = 0; i < slaveServers.size(); i++ ) {
      SlaveServer slaveServer = slaveServers.get( i );
      if ( slaveServer.isMaster() ) {
        return slaveServer;
      }
    }
    if ( slaveServers.size() > 0 ) {
      throw new KettleException( BaseMessages.getString( PKG, "ClusterSchema.NoMasterServerDefined", name ) );
    }
    throw new KettleException( BaseMessages.getString( PKG, "ClusterSchema.NoSlaveServerDefined", name ) );
  }

  /**
   * @return The number of slave servers, excluding the master server
   */
  public int findNrSlaves() {
    int nr = 0;
    for ( int i = 0; i < slaveServers.size(); i++ ) {
      SlaveServer slaveServer = slaveServers.get( i );
      if ( !slaveServer.isMaster() ) {
        nr++;
      }
    }
    return nr;
  }

  /**
   * @return the socketFlushInterval

View on GitHub (pinned to f3058517a1)