apache/seatunnel · error · SeaTunnelEngineException

Please don't get coordinator service from an inactive master

Error message

Please don't get coordinator service from an inactive master node

What it means

SeaTunnelServer.getCoordinatorService throws SeaTunnelEngineException ("Please don't get coordinator service from an inactive master node") when the node is the master but requests the coordinator service with an inactive coordinator and the pre-existing active check was bypassed — i.e. fetching the coordinator from a master node whose coordinator service is inactive. It signals calling the getter in a state where the coordinator cannot serve the request.

Source

Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java:316

                    Thread.sleep(retryPause);
                    retryCount++;
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            if (coordinatorService.isCoordinatorActive()) {
                return coordinatorService;
            }

            if (!isMasterNode()) {
                throw new SeaTunnelEngineException("This is not a master node now.");
            }
            // Return retryable exception to retry from the worker node, because the coordinator is
            // not ready yet. By this way, we can release the operation thread and retry later.
            throw new SeaTunnelEngineRetryableException(
                    "Can not get coordinator service from an active master node.");
        } else {
            throw new SeaTunnelEngineException(
                    "Please don't get coordinator service from an inactive master node");
        }
    }

    public RealtimeMetricsService getRealtimeMetricsService() {
        return realtimeMetricsService;
    }

    synchronized void startRealtimeMetricsService(CoordinatorService activeCoordinatorService) {
        if (realtimeMetricsService != null) {
            return;
        }
        realtimeMetricsService =
                new RealtimeMetricsService((NodeEngineImpl) nodeEngine, activeCoordinatorService);
        realtimeMetricsService.start();
    }

    synchronized void stopRealtimeMetricsService() {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check master logs for CoordinatorService initialization/deactivation errors; restart the node or cluster if the coordinator failed to activate.
  2. Retry the operation against the current master (resolve topology via Hazelcast) rather than a cached member reference.
  3. If triggered during shutdown, it's expected — stop issuing jobs/operations during node teardown.
Defensive patterns

Strategy: try-catch

Validate before calling

// only call when master and coordinator are active
if (seaTunnelServer.isMasterNode() && seaTunnelServer.getCoordinatorService().isCoordinatorActive()) { ... }

Try / catch

try {
    CoordinatorService cs = seaTunnelServer.getCoordinatorService();
} catch (SeaTunnelEngineException e) {
    if (e.getMessage().contains("inactive master node")) {
        log.warn("Coordinator inactive on master; skipping operation or re-resolving master");
    } else throw e;
}

Prevention

When it happens

Trigger: Calling getCoordinatorService on a master node after the coordinator service was deactivated (shutdown in progress, node demotion, initialization failure) rather than through the guarded active-coordinator path.

Common situations: Operations racing with cluster/node shutdown; coordinator activation failed on the master (check earlier logs for initialization errors); internal callers after membership change.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/2cf4158a92404c29. Report an issue: GitHub.