toeverything/AFFiNE · error · StorageQuotaExceeded
storage_quota_exceeded
storage_quota_exceeded
Error message
You have exceeded your storage quota.
What it means
Sibling of 313: thrown when checkExceeded(0) reports storageQuotaExceeded. The workspace's total storage usage already exceeds the plan's storage quota, so the blob upload is refused before any bytes are read.
Source
Thrown at packages/backend/server/src/core/workspaces/resolvers/blob.ts:190
async setBlob(
@CurrentUser() user: CurrentUser,
@Args('workspaceId') workspaceId: string,
@Args({ name: 'blob', type: () => GraphQLUpload })
blob: FileUpload
) {
await this.ac
.user(user.id)
.workspace(workspaceId)
.assert('Workspace.Blobs.Write');
const checkExceeded =
await this.quota.getWorkspaceQuotaCalculator(workspaceId);
let result = checkExceeded(0);
if (result?.blobQuotaExceeded) {
throw new BlobQuotaExceeded();
} else if (result?.storageQuotaExceeded) {
throw new StorageQuotaExceeded();
}
const buffer = await readBuffer(blob.createReadStream(), checkExceeded);
await this.storage.put(workspaceId, blob.filename, buffer);
return blob.filename;
}
@Mutation(() => BlobUploadInit)
async createBlobUpload(
@CurrentUser() user: CurrentUser,
@Args('workspaceId') workspaceId: string,
@Args('key') key: string,
@Args('size', { type: () => Int }) size: number,
@Args('mime') mime: string
): Promise<BlobUploadInit> {
await this.ac
.user(user.id)View on GitHub (pinned to 26c515e050)
Solutions
- Reduce storage usage (blobs, docs, history) below quota.
- Upgrade the plan's storage quota.
- Ensure usage metrics feeding the calculator are up to date.
- Surface storage usage in the UI.
Example fix
// before await storage.put(ws, file.name, buf) // after const calc = await quota.getWorkspaceQuotaCalculator(ws) if (calc(0)?.storageQuotaExceeded) return promptStorageUpgrade()
Defensive patterns
Strategy: validation
Validate before calling
const calc = await quota.getWorkspaceQuotaCalculator(workspaceId) if (calc(0)?.storageQuotaExceeded) return promptStorageUpgrade()
Try / catch
try { await uploadBlob(file) } catch (e) {
if (e.code === 'storage_quota_exceeded') promptStorageUpgrade()
else throw e
} Prevention
- Track total storage vs the plan cap.
- Clean up old versions/history.
- Alert before hitting the ceiling.
When it happens
Trigger: The setBlob mutation when the workspace is already over its total storage quota (calculator at size 0).
Common situations: Plan downgrade; large doc/blob accumulation; stale usage metrics; multi-tenant shared storage limits.
Related errors
- blob_quota_exceeded
- member_quota_exceeded
- no_more_seat
- copilot_selected_sources_limit_exceeded
- comment_attachment_quota_exceeded
AI-assisted analysis of toeverything/AFFiNE@26c515e050 (2026-08-12).
Data as JSON: /api/errors/76c76f40d48728fa.
Report an issue: GitHub.