When running report --category mismatch, I get the following:
2 verify mismatch 4 - - changelog VanishedEmail: row 82581 differs in the target
2 verify mismatch 4 - - changelog VanishedEmail: row 82849 differs in the target
Here is what Codex thinks:
• The old database lists some deleted-message entries more than once.
• The new format removes those duplicates.
• The verifier counts the entries and sees different totals, so it reports a mismatch
It suggested the following DB query:
stalwart=# WITH wanted(change_id, key_hex) AS (
VALUES
(82581, '00000004fb0000000000014295'),
(82849, '00000004fb00000000000143a1')
),
pairs AS (
SELECT
w.change_id,
substring(l.v FROM p.pos FOR 8) AS pair
FROM wanted w
JOIN l ON l.k = decode(w.key_hex, 'hex')
CROSS JOIN LATERAL
generate_series(1, octet_length(l.v), 8) AS p(pos)
)
SELECT
change_id,
count(*) AS total_pairs,
count(DISTINCT pair) AS unique_pairs,
count(*) - count(DISTINCT pair) AS duplicates
FROM pairs
GROUP BY change_id
ORDER BY change_id;
change_id | total_pairs | unique_pairs | duplicates
-----------+-------------+--------------+------------
82581 | 40 | 37 | 3
82849 | 88 | 87 | 1
(2 rows)
Expected Behavior
No errors on migration
Stalwart Version
v0.16.x
Installation Method
Docker
Database Backend
PostgreSQL
Blob Storage
Filesystem
Search Engine
PostgreSQL
Directory Backend
Internal
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.
This looks like a duplicate-entry artefact of the 0.16 to 1.0 migration. The docs don’t cover this exact message, so part of what follows is my inference.
Your query shows the 0.16 change-log rows 82581 and 82849 contain repeated 8-byte pairs: 3 duplicates in the first and 1 in the second. The VanishedEmail rows are the changelog entries for deleted messages. The migration appears to write each of these once, which would explain why the verifier sees the target differ from the source. I couldn’t find the source that does the comparison, so I can’t confirm that the duplicates are the cause. Codex’s explanation fits your numbers, though.
The docs say verify is meant to skip differences that the migration made on purpose and recorded in the report. They also say that a verify row which no earlier report explains will block run --final, and that --allow-errors doesn’t override it. If this really is harmless deduplication, the verifier should arguably treat it as an explained difference. That is a tool behaviour issue and not something you’ve configured wrongly.
You can check how much it matters. Run stalwart-migrate report --state /var/lib/stalwart-migrate --severity verify and see whether these two rows are the only unexplained ones. If they are, the data affected is limited to the change-log entries for deleted emails. That log is used for JMAP and IMAP sync, so at worst a client might resync.
Also, you listed v0.16.x as your version. The migration tool is the one producing this report, so please post the stalwart-migrate version from stalwart-migrate status. A human will need it to follow up.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
$ report --severity verify
run severity category account object id message
2 verify mismatch - x:SpamTrainingSample 323611668557174784 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 323618757702697984 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 324162511032060928 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 325874752577115136 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 325923795254882816 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 327259671532474368 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 327970427283366400 the converted source object is missing in the target
2 verify mismatch - x:SpamTrainingSample 328405096238692352 the converted source object is missing in the target
2 verify mismatch 4 - - changelog VanishedEmail: row 82581 differs in the target
2 verify mismatch 4 - - changelog VanishedEmail: row 82849 differs in the target
10 rows
stalwart=# WITH pairs AS (
SELECT
('x' || encode(substring(k FROM 6 FOR 8), 'hex'))
::bit(64)::bigint AS change_id,
substring(v FROM p.pos FOR 8) AS pair
FROM l
CROSS JOIN LATERAL
generate_series(1, octet_length(v), 8) AS p(pos)
WHERE octet_length(k) = 13
AND substring(k FROM 1 FOR 5) = decode('00000004fb', 'hex')
)
SELECT
change_id,
count(*) AS total_pairs,
count(DISTINCT pair) AS unique_pairs,
count(*) - count(DISTINCT pair) AS duplicates
FROM pairs
GROUP BY change_id
HAVING count(*) > count(DISTINCT pair)
ORDER BY change_id;
change_id | total_pairs | unique_pairs | duplicates
-----------+-------------+--------------+------------
82581 | 40 | 37 | 3
82849 | 88 | 87 | 1
(2 rows)
Those two rows are a false alarm from verify, and Codex read the numbers correctly. 1.0 stores each vanished email once, so rows 82581 and 82849 end up with the same set of entries as in 0.16 and nothing was lost. Verify also compared how many entries each side had, which is why the 3 and 1 duplicates in your query showed up as differences. I’ve changed it to compare the entries themselves, and the fix ships in stalwart-migrate 1.0.5, which goes out today.
--allow-errors can’t accept these two rows, so the run can’t be finalised on 1.0.4. Once 1.0.5 is out, run run --final --allow-errors with the same --state, --source and --target, and it resumes where it stopped. The eight x:SpamTrainingSample rows are the ones we covered in your other topic and get accepted by the same flag.