paperclipai/paperclip · error

Invalid attachment metadata

Error message

Invalid attachment metadata

What it means

422 from issue attachment upload. Fires when createIssueAttachmentMetadataSchema.safeParse fails on req.body — the accompanying metadata fields (title/filename/kind etc.) do not conform to the attachment metadata schema.

Source

Thrown at server/src/routes/issues.ts:13691

    }
    const commentAccessDecision = await assertAgentIssueCommentAllowed(req, res, issue);
    if (!commentAccessDecision) return;
    const commentAuthorizationReason = issueWriteAuthorizationReason(req, commentAccessDecision);
    if (!assertStructuredCommentFieldsAllowed(req, res, {
      presentation: req.body.presentation,
      metadata: req.body.metadata,
    })) return;
    const closedExecutionWorkspace = await getClosedIssueExecutionWorkspace(issue);

    const actor = getActorInfo(req);
    const commentPresentation = req.body.presentation ??
      await deriveRecoveryCommentPresentation(req, issue.companyId, req.body.body);
    const reopenRequested = req.body.reopen === true;
    const resumeRequested = req.body.resume === true;
    const interruptRequested = req.body.interrupt === true;
    const isClosed = isClosedIssueStatus(issue.status);
    const isBlocked = issue.status === "blocked";
    const crossIssueCommentOnlyGrant =
      isClosed &&
      (isDirectParentReportDecision(commentAccessDecision) ||
        (req.actor.type === "agent" &&
          issue.assigneeAgentId !== null &&
          issue.assigneeAgentId !== req.actor.agentId &&
          !reopenRequested &&
          !resumeRequested &&
          (isIssueMentionGrantDecision(commentAccessDecision) ||
            isDefaultOpenIssueWriteDecision(commentAccessDecision))));
    const effectiveReopenRequested = crossIssueCommentOnlyGrant ? false : reopenRequested;
    const effectiveResumeRequested = crossIssueCommentOnlyGrant ? false : resumeRequested;
    if (
      isClosed &&
      req.actor.type === "agent" &&
      issue.assigneeAgentId !== null &&
      issue.assigneeAgentId !== req.actor.agentId &&
      !crossIssueCommentOnlyGrant
    ) {

View on GitHub (pinned to 01ad858492)

Solutions

  1. Fix the offending parameter to satisfy the constraint stated in the error message (type, range, or allowed values), then retry.
  2. Refer to the route's request validation in the named file and the shared validators for the accepted format.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/issues.ts:12672 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/86f6e24d8e549441. Report an issue: GitHub.