Migration tool v1.0.4 - are spamTrainingSample errors expected?

Issue Description

I believe I have seen other people talking about this, but I don’t see it mentioned on the Troubleshooting page or what to actually do about these. Must I use --allow-errors to make the migration to v1? Thank you.

$ stalwart-migrate report --state /var/lib/stalwart-migrate --severity error
run    severity category   account    object               id                   message
1      error    skipped    -          x:SpamTrainingSample 323611668557174784   blob eaa75237ff90314b317166c24d1c4f6d16f2f1a1bf086112721ca408c6e9d0c1 is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 323618757702697984   blob e468992101fd6814184eef5a1d6da7aae2378bc19a2970b203882bb53aff6c6d is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 324162511032060928   blob 6603794985da0d3f21a986d302aefda1deed3315da14b7fc28ed1bf2f4b29f1e is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 325874752577115136   blob 80fef43e02712fc54bf389c1ded8e9656a8aecd4f83b3af1290b031fcffe5e8f is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 325923795254882816   blob 9876df10129d7a913319923d6bea4d1d3a683abb29708312314847bbf6d13dc1 is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 327259671532474368   blob 13b627c33bc7a497c46f5a585983b13ee58694d5161fd38a7b83bcd1cc67a9b2 is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 327970427283366400   blob e4ae5fc5967056bd61f7c85c52bfcfce936c068ab752cb94e74f468d95f87d29 is missing in the source; the object was not copied
1      error    skipped    -          x:SpamTrainingSample 328405096238692352   blob b8b80917e08b9c55c9c52d6c426ac49ba3eeed2264646f8a1c5edfabddd490e3 is missing in the source; the object was not copied
8 rows

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.

on

Yes. As the docs describe it, you need --allow-errors to finalise with those rows, and for these particular rows it should be safe.

Error rows make a run fail and stop run --final from finalising. You then have two choices: fix the cause, or accept the errors with --allow-errors. The flag finalises anyway and records the accepted errors, so later verifications take them into account. It only covers errors. Verification mismatches that no earlier report explains still block finalising.

Your rows say each SpamTrainingSample points to a blob that doesn’t exist in the source store. The tool can’t copy a sample whose message body is gone, so it skips the object. The docs don’t say why those blobs are missing. I’d guess they were purged or lost at some point in 0.16, but that’s a guess. Each sample is a stored message used to train the spam classifier, so losing 8 of them should only cost a little training data. It won’t touch mailboxes or user mail. I couldn’t find a way to recover the blobs from the docs. If you can’t restore them from a backup, accepting them as losses is the documented route.

Before you finalise, check that report --severity error shows only these 8 rows. Then run:

stalwart-migrate run --final --allow-errors ...

Use the same arguments as your earlier runs.

Docs:

Your post lists the version as v0.16.x, which is the expected source version for this tool.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Note: I started using Stalwart with v0.16.x

I think this is probably the solution, but would love a confirmation before I move forward with errors on the migration.

Yes, --allow-errors is the right call for these eight rows. A training sample is only input for the spam classifier, and the message it points to is already gone from your 0.16 blob store, so there’s nothing the tool could copy. No mailbox data is involved, and the classifier just has eight fewer samples to learn from.

Once the final run has accepted them, verify still lists the matching x:SpamTrainingSample rows but counts them as explained, so they stop blocking on their own. --allow-errors covers these copy errors only. It won’t accept any other verify mismatch.

@stalwart thank you. I saw in another thread that IMAP import stores the Spam samples differently - I have a lot of IMAP import on my instance. Is it still safe to ignore these 8 errors? Just want to double check.

Yes, it’s still safe. However a message got into 0.16, IMAP import included, the message itself is copied as an email by the mail category, and verify checks it against 0.16 separately. A training sample is a separate small record that points at a message blob and carries a spam or ham label. These eight point at blobs that 0.16 no longer has, so even 0.16 couldn’t train from them any more.

If any imported message had lost its content, the report would show it as a separate row under the account that owns it, not as x:SpamTrainingSample. Your error report has only these eight rows, so none of your mail is affected.