Original report here: https://forum.mattermost.org/t/user-delete-no-longer-working-in-5-29-0/10829
It looks like the error comes from the post store, when the user threads are being cleaned before user deletion. It looks like the instance doesn't have a `threads` table created, which could be the culprit of the error.
I don’t think it’s an actual bug, but an issue with user’s installations. This should be triaged
well I think you can close it. Looks like I perhaps missed an upgrade which would have changed the database and therefore that threads table was missing. I did now upgrade to Mattermost 5.30.1 and afterwards did upgrade the PostgreSQL database from 9.4 step by step to the actual 13 (13.1) with database dumps, initialization of new databases and re-import of the dumps and now the threads table does exist and I could sucessfully delete the users with mmctl.