"id": "app.post.permanent_delete_by_user.app_error", "message": "Unable to select the posts to delete for the user.", "detailed_error": "MError:\nfailed to fetch Posts with userId=**TOKEN**: context deadline exceeded\ndriver: bad connection\n2 errors total.\n", "request_id": "qo1hxxcjopydzfbx4zw7ind85h", "status_code": 500
the message context deadline exceeded usually indicates, that the SQL query was running too long and has therefore been intercepted.
It seems as if this user account has quite a lot of posts and therefore the cleanup process might take a while.
You could try to increase the SqlSettings.QueryTimeout value in your server’s config.json (I think the change requires a server restart then) and see if that helps.
Did you track the time that elapses when you start the query until you receive the HTTP 500? If it’s near to the current QueryTimeout setting, this should be a solid guess then.
hard to tell since I don’t know how long the query would run on your system, but set it to 180 for testing purposes and check again if that fixes the problem.
Increasing the timeout doesn’t really hurt if it’s done in a controlled environment.