Bug: RocksDB blob storage does not get cleaned / purged neither by maintenance nor by api calls #2956
Replies: 2 comments 19 replies
-
|
Stalwart uses reference counting to manage blob storage. Blobs are only deleted from the store once all references to them have been removed. Off the top of my head, these are the possible reference types:
Of all these, I'd say the most likely culprit is the spam classifier holding a reference to the blob. Currently there's no way to unlink these outside of the database console, but in v0.16 you'll be able to delete training samples directly. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for clarification. In my case I uploaded some big test files (up to 2 GB in size) to test Bulwark's files feature (uses JMAP FileNode API). The file should not be referenced by anything but my Stalwart user's account. Deleting the file should have removed the blob since it has no references any more. And, it should neved had a reference to mail, cards or cals. Or maybe there is some kind of Trash folder? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
Cross reference: Issue at Bulwark's repository (this web client can do JMAP file management).
When users upload files to Stalwart 0.15.5 (current version as of April 4th 2026) via JMAP, it uses blob storage to save them to disk. See https://stalw.art/docs/storage/blob/ for details.
Unfortunately even after users delete their files from their Stalwart account these files stay in the storage forever. The maintenace run and the api calls to these endpoints do nothing about that:
This being said, any user can kill your Stalwart installation by uploading like thousands of files even though the max upload size is set to a low value (default is 50M bytes ~ 47.68 MB). Just upload, delete, upload delete, ...
This was found while doing chunked encoding upload tests for Bulwark issue #96.
⬇️ Endpoint tests done ⬇️
Purge blob storage and get a successful return message JSON:
See your blob storage stay unchanged:
These files with GB in size are from the tests of one user account. The files inside this account are already deleted before maintenance run took place at night and after calling all the purge methods of the various storage backends.
Means: Even unreferenced blob data is being kept forever!
Expected Behavior
Unreferenced data in blobs should be removed after undelete grace period.
Actual Behavior
Blobs stay forever.
Reproduction Steps
Tests done without enterprise license against QA system.
Relevant Log Output
Stalwart Version
v0.15.x
Installation Method
Binary (Linux)
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
/opt/stalwart/data/I acknowledge that:
traceand included relevant log output if applicable.Beta Was this translation helpful? Give feedback.
All reactions