{"record":{"id":"220fce01af5c1586","repo":"apache/dolphinscheduler","slug":"workergroupnotfoundexception-workergroup","errorCode":null,"errorMessage":"WorkerGroupNotFoundException(workerGroup)","messagePattern":"WorkerGroupNotFoundException\\(workerGroup\\)","errorType":"exception","errorClass":"WorkerGroupNotFoundException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/client/PhysicalTaskExecutorClientDelegator.java","lineNumber":72,"sourceCode":"\n    @Autowired\n    private MasterConfig masterConfig;\n\n    @Autowired\n    private IWorkerLoadBalancer workerLoadBalancer;\n\n    @Autowired\n    private ClusterManager clusterManager;\n\n    @Override\n    public void dispatch(final ITaskExecution taskExecution) throws TaskDispatchException {\n        final TaskExecutionContext taskExecutionContext = taskExecution.getTaskExecutionContext();\n        final String taskName = taskExecutionContext.getTaskName();\n        final String workerGroup = taskExecutionContext.getWorkerGroup();\n\n        // workerGroup not exist\n        if (!clusterManager.getWorkerClusters().containsWorkerGroup(workerGroup)) {\n            throw new WorkerGroupNotFoundException(workerGroup);\n        }\n\n        // select an available worker from the worker group; throws NoAvailableWorkerException if none is available.\n        final String physicalTaskExecutorAddress = workerLoadBalancer\n                .select(workerGroup)\n                .map(Host::of)\n                .map(Host::getAddress)\n                .orElseThrow(() -> new NoAvailableWorkerException(workerGroup));\n\n        taskExecutionContext.setHost(physicalTaskExecutorAddress);\n        taskExecution.getTaskInstance().setHost(physicalTaskExecutorAddress);\n\n        try {\n            final TaskExecutorDispatchResponse taskExecutorDispatchResponse = Clients\n                    .withService(IPhysicalTaskExecutorOperator.class)\n                    .withHost(physicalTaskExecutorAddress)\n                    .dispatchTask(TaskExecutorDispatchRequest.of(taskExecution.getTaskExecutionContext()));\n            if (!taskExecutorDispatchResponse.isDispatchSuccess()) {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/client/PhysicalTaskExecutorClientDelegator.java#L54-L90","documentation":"The master could not find the worker group named in the task's context among the worker clusters currently known from the registry, so PhysicalTaskExecutorClientDelegator.dispatch throws WorkerGroupNotFoundException before any worker is selected. This is a configuration/discovery mismatch: the task references a group that has no registered workers.","triggerScenarios":"clusterManager.getWorkerClusters().containsWorkerGroup(workerGroup) returns false during dispatch — the taskExecutionContext.getWorkerGroup() value does not match any worker group registered in the registry.","commonSituations":"Typo or renamed worker group in the task/workflow definition; worker group defined only in the UI tenant/env config but no worker ever configured with that group; workers down or not yet registered so the group vanished from the registry; environment moved from dev to prod with different group names.","solutions":["Correct the task's worker group name in the workflow definition to match a group that actually has registered workers","Verify workers belonging to that group are up and registered in the registry (check worker config: worker.group) and wait for registration before running","Check ClusterManager/registry state (UI -> service management) to list existing worker groups and pick a valid one","If the group is intentional, deploy/configure at least one worker with that group name"],"exampleFix":"// before (task definition yaml)\nworkerGroup: prod_gpu_pool   // no such group registered\n// after\nworkerGroup: default         // or a group with live workers","handlingStrategy":"validation","validationCode":"// before running the workflow\nString workerGroup = taskExecutionContext.getWorkerGroup();\nif (!clusterManager.getWorkerClusters().containsWorkerGroup(workerGroup)) {\n    throw new WorkerGroupNotFoundException(workerGroup);\n}","typeGuard":null,"tryCatchPattern":"try {\n    taskExecutorClient.dispatch(taskExecution);\n} catch (WorkerGroupNotFoundException e) {\n    log.error(\"Worker group '{}' does not exist; fix the task definition or register workers\", e.getWorkerGroup());\n}","preventionTips":["Always verify the worker group name in task definitions matches a registered group (UI service management)","Keep at least one worker per configured group; monitor registry ephemeral nodes","Use consistent group naming across environments (dev/prod)","Re-check group existence after worker upgrades or cluster migrations"],"tags":["worker-group","config","registry","task-dispatch"],"backgroundTag":"resource-not-found","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"}