BloopAI/vibe-kanban · error
Failed to cleanly kill running execution processes
Error message
Failed to cleanly kill running execution processes
What it means
perform_cleanup_actions asks the deployment container to kill all running execution processes. If kill_all_running_processes() returns Err (a process could not be terminated, the container runtime is unresponsive, or the internal command channel failed), the .expect panics with this message during cleanup.
Source
Thrown at crates/server/src/main.rs:241
tokio::select! {
_ = ctrl_c => {},
_ = terminate => {},
}
}
#[cfg(not(unix))]
{
// Only ctrl_c is available, so just await it
ctrl_c.await;
}
}
pub async fn perform_cleanup_actions(deployment: &DeploymentImpl) {
deployment
.container()
.kill_all_running_processes()
.await
.expect("Failed to cleanly kill running execution processes");
}
View on GitHub (pinned to 4deb7eca8f)
Solutions
- Identify which process failed to die (process list / container logs) and kill it manually (kill -9, docker kill).
- Restart the container runtime if the daemon is unresponsive, then retry shutdown.
- Check for D-state processes blocked on I/O — they cannot die until the underlying I/O resolves.
- Treat cleanup failures as non-fatal: log instead of expect, so remaining cleanup steps still run.
- Ensure executors handle termination signals and exit cleanly on the first kill attempt.
Example fix
// before
deployment.container().kill_all_running_processes().await
.expect("Failed to cleanly kill running execution processes");
// after
if let Err(e) = deployment.container().kill_all_running_processes().await {
tracing::error!("Failed to cleanly kill running execution processes: {e}");
} Defensive patterns
Strategy: try-catch
Try / catch
match deployment.container().kill_all_running_processes().await {
Ok(()) => tracing::info!("all execution processes killed"),
Err(e) => tracing::error!("cleanup: failed to kill running processes: {e}")
} Prevention
- Never .expect()/panic inside shutdown/cleanup paths; log and continue so remaining cleanup runs.
- Ensure executor processes install signal handlers and exit promptly on termination signals.
- Monitor for hung/zombie child processes and enforce kill timeouts with SIGKILL escalation.
- Keep the container runtime healthy and verify daemon availability before teardown.
- Avoid shutting down while long uninterruptible I/O operations are in flight.
When it happens
Trigger: One or more executor processes ignore termination signals or are in uninterruptible (D) state; the container runtime daemon is stopped or wedged; the async kill fails on the container's command channel (closed pipe, dead runtime); process handles were already reaped/invalidated.
Common situations: Ctrl-C shutdown while an exec task hangs; Docker/containerd daemon restart mid-session; unkillable child processes blocked on dead I/O after an OOM; Windows kill-semantics differences.
Related errors
- Failed to cleanly kill running execution processes
- {msg}
- Container ref not found for workspace
- Container reference not found
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/872cb4a9119d273a.
Report an issue: GitHub.