{"record":{"id":"71b7923e554e88ce","repo":"paperclipai/paperclip","slug":"blocker-case-key-not-found","errorCode":"blocker_case_key_not_found","errorMessage":"Pipeline blocker case key not found","messagePattern":"Pipeline blocker case key not found","errorType":"http","errorClass":"HttpError","httpStatus":404,"severity":"error","filePath":"server/src/services/pipelines.ts","lineNumber":2135,"sourceCode":"  input: { companyId: string; pipelineId: string; blockedByCaseKeys: string[] },\n) {\n  const uniqueKeys = [...new Set(input.blockedByCaseKeys)];\n  if (uniqueKeys.length !== input.blockedByCaseKeys.length) {\n    throw unprocessable(\"Pipeline blocker key set contains duplicate cases\", { code: \"validation\" });\n  }\n  for (const key of uniqueKeys) assertCaseKey(key);\n  if (uniqueKeys.length === 0) return new Map<string, string>();\n\n  const rows = await db\n    .select({ id: pipelineCases.id, caseKey: pipelineCases.caseKey })\n    .from(pipelineCases)\n    .where(and(\n      eq(pipelineCases.companyId, input.companyId),\n      eq(pipelineCases.pipelineId, input.pipelineId),\n      inArray(pipelineCases.caseKey, uniqueKeys),\n    ));\n  if (rows.length !== uniqueKeys.length) {\n    throw new HttpError(404, \"Pipeline blocker case key not found\", {\n      code: \"blocker_case_key_not_found\",\n      missingCaseKeys: uniqueKeys.filter((key) => !rows.some((row) => row.caseKey === key)),\n    });\n  }\n  return new Map(rows.map((row) => [row.caseKey, row.id]));\n}\n\nfunction pipelineBatchError(error: unknown, fallbackCode = \"unknown\") {\n  const httpError = error as { status?: number; message?: string; details?: unknown };\n  return {\n    status: httpError.status ?? 500,\n    message: httpError.message ?? \"Unknown error\",\n    details: httpError.details ?? { code: fallbackCode },\n  };\n}\n\nasync function enqueueStageAutomationLedger(\n  db: PipelineDb,","sourceCodeStart":2117,"sourceCodeEnd":2153,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/pipelines.ts#L2117-L2153","documentation":"Guard in the pipeline-blocker resolution helper: after loading pipelineCases rows for the requested keys, a key in blockedByCaseKeys matched no case row for the company. Indicates stale or foreign case keys passed to the blocker API, not a data corruption; the input case key is at fault.","triggerScenarios":"Thrown at server/src/services/pipelines.ts:2135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the pipeline blocker case key exists; recreate the blocker case if it was removed."],"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-14T05:17:10.506Z"}