From 4a499cf5fc2940db185eb1728b591614b742017d Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 10 Mar 2025 11:03:22 +0100 Subject: [PATCH] clarify state transition error --- backend/src/monitor.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/backend/src/monitor.rs b/backend/src/monitor.rs index 69bca4c195..1083840008 100644 --- a/backend/src/monitor.rs +++ b/backend/src/monitor.rs @@ -1917,16 +1917,27 @@ async fn handle_zombie_flows(db: &DB) -> error::Result<()> { let id = flow.id.clone(); let last_ping = flow.last_ping.clone(); let now = now_from_db(db).await?; + let base_url = BASE_URL.read().await; + let workspace_id = flow.workspace_id.clone(); let reason = format!( "{} was hanging in between 2 steps. Last ping: {last_ping:?} (now: {now})", if flow.is_flow_step.unwrap_or(false) && flow.parent_job.is_some() { - format!("Flow was cancelled because subflow {id}") + format!("Flow was cancelled because subflow {id} ({base_url}/run/{id}?workspace={workspace_id})") } else { - format!("Flow {id} was cancelled because it") + format!("Flow {id} ({base_url}/run/{id}?workspace={workspace_id}) was cancelled because it") } ); report_critical_error(reason.clone(), db.clone(), Some(&flow.workspace_id), None).await; - cancel_zombie_flow_job(db, flow.id, &flow.workspace_id, reason).await?; + cancel_zombie_flow_job(db, flow.id, &flow.workspace_id, + format!(r#"{reason} +This would happen if a worker was interrupted, killed or crashed while doing a state transition at the end of a job which is always an unexpected behavior that should never happen. +Please check your worker logs for more details and feel free to report it to the Windmill team on our Discord or support@windmill.dev (response for non EE customers will be best effort) with as much context as possible, ideally: +- Windmill version +- Worker logs right after the job referenced has finished running +- Is the error consistent when running the same flow +- A minimal flow and its flow.yaml that reproduces the error and that is importable in a fresh workspace +- Your infra setup (helm, docker-compose, configuration of the workers and their number, memory of the database, etc.) +"#)).await?; } }