apache/dolphinscheduler · error · ServiceException
The workflow instance: %s status is %s, cannot repeat runnin
Error message
The workflow instance: %s status is %s, cannot repeat running
What it means
Thrown by RepeatRunningWorkflowInstanceExecutorDelegate.execute when the target workflow instance is not in a final state (SUCCESS, FAILURE, STOP, etc.) or its state is null. Repeat-running is only allowed for finished instances, so the delegate rejects the request before contacting the master.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/workflow/RepeatRunningWorkflowInstanceExecutorDelegate.java:46
import org.apache.dolphinscheduler.registry.api.RegistryClient;
import org.apache.dolphinscheduler.registry.api.enums.RegistryNodeType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class RepeatRunningWorkflowInstanceExecutorDelegate
implements
IExecutorDelegate<RepeatRunningWorkflowInstanceExecutorDelegate.RepeatRunningWorkflowInstanceOperation, Void> {
@Autowired
private RegistryClient registryClient;
@Override
public Void execute(RepeatRunningWorkflowInstanceOperation workflowInstanceControlRequest) {
final WorkflowInstance workflowInstance = workflowInstanceControlRequest.workflowInstance;
if (workflowInstance.getState() == null || !workflowInstance.getState().isFinalState()) {
throw new ServiceException(
String.format("The workflow instance: %s status is %s, cannot repeat running",
workflowInstance.getName(), workflowInstance.getState()));
}
final Server masterServer = registryClient.getRandomServer(RegistryNodeType.MASTER).orElse(null);
if (masterServer == null) {
throw new ServiceException("no master server available");
}
final WorkflowInstanceRepeatRunningRequest repeatRunningRequest = WorkflowInstanceRepeatRunningRequest.builder()
.workflowInstanceId(workflowInstance.getId())
.userId(workflowInstanceControlRequest.executeUser.getId())
.build();
final WorkflowInstanceRepeatRunningResponse repeatRunningResponse = Clients
.withService(IWorkflowControlClient.class)
.withHost(masterServer.getHost() + ":" + masterServer.getPort())
.repeatTriggerWorkflowInstance(repeatRunningRequest);
if (!repeatRunningResponse.isSuccess()) {View on GitHub (pinned to 02eac45a1b)
Solutions
- Wait until the workflow instance reaches a final state (SUCCESS/FAILURE/STOP) then retry repeat-running
- Stop the running instance first, wait for it to reach a final state, then repeat-run it
- Refresh the instance status from the DB/UI to clear stale state assumptions
- If stuck non-final, manually correct the instance state in the DB (t_master_command cleanup) and restart as needed
Example fix
// before
repeatRunning(instance);
// after
if (instance.getState() == null || !instance.getState().isFinalState()) {
throw new ServiceException("Wait for final state before repeat running: " + instance.getName());
}
repeatRunning(instance); Defensive patterns
Strategy: validation
Validate before calling
WorkflowExecutionStatus st = instance.getState();
if (st == null || !st.isFinalState()) {
throw new IllegalStateException("Cannot repeat-run instance in state " + st);
} Try / catch
try {
delegate.execute(op);
} catch (ServiceException e) {
log.warn("Repeat running rejected: {}", e.getMessage());
// re-fetch instance state and inform user to wait for final state
} Prevention
- Check isFinalState() before requesting repeat-run
- Refresh UI state before rerun actions
- Handle already-running instances by stopping first
- Guard against stale cached instance status
When it happens
Trigger: Calling repeat-running on an instance whose WorkflowExecutionStatus is not isFinalState() — e.g. the instance is RUNNING, READY_PAUSE, READY_STOP, or has a null state.
Common situations: Double-clicking 'rerun' in the UI while the instance is still executing; trying to rerun an instance that is currently being stopped; stale list data showing an old status; an instance stuck in a non-final state after a master crash.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Repeat running workflow instance failed: %s
- The workflow instance: %s status is %s, can not stop
- Recover workflow instance failed: %s
- WorkflowInstance: %s stop failed: %s
- WorkflowInstance: %s stop failed
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/d68d3534e170ed3d.
Report an issue: GitHub.