BloopAI/vibe-kanban · warning
Cannot run script while another process is running
Error message
Cannot run script while another process is running
What it means
Thrown by the RunSetupScript action when the backend reports error.type === 'process_already_running', meaning another execution process (a previous script run or a running attempt) is currently active on the workspace and the executor refuses to start a second one concurrently.
Source
Thrown at packages/web-core/src/shared/actions/index.ts:1170
},
// === Script Actions ===
RunSetupScript: {
id: 'run-setup-script',
label: 'Run Setup Script',
icon: TerminalIcon,
shortcut: 'R S',
requiresTarget: ActionTargetType.WORKSPACE,
isVisible: (ctx) => ctx.hasWorkspace,
isEnabled: (ctx) => !ctx.isAttemptRunning,
execute: async (_ctx, workspaceId) => {
const result = await workspacesApi.runSetupScript(workspaceId);
if (!result.success) {
if (result.error?.type === 'no_script_configured') {
throw new Error('No setup script configured for this project');
}
if (result.error?.type === 'process_already_running') {
throw new Error('Cannot run script while another process is running');
}
throw new Error('Failed to run setup script');
}
},
},
RunCleanupScript: {
id: 'run-cleanup-script',
label: 'Run Cleanup Script',
icon: TerminalIcon,
shortcut: 'R C',
requiresTarget: ActionTargetType.WORKSPACE,
isVisible: (ctx) => ctx.hasWorkspace,
isEnabled: (ctx) => !ctx.isAttemptRunning,
execute: async (_ctx, workspaceId) => {
const result = await workspacesApi.runCleanupScript(workspaceId);
if (!result.success) {
if (result.error?.type === 'no_script_configured') {View on GitHub (pinned to 4deb7eca8f)
Solutions
- Wait for the current process to finish (the action already disables the button via !ctx.isAttemptRunning — ensure ctx is fresh).
- Stop/cancel the running attempt or script from the UI, then re-run the setup script.
- If the prior run crashed and the server state is stale, restart the backend or kill the orphaned process to clear the running state.
- Serialize user-triggered runs: keep the button disabled while a run is in flight instead of re-checking only on render.
Example fix
// before
isEnabled: (ctx) => !ctx.isAttemptRunning,
// after
let running = false;
execute: async (ctx, workspaceId) => {
if (running) return;
running = true;
try { await workspacesApi.runSetupScript(workspaceId); }
finally { running = false; }
} Defensive patterns
Strategy: retry
Validate before calling
// before running
if (isAttemptRunning || scriptInFlight) {
toast.info('Another process is running; wait for it to finish.');
return;
}
await workspacesApi.runSetupScript(workspaceId); Type guard
function isBusyError(result: RunScriptResult): boolean {
return result.success === false && result.error?.type === 'process_already_running';
} Try / catch
try {
const result = await workspacesApi.runSetupScript(workspaceId);
if (!result.success && result.error?.type === 'process_already_running') {
await waitForAttemptToFinish(workspaceId);
return retrySetupScript(workspaceId); // single retry after busy state clears
}
} catch (err) {
toast.error(String(err));
} Prevention
- Keep the run button disabled while isAttemptRunning is true (with fresh context).
- Debounce/deduplicate rapid clicks with an in-flight flag.
- Stop hung attempts from the UI before re-running scripts.
- Monitor for orphaned processes after backend crashes and restart to clear stale busy state.
When it happens
Trigger: Calling workspacesApi.runSetupScript while a prior setup/cleanup/archive script or attempt process is still executing on the same workspace; the server rejects with process_already_running.
Common situations: Double-clicking the run action so two invocations race, a previous script hanging (long install, waiting on input) and never finishing, or a crashed run that left the process state marked running on the server.
Related errors
- result.error
- No setup script configured for this project
- Failed to run setup script
- No cleanup script configured for this project
- Failed to run cleanup script
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/ede21ec5d675c8bf.
Report an issue: GitHub.