we are using Mattermost Team Edition 5.37.7.
We have a channel with a lot of messages that we want to delete physically. I tried to use the CLI, but it does not work:
-bash-4.2$ cd /opt/mattermost/bin/ -bash-4.2$ ./mattermost channel delete sjk5gkba9tbef8ffajbcwqfyhr Are you sure you want to delete the channels specified? All data will be permanently deleted? (YES/NO): YES
after 25 minutes, I got:
Unable to delete channel 'cve' error: PermanentDeleteChannel: Unable to delete the posts by channel., failed to delete Posts with channelId=sjk5gkba9tbef8ffajbcwqfyhr: pq: canceling statement due to user request
From the message, I would assume, that the database received a timeout (from the client?) and performs a rollback.
Can anyone help me understanding this issue and how to permanently delete the channel and the messages?
Thanks in advance, Rainer
Yes, the query timed out because it exceeded the
SqlSettings.QueryTimeout setting. Can you mention the value you have set?
I checked the config/config.json - is the mattermost client using this settings?:
Yes, the client uses those settings. I’d suggest to bump your QueryTimeout to 300 for the time being. See if you can delete the channel, and then reduce it back. I am guessing the channel has a lot of posts which is taking a lot of time to scan through.
Many thanks, increasing the timeout to 300 solved my problem and the command has now finished successfully.