Issue Description
After a 0.16.27 → 1.0.0 migration with stalwart-migrate 1.0.1 run as root with --owner 587:587 (our stalwart user), the target RocksDB store was owned correctly, but two files the tool wrote into the shared filesystem blob store (blob_mode=Shared) were left as root:root 0644:
blob/53/54/41/4c/57/knkectcxifjfix7tkbau7x7ukjausts3iraviqjonr0di 1,311,148 bytes
blob/53/54/41/4c/57/knkectcxifjfix7tkbau7x7djravgu7jizeukus3jvhuirkmfzwhuna 525,255 bytes
These are the spam classifier’s model and training data (keys STALWART_SPAM_…). Both were written at 11:29:14Z, the second the verification at the end of run --final finished. A walk of the whole blob tree (3.6M entries) found no other file or directory not owned by stalwart, so it is only these two.
1.0 can read them (0644), so spam scoring works with the migrated model, but it cannot replace them. The spam filter maintenance task has failed with EACCES on every attempt since the first start.
The code is unchanged in 1.0.6. --owner is applied to target.created_paths(), and the v1 target registers only the data store’s own path there (crates/target-v1/src/target.rs lines 96–98: the RocksDB directory or the SQLite file, OwnedPaths::None otherwise). A filesystem blob store is never in that list. With blob_mode=Shared, only the files the tool writes into the existing blob store are affected, which here were the two spam-model blobs. From reading the code (I have not tested it), blob_mode=Copy into a new filesystem blob store would leave every copied blob root-owned.
Expected Behavior
--owner applies to everything the tool creates for the target, including the filesystem blob store (or what it writes into a shared one), so that the 1.0 server, running as that user, can later overwrite it.
Actual Behavior
The two spam-model blobs stay root:root. From the first start, SpamFilterMaintenance fails with “Permission denied (os error 13)” in crates/store/src/dispatch/blob.rs:201 (called from crates/spam-filter/src/modules/classifier.rs:582), is marked stalled, and is retried as a transient failure forever (“Task still retrying after repeated transient failures”). The classifier therefore never updates.
chown stalwart:stalwart on the two files fixes it. At the task’s next scheduled retry the server rewrote both blobs (updated model, new sizes), no further errors were logged, and the task left the retry state.
Reproduction Steps
- 0.16.27 with RocksDB data store and a filesystem blob store, with a trained spam classifier.
- Run
stalwart-migrate prepare, thenrun, thenrun --final, all as root with--owner <uid>:<gid>of the account the server runs as, reusing the filesystem blob store (blob_mode=Shared), target a new RocksDB directory. - Start 1.0 as that account.
find <blob store> ! -user <account>lists the two spam-model blobs; the log shows the maintenance error below at each run of the task.
Relevant Log Output
2026-10-27T23:29:55Z INFO Task queued for processing (task-manager.task-queued) type = "SpamFilterMaintenance"
2026-10-27T23:29:55Z ERROR Filesystem error (store.filesystem-error) reason = "Permission denied (os error 13)", causedBy = "crates/store/src/dispatch/blob.rs:201", causedBy = "crates/spam-filter/src/modules/classifier.rs:582", details = "Failed to perform spam filter maintenance task"
2026-10-27T23:41:39Z WARN Task stalled (task-manager.task-stalled) taskId = 9033666212818168441, name = "SpamFilterMaintenance", reason = "Filesystem error (store.filesystem-error): reason = Permission denied (os error 13), causedBy = crates/store/src/dispatch/blob.rs:201, causedBy = crates/spam-filter/src/modules/classifier.rs:582 …"
(13 such errors between 2026-10-27T23:29Z and 2026-10-28T16:51Z.)
Stalwart Version
v1.x
Installation Method
Binary (Linux)
Database Backend
RocksDB
Blob Storage
Filesystem
Search Engine
Internal
Directory Backend
Internal
Additional Context
Linux aarch64 (Debian-based), Stalwart 1.0.0 running as a dedicated user (587:587) under systemd. Migrated with stalwart-migrate 1.0.1, run as root with --owner 587:587 and --concurrency 4 --account-split 2 (the segfault workaround from topic 2060), final run with --allow-errors for 85 spam training samples whose blobs were already missing in 0.16.
Two smaller points:
- The docs could tell users of a shared blob store to check ownership after the migration, e.g. with
find <blob store> ! -user <account>. - A permanent EACCES is classified as a transient failure, so the task retries indefinitely instead of failing visibly.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on