{"record":{"id":"23915153861c8789","repo":"apache/dolphinscheduler","slug":"workflowinstance-s-pause-failed-s","errorCode":null,"errorMessage":"WorkflowInstance: %s pause failed: %s","messagePattern":"WorkflowInstance: (.+?) pause failed: (.+?)","errorType":"exception","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/PauseWorkflowInstanceExecutorDelegate.java","lineNumber":100,"sourceCode":"            return null;\n        });\n        log.info(\"Update workflow instance {} state from: {} to {} success\",\n                workflowInstance.getName(),\n                workflowInstance.getState().name(),\n                WorkflowExecutionStatus.PAUSE.name());\n    }\n\n    private void pauseInMaster(WorkflowInstance workflowInstance) {\n        try {\n            final WorkflowInstancePauseResponse pauseResponse = Clients\n                    .withService(IWorkflowControlClient.class)\n                    .withHost(workflowInstance.getHost())\n                    .pauseWorkflowInstance(new WorkflowInstancePauseRequest(workflowInstance.getId()));\n\n            if (pauseResponse != null && pauseResponse.isSuccess()) {\n                log.info(\"WorkflowInstance: {} pause success\", workflowInstance.getName());\n            } else {\n                throw new ServiceException(\n                        \"WorkflowInstance: \" + workflowInstance.getName() + \" pause failed: \" + pauseResponse);\n            }\n        } catch (ServiceException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new ServiceException(\n                    String.format(\"WorkflowInstance: %s pause failed\", workflowInstance.getName()), e);\n        }\n    }\n\n    public static class PauseWorkflowInstanceOperation {\n\n        private final PauseWorkflowInstanceExecutorDelegate pauseWorkflowInstanceExecutorDelegate;\n\n        private WorkflowInstance workflowInstance;\n\n        private User executeUser;\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/PauseWorkflowInstanceExecutorDelegate.java#L82-L118","documentation":"Thrown when the master, contacted at the instance's host, responds to a WorkflowInstancePauseRequest with either null or a non-success response. The pause command reached the master but the master could not pause the running instance.","triggerScenarios":"pauseInMaster sends the pause request via IWorkflowControlClient to workflowInstance.getHost(); the master returns success=false (e.g. instance not found on that master, task cannot be interrupted, DB update failed) or the response is null.","commonSituations":"Instance host is stale after master failover (instance belongs to a dead master); workflow in a state where the master cannot interrupt tasks; master-side exceptions during pause; network/RPC issues swallowed by the outer catch and rethrown here when pauseResponse is null.","solutions":["Read pauseResponse in the exception message for the master's failure detail and check master logs","Verify the instance's host is still the active master; if a failover occurred, wait for failover or restart the workflow instance","Retry the pause once the master is healthy and the instance is in a pausable state","Check RPC connectivity between API server and the master host/port"],"exampleFix":"// before: pausing via stale host after master restart\napi.pauseWorkflowInstance(instanceId);\n// after: refresh instance state/host first, then pause\nWorkflowInstance wf = api.queryWorkflowInstance(instanceId);\nif (wf.getState().isCanPause() && hostIsAlive(wf.getHost())) {\n    api.pauseWorkflowInstance(instanceId);\n}","handlingStrategy":"try-catch","validationCode":"// confirm instance host is an alive master before pausing\nboolean hostAlive = registryClient.getServerList(RegistryNodeType.MASTER).stream()\n    .anyMatch(s -> (s.getHost() + \":\" + s.getPort()).equals(instance.getHost()));","typeGuard":null,"tryCatchPattern":"try { delegate.pause(op); } catch (ServiceException e) { log.error(\"Pause failed: {}\", e.getMessage()); if (instanceStateRefreshedStillPausable(instance)) retryWithBackoff(op); }","preventionTips":["Verify instance host liveness after master failover before control operations","Retry pause with backoff on transient master errors","Monitor master failover events that orphan instance hosts","Check master logs for the pause rejection reason"],"tags":["dolphinscheduler","master-rpc","pause","rpc-failure"],"backgroundTag":"api-error-response","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"}