{"record":{"id":"c140a44b81f2ebc7","repo":"apache/dolphinscheduler","slug":"no-master-server-available-c140a4","errorCode":null,"errorMessage":"no master server available","messagePattern":"no master server available","errorType":"exception","errorClass":"ServiceException","httpStatus":null,"severity":"critical","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/RepeatRunningWorkflowInstanceExecutorDelegate.java","lineNumber":53,"sourceCode":"public class RepeatRunningWorkflowInstanceExecutorDelegate\n        implements\n            IExecutorDelegate<RepeatRunningWorkflowInstanceExecutorDelegate.RepeatRunningWorkflowInstanceOperation, Void> {\n\n    @Autowired\n    private RegistryClient registryClient;\n\n    @Override\n    public Void execute(RepeatRunningWorkflowInstanceOperation workflowInstanceControlRequest) {\n        final WorkflowInstance workflowInstance = workflowInstanceControlRequest.workflowInstance;\n        if (workflowInstance.getState() == null || !workflowInstance.getState().isFinalState()) {\n            throw new ServiceException(\n                    String.format(\"The workflow instance: %s status is %s, cannot repeat running\",\n                            workflowInstance.getName(), workflowInstance.getState()));\n        }\n\n        final Server masterServer = registryClient.getRandomServer(RegistryNodeType.MASTER).orElse(null);\n        if (masterServer == null) {\n            throw new ServiceException(\"no master server available\");\n        }\n        final WorkflowInstanceRepeatRunningRequest repeatRunningRequest = WorkflowInstanceRepeatRunningRequest.builder()\n                .workflowInstanceId(workflowInstance.getId())\n                .userId(workflowInstanceControlRequest.executeUser.getId())\n                .build();\n\n        final WorkflowInstanceRepeatRunningResponse repeatRunningResponse = Clients\n                .withService(IWorkflowControlClient.class)\n                .withHost(masterServer.getHost() + \":\" + masterServer.getPort())\n                .repeatTriggerWorkflowInstance(repeatRunningRequest);\n        if (!repeatRunningResponse.isSuccess()) {\n            throw new ServiceException(\n                    \"Repeat running workflow instance failed: \" + repeatRunningResponse.getMessage());\n        }\n\n        return null;\n    }\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/RepeatRunningWorkflowInstanceExecutorDelegate.java#L35-L71","documentation":"Thrown by RepeatRunningWorkflowInstanceExecutorDelegate.execute when the registry returns no available master server. The API module needs a live master to send the WorkflowInstanceRepeatRunningRequest to, and without one the repeat-running operation cannot be dispatched.","triggerScenarios":"registryClient.getRandomServer(RegistryNodeType.MASTER) returns empty — no master is registered in ZooKeeper/registry, e.g. no masters started or all masters lost registration.","commonSituations":"Master service not started before using the API; all masters crashed or were killed; network/registry (ZooKeeper) connectivity problems so masters are unregistered; cluster misconfiguration where the API server points at a different registry namespace than the masters.","solutions":["Start at least one DolphinScheduler master server and verify it registers in the registry","Check registry (ZooKeeper) connectivity from both master and API servers","Verify masters and API use the same registry namespace/cluster name","Check master logs for startup/registration failures and fix them"],"exampleFix":"// before\nServer masterServer = registryClient.getRandomServer(RegistryNodeType.MASTER).orElse(null);\nif (masterServer == null) { throw new ServiceException(\"no master server available\"); }\n// after\n// operational fix: ensure master is up\n// bin/start.sh -m master-server; verify via zkCli ls /dolphinscheduler/nodes/master","handlingStrategy":"retry","validationCode":"List<Server> masters = registryClient.getServerList(RegistryNodeType.MASTER);\nif (masters.isEmpty()) { throw new IllegalStateException(\"No masters registered; start master server\"); }","typeGuard":null,"tryCatchPattern":"try {\n    delegate.execute(op);\n} catch (ServiceException e) {\n    if (\"no master server available\".equals(e.getMessage())) {\n        // alert ops, retry with backoff after masters register\n        retryWithBackoff(op, 3);\n    }\n}","preventionTips":["Monitor master registration in ZooKeeper and alert when zero masters","Health-check master tier before exposing workflow APIs","Keep API and masters on the same registry namespace","Add retry/backoff for transient master unavailability"],"tags":["master-server","registry","availability"],"backgroundTag":"connection-refused","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}