paperclipai/paperclip · error

Missing file field 'file'

Error message

Missing file field 'file'

What it means

400 from issue attachment upload. Fires when the multipart request completed but req.file is absent — no part was provided under the required field name 'file', so there is nothing to store.

Source

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

  router.post("/issues/:id/comments", validate(addIssueCommentSchema), async (req, res) => {
    const id = req.params.id as string;
    const issue = await getAccessibleResource(req, res, svc.getById(id), "Issue not found");
    if (!issue) return;
    if (req.actor.type === "agent" && req.body.onBehalfOfUserId != null) {
      await auditAgentIssueCommentAttributionSpoof({
        db,
        req,
        issue,
        surface: "issue.comment.create",
        requestedValue: readNonEmptyString(req.body.onBehalfOfUserId),
      });
      await denyIssueWrite(req, res, issue, "issue_write_attribution_spoof_rejected");
      return;
    }
    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 &&

View on GitHub (pinned to 01ad858492)

Solutions

  1. Include the required field(s) in the request path, query, or body as named by the error message, then retry.
  2. Check the API contract in packages/shared validators for the exact required shape of this endpoint.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/issues.ts:12658 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/6aebaab4e7966a3d. Report an issue: GitHub.