{"record":{"id":"f5440b4ccee03831","repo":"paperclipai/paperclip","slug":"image-exceeds-max-attachment-bytes-bytes","errorCode":null,"errorMessage":"Image exceeds ${MAX_ATTACHMENT_BYTES} bytes","messagePattern":"Image exceeds (.+?) bytes","errorType":"http","errorClass":null,"httpStatus":422,"severity":"error","filePath":"server/src/routes/assets.ts","lineNumber":224,"sourceCode":"\n    res.status(201).json({\n      assetId: asset.id,\n      companyId: asset.companyId,\n      provider: asset.provider,\n      objectKey: asset.objectKey,\n      contentType: asset.contentType,\n      byteSize: asset.byteSize,\n      sha256: asset.sha256,\n      originalFilename: asset.originalFilename,\n      createdByAgentId: asset.createdByAgentId,\n      createdByUserId: asset.createdByUserId,\n      createdAt: asset.createdAt,\n      updatedAt: asset.updatedAt,\n      contentPath: `/api/assets/${asset.id}/content`,\n    });\n  });\n\n  router.post(\"/companies/:companyId/logo\", async (req, res) => {\n    const companyId = req.params.companyId as string;\n    assertCompanyAccess(req, companyId);\n\n    try {\n      await runSingleFileUpload(companyLogoUpload, req, res);\n    } catch (err) {\n      if (err instanceof multer.MulterError) {\n        if (err.code === \"LIMIT_FILE_SIZE\") {\n          res.status(422).json({\n            error: `Image is larger than the ${formatAttachmentSize(MAX_ATTACHMENT_BYTES)} limit`,\n          });\n          return;\n        }\n        res.status(400).json({ error: err.message });\n        return;\n      }\n      throw err;\n    }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/assets.ts#L206-L242","documentation":"Error \"Image exceeds ${MAX_ATTACHMENT_BYTES} bytes\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/routes/assets.ts:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the image size below the maximum attachment byte limit, then upload again."],"exampleFix":null,"handlingStrategy":null,"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"}