{"record":{"id":"69af705ce280a80e","repo":"apache/dolphinscheduler","slug":"repeat-running-workflow-instance-failed-s","errorCode":null,"errorMessage":"Repeat running workflow instance failed: %s","messagePattern":"Repeat running workflow instance failed: (.+?)","errorType":"exception","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/RepeatRunningWorkflowInstanceExecutorDelegate.java","lineNumber":65,"sourceCode":"                    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\n    public static class RepeatRunningWorkflowInstanceOperation {\n\n        private final RepeatRunningWorkflowInstanceExecutorDelegate repeatRunningWorkflowInstanceExecutorDelegate;\n\n        private WorkflowInstance workflowInstance;\n\n        private User executeUser;\n\n        public RepeatRunningWorkflowInstanceOperation(RepeatRunningWorkflowInstanceExecutorDelegate repeatRunningWorkflowInstanceExecutorDelegate) {\n            this.repeatRunningWorkflowInstanceExecutorDelegate = repeatRunningWorkflowInstanceExecutorDelegate;\n        }\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/RepeatRunningWorkflowInstanceExecutorDelegate.java#L47-L83","documentation":"Thrown by RepeatRunningWorkflowInstanceExecutorDelegate.execute when the master's repeatTriggerWorkflowInstance response reports success=false. The repeat-running request reached the master but the master refused or failed to re-trigger the finished workflow instance; the master's message is appended.","triggerScenarios":"Calling repeatTriggerWorkflowInstance on a finished instance where the master rejects the command — e.g. the workflow definition was disabled or deleted, the instance no longer exists, or master-side command creation fails.","commonSituations":"Rerunning an instance whose definition was deleted/renamed between runs; permission or project changes invalidating the definition; master failover mid-request; the instance was recovered by another user concurrently.","solutions":["Read the appended repeatRunningResponse.getMessage() for the master-side cause","Verify the workflow definition behind the instance still exists and is enabled (release state online)","Refresh and confirm the instance still exists and is in a final state, then retry","Check master server logs at request time for the detailed failure"],"exampleFix":"// before\nClients.withService(IWorkflowControlClient.class)...repeatTriggerWorkflowInstance(repeatRunningRequest);\n// after\n// pre-check definition is online\nWorkflowDefinition def = workflowDefinitionDao.findByCode(instance.getWorkflowDefinitionCode());\nif (def == null || def.getReleaseState() != ReleaseState.ONLINE) {\n    throw new ServiceException(\"Definition offline/deleted, cannot repeat run\");\n}","handlingStrategy":"try-catch","validationCode":"WorkflowDefinition def = workflowDefinitionDao.findByCode(instance.getWorkflowDefinitionCode());\nif (def == null || def.getReleaseState() != ReleaseState.ONLINE) {\n    throw new IllegalStateException(\"Definition missing/offline\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    delegate.execute(op);\n} catch (ServiceException e) {\n    log.error(\"Repeat running failed: {}\", e.getMessage(), e);\n    // inspect master-side message and master logs\n}","preventionTips":["Verify the definition exists and is online before rerun","Confirm instance still in final state before rerun","Log and surface the master response message","Check master logs when the message is generic"],"tags":["workflow","master-server","rerun"],"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"}