Issue Description
Title: Mail delivered during the day lost after docker compose up -d pulled 1.0.0 against a 0.16.27 store (store reverted to last clean shutdown)
Expected Behavior
All email received from last clean shutdown to time of migration should still be present.
Actual Behavior
Lost email received from last clean shutdown to time of migration on 27 October 2026
Relevant Log Output
debian@mx:~$ sudo ls -la --time-style=full-iso /opt/stalwart-mail/data | grep -i -e LOG -e ‘.log’
sudo grep -i -e ‘recover’ -e ‘WAL’ -e ‘corrupt’ /opt/stalwart-mail/data/LOG* | head -60
-rw-r–r-- 1 2000 2000 24860 2026-10-27 20:37:24.124281427 +0000 005939.log
-rw-r–r-- 1 2000 2000 305608 2026-10-27 20:37:24.124281427 +0000 LOG
-rw-r–r-- 1 2000 2000 229547 2026-10-27 20:19:49.295879484 +0000 LOG.old.1793132395918031
-rw-r–r-- 1 2000 2000 235218 2026-10-27 20:19:56.239856100 +0000 LOG.old.1793132409257976
-rw-r–r-- 1 2000 2000 229547 2026-10-27 20:20:09.575811171 +0000 LOG.old.1793132442920914
-rw-r–r-- 1 2000 2000 211797 2026-10-27 20:21:48.111478451 +0000 LOG.old.1793132512209289
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210304 139853507724928 Options.track_and_verify_wals_in_manifest: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210305 139853507724928 Options.track_and_verify_wals: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210330 139853507724928 Options.wal_dir:
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210332 139853507724928 Options.WAL_ttl_seconds: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210333 139853507724928 Options.WAL_size_limit_MB: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210345 139853507724928 Options.wal_recovery_mode: 2
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210355 139853507724928 Options.wal_filter: None
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210356 139853507724928 Options.avoid_flush_during_recovery: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210359 139853507724928 Options.manual_wal_flush: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210360 139853507724928 Options.wal_compression: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210362 139853507724928 Options.background_close_inactive_wals: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210377 139853507724928 Options.best_efforts_recovery: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210389 139853507724928 Options.wal_write_temperature: kUnknown
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210397 139853507724928 Options.max_total_wal_size: 0
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210448 139853507724928 Options.wal_bytes_per_sync: 1048576
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.210729 139853507724928 [db/version_set.cc:6116] Recovering from manifest file: /var/lib/stalwart/MANIFEST-005923
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.269078 139853507724928 [db/version_set.cc:6174] Recovered from manifest file:/var/lib/stalwart/MANIFEST-005923 succeeded,manifest_file_number is 5923, next_file_number is 5928, last_sequence is 45809363, log_number is 5911,prev_log_number is 0,max_column_family is 26,min_log_number_to_keep is 5911
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.270018 139853507724928 EVENT_LOG_v1 {“time_micros”: 1793132512270006, “job”: 1, “event”: “recovery_started”, “wal_files”: [5922]}
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.270025 139853507724928 [db/db_impl/db_impl_open.cc:1379] Recovering log #5922 mode 2
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.271050 139853507724928 [db/db_impl/db_impl_open.cc:1353] Recovered to log #5922 next seq #45810066
/opt/stalwart-mail/data/LOG:2026/10/27-20:21:52.300559 139853507724928 EVENT_LOG_v1 {“time_micros”: 1793132512300555, “job”: 1, “event”: “recovery_finished”, “status”: “OK”}
/opt/stalwart-mail/data/LOG:Cumulative WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 GB, 0.00 MB/s
/opt/stalwart-mail/data/LOG:Interval WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 GB, 0.00 MB/s
/opt/stalwart-mail/data/LOG:Cumulative WAL: 43 writes, 0 syncs, 43.00 writes per sync, written: 0.00 GB, 0.00 MB/s
/opt/stalwart-mail/data/LOG:Interval WAL: 43 writes, 0 syncs, 43.00 writes per sync, written: 0.00 GB, 0.00 MB/s
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940938 139933361649856 Options.track_and_verify_wals_in_manifest: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940939 139933361649856 Options.track_and_verify_wals: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940965 139933361649856 Options.wal_dir:
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940967 139933361649856 Options.WAL_ttl_seconds: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940968 139933361649856 Options.WAL_size_limit_MB: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940980 139933361649856 Options.wal_recovery_mode: 2
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940989 139933361649856 Options.wal_filter: None
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940990 139933361649856 Options.avoid_flush_during_recovery: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940993 139933361649856 Options.manual_wal_flush: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940994 139933361649856 Options.wal_compression: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.940995 139933361649856 Options.background_close_inactive_wals: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.941014 139933361649856 Options.best_efforts_recovery: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.941022 139933361649856 Options.wal_write_temperature: kUnknown
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.941029 139933361649856 Options.max_total_wal_size: 0
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.941037 139933361649856 Options.wal_bytes_per_sync: 1048576
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:48.941289 139933361649856 [db/version_set.cc:6116] Recovering from manifest file: /var/lib/stalwart/MANIFEST-005873
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:49.011475 139933361649856 [db/version_set.cc:6174] Recovered from manifest file:/var/lib/stalwart/MANIFEST-005873 succeeded,manifest_file_number is 5873, next_file_number is 5878, last_sequence is 45809347, log_number is 5858,prev_log_number is 0,max_column_family is 26,min_log_number_to_keep is 5858
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:49.012434 139933361649856 EVENT_LOG_v1 {“time_micros”: 1793132389012422, “job”: 1, “event”: “recovery_started”, “wal_files”: [5872]}
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:49.012440 139933361649856 [db/db_impl/db_impl_open.cc:1379] Recovering log #5872 mode 2
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:49.012494 139933361649856 [db/db_impl/db_impl_open.cc:1353] Recovered to log #5872 next seq #45809352
/opt/stalwart-mail/data/LOG.old.1793132395918031:2026/10/27-20:19:49.066792 139933361649856 EVENT_LOG_v1 {“time_micros”: 1793132389066782, “job”: 1, “event”: “recovery_finished”, “status”: “OK”}
/opt/stalwart-mail/data/LOG.old.1793132395918031:Cumulative WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 GB, 0.00 MB/s
/opt/stalwart-mail/data/LOG.old.1793132395918031:Interval WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 GB, 0.00 MB/s
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919653 139818531981504 Options.track_and_verify_wals_in_manifest: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919655 139818531981504 Options.track_and_verify_wals: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919683 139818531981504 Options.wal_dir:
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919685 139818531981504 Options.WAL_ttl_seconds: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919686 139818531981504 Options.WAL_size_limit_MB: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919699 139818531981504 Options.wal_recovery_mode: 2
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919709 139818531981504 Options.wal_filter: None
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919710 139818531981504 Options.avoid_flush_during_recovery: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919714 139818531981504 Options.manual_wal_flush: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919715 139818531981504 Options.wal_compression: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919716 139818531981504 Options.background_close_inactive_wals: 0
/opt/stalwart-mail/data/LOG.old.1793132409257976:2026/10/27-20:19:55.919726 139818531981504 Options.best_efforts_recovery: 0
debian@mx:~$
Stalwart Version
v1.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
Setup: Docker Compose, single node, RocksDB, Stalwart 0.16.27, image tag :latest, host networking. A nightly cold backup (docker compose stop, restic, start) runs at about 03:31 UTC.
Timeline (UTC, 27 Oct 2026):
03:23 last message stored before the backup (INBOX UID 6098).
03:31 backup stops/restarts the container (about 1s).
03:24–20:10: dozens of messages accepted from our gateway (250 2.0.0 Message queued) and visible in IMAP clients (eM Client online all day).
~20:19: docker compose pull && up -d on :latest, which now resolves to 1.0.0. 1.0.0 logged “data store was created by a Stalwart version prior to 1.0 and cannot be opened” repeatedly and I stopped it. I then pinned v0.16.27 and restarted.
20:21: cold backup of the store. INBOX had 5324 messages and UIDNEXT 6099, with one message dated 27 Oct (03:23). All folders and all accounts lacked the rest of the day’s mail. An isolated restore of that snapshot showed the same.
eM Client’s local cache still held the missing mail. After I re-uploaded it, UIDs 6099/6100 were reused (same UIDVALIDITY).
Afterwards I migrated with stalwart-migrate to 1.0.0 with no errors. The migration isn’t the cause, since the snapshot predates it.
Observation: the store state at 20:21 equals the state at the last clean shutdown (03:31), including UID counters.
Questions:
Does 0.16.27 on RocksDB rely on a clean shutdown/flush for durability of recent writes?
Can 1.0.0 booting against a 0.16 RocksDB directory discard or alter recent WAL/memtable data before the schema check?
Anything else that would revert counters?
RocksDB LOG excerpt: (paste output of check 1)
Possibly related: Missing Emails after v1.0.0 migration, where recent mail was missing on all accounts after migrating from 0.16.27.
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