{"record":{"id":"b2b605a9451025c1","repo":"paperclipai/paperclip","slug":"job-job-jobkey-already-has-a-running-executio","errorCode":null,"errorMessage":"Job \"${job.jobKey}\" already has a running execution — cannot trigger while in progress","messagePattern":"Job \"(.+?)\" already has a running execution — cannot trigger while in progress","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-job-scheduler.ts","lineNumber":473,"sourceCode":"    if (activeJobs.has(jobId)) {\n      throw new Error(\n        `Job \"${job.jobKey}\" is already running — cannot trigger while in progress`,\n      );\n    }\n\n    // Also check DB for running runs (defensive — covers multi-instance)\n    const existingRuns = await db\n      .select()\n      .from(pluginJobRuns)\n      .where(\n        and(\n          eq(pluginJobRuns.jobId, jobId),\n          eq(pluginJobRuns.status, \"running\"),\n        ),\n      );\n\n    if (existingRuns.length > 0) {\n      throw new Error(\n        `Job \"${job.jobKey}\" already has a running execution — cannot trigger while in progress`,\n      );\n    }\n\n    // Check worker availability\n    if (!workerManager.isRunning(job.pluginId)) {\n      throw new Error(\n        `Worker for plugin \"${job.pluginId}\" is not running — cannot trigger job`,\n      );\n    }\n\n    // Create the run and dispatch (non-blocking)\n    const run = await jobStore.createRun({\n      jobId,\n      pluginId: job.pluginId,\n      trigger,\n    });\n","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-job-scheduler.ts#L455-L491","documentation":"Overlap guard (database, defensive) in triggerJob: a query for pluginJobRuns rows with status running found at least one. Covers multi-instance deployments where another process's in-memory set cannot be seen; the other instance's running execution is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-job-scheduler.ts:473 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["A previous execution is still running. Wait for completion or investigate a stuck execution before re-triggering."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}