{"record":{"id":"e66637a9ff1267bf","repo":"apache/seatunnel","slug":"can-t-find-task-group-address-from-taskgrouplocati","errorCode":null,"errorMessage":"can't find task group address from taskGroupLocation: ${taskGroupLocation}","messagePattern":"can't find task group address from taskGroupLocation: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/master/JobMaster.java","lineNumber":1067,"sourceCode":"        jobHistoryService.storeFinishedJobState(this);\n    }\n\n    public Address queryTaskGroupAddress(TaskGroupLocation taskGroupLocation) {\n\n        PipelineLocation pipelineLocation =\n                new PipelineLocation(\n                        taskGroupLocation.getJobId(), taskGroupLocation.getPipelineId());\n\n        Map<TaskGroupLocation, SlotProfile> taskGroupLocationSlotProfileMap =\n                ownedSlotProfilesIMap.get(pipelineLocation);\n\n        if (null != taskGroupLocationSlotProfileMap) {\n            SlotProfile slotProfile = taskGroupLocationSlotProfileMap.get(taskGroupLocation);\n            if (null != slotProfile) {\n                return slotProfile.getWorker();\n            }\n        }\n        throw new IllegalArgumentException(\n                \"can't find task group address from taskGroupLocation: \" + taskGroupLocation);\n    }\n\n    public synchronized void cancelJob() {\n        physicalPlan.cancelJob();\n    }\n\n    public synchronized void stopJob() {\n        physicalPlan.stopJob();\n    }\n\n    public ResourceManager getResourceManager() {\n        return resourceManager;\n    }\n\n    public CheckpointManager getCheckpointManager() {\n        return checkpointManager;\n    }","sourceCodeStart":1049,"sourceCodeEnd":1085,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/master/JobMaster.java#L1049-L1085","documentation":"JobMaster exposes a lookup that maps a TaskGroupLocation to the worker Address running it, via the taskGroupLocation->SlotProfile map. If the map is absent or does not contain the requested task group location, IllegalArgumentException is thrown because the engine cannot determine which worker hosts that task group. Indicates the pipeline's owned slot profiles were not synced or the task group no longer exists.","triggerScenarios":"Calling JobMaster's task-group address lookup (e.g. during cancel/retry/metrics routing) with a TaskGroupLocation that has no entry in taskGroupLocationSlotProfileMap - e.g. after job state was not fully initialized, or querying a task group of a finished/failed pipeline.","commonSituations":"Race at job startup where slot profile sync (syncPipelineOwnedSlotProfiles) has not completed; asking about a task group after the job failed or was cancelled; jobId/pipelineId/taskGroupIndex typo when constructing TaskGroupLocation.","solutions":["Ensure the job is in a RUNNING state and slot profiles are synced before querying task group addresses.","Verify the TaskGroupLocation (jobId, pipelineId, taskGroupIndex) matches an existing task group.","Retry the lookup after a short delay if it happens transiently during job initialization.","Check JobMaster logs for prior 'Can not sync pipeline owned slot profiles with IMap' failures."],"exampleFix":"// before: immediate lookup after submit\nAddress addr = jobMaster.getTaskGroupAddress(taskGroupLocation);\n// after: guard on job state / retry\nif (jobMaster.getJobStatus(jobId) == RUNNING) {\n    Address addr = jobMaster.getTaskGroupAddress(taskGroupLocation);\n}","handlingStrategy":"retry","validationCode":"// before lookup\nif (jobMaster.getJobStatus(jobId) != JobStatus.RUNNING) {\n    throw new IllegalStateException(\"job not running; task group addresses not yet available\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return jobMaster.getTaskGroupAddress(taskGroupLocation);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"can't find task group address\")) {\n        Thread.sleep(retryMs);\n        return jobMaster.getTaskGroupAddress(taskGroupLocation);\n    }\n    throw e;\n}","preventionTips":["Only query task group addresses for RUNNING jobs.","Cache TaskGroupLocation values from engine events rather than constructing them manually.","Watch for prior slot-profile sync failures in JobMaster logs."],"tags":["jobmaster","task-scheduling","slot-profile","internal-state"],"backgroundTag":"record-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}