{"record":{"id":"0aa3cda45aaa1406","repo":"BloopAI/vibe-kanban","slug":"failed-to-run-archive-script","errorCode":null,"errorMessage":"Failed to run archive script","messagePattern":"Failed to run archive script","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/web-core/src/shared/actions/index.ts","lineNumber":1216,"sourceCode":"\n  RunArchiveScript: {\n    id: 'run-archive-script',\n    label: 'Run Archive Script',\n    icon: TerminalIcon,\n    shortcut: 'R A',\n    requiresTarget: ActionTargetType.WORKSPACE,\n    isVisible: (ctx) => ctx.hasWorkspace,\n    isEnabled: (ctx) => !ctx.isAttemptRunning,\n    execute: async (_ctx, workspaceId) => {\n      const result = await workspacesApi.runArchiveScript(workspaceId);\n      if (!result.success) {\n        if (result.error?.type === 'no_script_configured') {\n          throw new Error('No archive script configured for this project');\n        }\n        if (result.error?.type === 'process_already_running') {\n          throw new Error('Cannot run script while another process is running');\n        }\n        throw new Error('Failed to run archive script');\n      }\n    },\n  } satisfies WorkspaceActionDefinition,\n\n  // === Issue Actions ===\n  CreateIssue: {\n    id: 'create-issue',\n    label: 'Create Issue',\n    icon: PlusIcon,\n    shortcut: 'I C',\n    requiresTarget: ActionTargetType.NONE,\n    isVisible: (ctx) => ctx.layoutMode === 'kanban' && !ctx.isCreatingIssue,\n    execute: (ctx) => {\n      ctx.navigateToCreateIssue({ statusId: ctx.defaultCreateStatusId });\n    },\n  } satisfies GlobalActionDefinition,\n\n  ChangeIssueStatus: {","sourceCodeStart":1198,"sourceCodeEnd":1234,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/packages/web-core/src/shared/actions/index.ts#L1198-L1234","documentation":"The RunArchiveScript workspace action calls workspacesApi.runArchiveScript and throws this generic Error when the backend returns success=false with an error payload that is neither 'no_script_configured' nor 'process_already_running'. It is the fallback branch for any archive-script execution failure not covered by the two specific cases (e.g. the script exited non-zero, the backend process spawn failed, or an internal server error).","triggerScenarios":"Invoking the 'Run Archive Script' command (shortcut R A) on a workspace where the backend's archive-script run fails for any reason other than 'no script configured' or 'another process running' — typically the configured script itself exits with a non-zero exit code, the script binary/interpreter is missing, or the backend returns an unrecognized error type.","commonSituations":"A project's archive script has a bug or references files that don't exist; the script's shebang/interpreter isn't installed in the execution environment; backend lacks permission to execute the script file; a backend version returns a new error.type the frontend doesn't map; transient backend failure while spawning the process.","solutions":["Open the project settings and run the archive script manually in a terminal to see its actual exit code and stderr — the script itself is most likely failing","Check that the script path configured for the project exists and is executable (chmod +x) and that its interpreter/shebang is installed","Restart the backend and retry, in case the failure was a transient spawn error","Update the frontend/backend to matching versions if a new error.type was recently added to the API"],"exampleFix":"// before\nthrow new Error('Failed to run archive script');\n// after\nthrow new Error(\n  `Failed to run archive script: ${result.error?.message ?? result.error?.type ?? 'unknown error'}`\n);","handlingStrategy":"try-catch","validationCode":"const isEnabled = !ctx.isAttemptRunning;\nconst hasScript = result.error?.type !== 'no_script_configured'; // check project settings before invoking","typeGuard":"function isScriptRunFailure(r: unknown): r is { success: false; error?: { type: string } } {\n  return typeof r === 'object' && r !== null && 'success' in r &&\n    (r as any).success === false;\n}","tryCatchPattern":"try {\n  await workspacesApi.runArchiveScript(workspaceId);\n} catch (e) {\n  showToast((e as Error).message);\n  // Inspect the script's exit status in backend logs to find the real cause.\n}","preventionTips":["Test the archive script in a terminal before wiring it into the project settings","Ensure the script is executable and its interpreter is installed","Never invoke script actions while an attempt is running (respect ctx.isAttemptRunning)","Surface result.error.type in the thrown message instead of a generic string"],"tags":["workspace-actions","script-execution","fallback-error"],"backgroundTag":"script-execution-failed","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}