{"record":{"id":"87426c966a6e5b9d","repo":"paperclipai/paperclip","slug":"attachment-not-found","errorCode":null,"errorMessage":"Attachment not found","messagePattern":"Attachment not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":13828,"sourceCode":"    if (\n      effectiveMoveToTodoRequested &&\n      (isClosed || (isBlocked && !hasUnresolvedFirstClassBlockers) || shouldResumeInProgressScheduledRetry)\n    ) {\n      scheduledRetrySupersededByComment = shouldResumeInProgressScheduledRetry && issue.status === \"in_progress\";\n      cancelledScheduledRetryRunId = scheduledRetrySupersededByComment\n        ? await cancelScheduledRetrySupersededByComment({\n            scheduledRetryRunId: scheduledRetryForHumanComment?.runId,\n            issue,\n            actor,\n          })\n        : null;\n      const reopenedIssue = await svc.update(id, { status: \"todo\" });\n      if (!reopenedIssue) {\n        res.status(404).json({ error: \"Issue not found\" });\n        return;\n      }\n      reopened = isClosed || (isBlocked && !hasUnresolvedFirstClassBlockers);\n      reopenFromStatus = reopened ? issue.status : null;\n      currentIssue = reopenedIssue;\n\n      await logActivity(db, {\n        companyId: currentIssue.companyId,\n        actorType: actor.actorType,\n        actorId: actor.actorId,\n        agentId: actor.agentId,\n        runId: actor.runId,\n        agentApiKeyId: actor.agentApiKeyId,\n        action: \"issue.updated\",\n        entityType: \"issue\",\n        entityId: currentIssue.id,\n        details: {\n          status: \"todo\",\n          ...(reopened ? { reopened: true, reopenedFrom: reopenFromStatus } : {}),\n          ...(scheduledRetrySupersededByComment\n            ? {\n                scheduledRetrySupersededByComment: true,","sourceCodeStart":13810,"sourceCodeEnd":13846,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L13810-L13846","documentation":"404 from attachment deletion/lookup routes. Fires when svc.getAttachmentById returns no attachment for the id (or the actor cannot access it); getAccessibleResource converts the null lookup into this 404 before any mutation.","triggerScenarios":"Thrown at server/src/routes/issues.ts:12800 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.","Check that the record was not deleted or archived, and that the request is scoped to the correct companyId."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}