{"record":{"id":"352cfc044e885640","repo":"apache/dolphinscheduler","slug":"pause-subworkflow-name-failed","errorCode":null,"errorMessage":"Pause SubWorkflow: ${name} failed","messagePattern":"Pause SubWorkflow: (.+?) failed","errorType":"exception","errorClass":"MasterTaskExecuteException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/subworkflow/SubWorkflowControlClient.java","lineNumber":87,"sourceCode":"    public WorkflowInstanceRecoverSuspendTasksResponse triggerFromSuspendTasks(\n                                                                               final WorkflowInstanceRecoverSuspendTasksRequest recoverSuspendTasksRequest) {\n        return workflowInstanceRecoverSuspendTaskTrigger.triggerWorkflow(recoverSuspendTasksRequest);\n    }\n\n    public WorkflowInstancePauseResponse pauseWorkflowInstance(\n                                                               final WorkflowInstancePauseRequest workflowInstancePauseRequest) throws MasterTaskExecuteException {\n        final Integer subWorkflowInstanceId = workflowInstancePauseRequest.getWorkflowInstanceId();\n        final WorkflowInstance subWorkflowInstance = workflowInstanceDao.queryById(subWorkflowInstanceId);\n        if (subWorkflowInstance.getState() != WorkflowExecutionStatus.RUNNING_EXECUTION) {\n            return WorkflowInstancePauseResponse.fail(\"SubWorkflow instance is not running, cannot pause\");\n        }\n        try {\n            return Clients\n                    .withService(IWorkflowControlClient.class)\n                    .withHost(subWorkflowInstance.getHost())\n                    .pauseWorkflowInstance(new WorkflowInstancePauseRequest(subWorkflowInstanceId));\n        } catch (Exception e) {\n            throw new MasterTaskExecuteException(\"Pause SubWorkflow: \" + subWorkflowInstance.getName() + \" failed\", e);\n        }\n    }\n\n    public WorkflowInstanceStopResponse stopWorkflowInstance(\n                                                             final WorkflowInstanceStopRequest workflowInstanceStopRequest) throws MasterTaskExecuteException {\n        final Integer subWorkflowInstanceId = workflowInstanceStopRequest.getWorkflowInstanceId();\n        final WorkflowInstance subWorkflowInstance = workflowInstanceDao.queryById(subWorkflowInstanceId);\n        if (subWorkflowInstance.getState() != WorkflowExecutionStatus.RUNNING_EXECUTION) {\n            return WorkflowInstanceStopResponse.fail(\"SubWorkflow instance is not running, cannot stop\");\n        }\n        try {\n            return Clients\n                    .withService(IWorkflowControlClient.class)\n                    .withHost(subWorkflowInstance.getHost())\n                    .stopWorkflowInstance(new WorkflowInstanceStopRequest(subWorkflowInstance.getId()));\n        } catch (Exception e) {\n            throw new MasterTaskExecuteException(\"Kill SubWorkflow: \" + subWorkflowInstance.getName() + \" failed\", e);\n        }","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/subworkflow/SubWorkflowControlClient.java#L69-L105","documentation":"SubWorkflowControlClient.pauseWorkflowInstance calls the sub-workflow's host master via IWorkflowControlClient; any exception during the remote pause (network failure, host down, instance not found, RPC error) is wrapped in a MasterTaskExecuteException with this message.","triggerScenarios":"The sub-workflow's host master is unreachable/crashed, the sub workflow instance already finished (cannot be paused), or the RPC request times out or returns an error.","commonSituations":"Master failover while a sub-workflow task is running, network partitions between masters, or users killing the sub-workflow in the UI while the parent tries to pause it.","solutions":["Check the wrapped cause (e) for the root RPC/network error and verify the sub-workflow host is up","Confirm the sub workflow instance state in the UI/DB — finished instances cannot be paused","Retry the pause of the parent workflow; if failover happened, let the new master resume"],"exampleFix":"// before\nthrow new MasterTaskExecuteException(\"Pause SubWorkflow: \" + name + \" failed\", e);\n// after (operational fix): ensure master registry/network is healthy, then retry pause via the UI","handlingStrategy":"retry","validationCode":"// pre-check sub workflow state and host reachability before pause\nif (!isHostReachable(subWorkflowInstance.getHost())) {\n    throw new MasterTaskExecuteException(\"Sub workflow host unreachable: \" + subWorkflowInstance.getHost());\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.pauseWorkflowInstance(request);\n} catch (MasterTaskExecuteException e) {\n    log.warn(\"Pause sub workflow failed, will retry\", e);\n    retryWithBackoff(3, () -> client.pauseWorkflowInstance(request));\n}","preventionTips":["Monitor master-to-master network connectivity","Verify sub workflow instance is in RUNNING state before pause","Keep host addresses in t_ds_workflow_instance accurate after failover"],"tags":["subworkflow","rpc","network"],"backgroundTag":"http-request-failed","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"}