After digging deeper in the logs, it seems to me that the collation mentioned by @hmhealey and @Ilya can be responsible:
2021-11-11T14:08:42.138+0100 debug mlog/log.go:230 Failed to insert record to database. {“path”: “/api/v4/users/zsip74njh3bitdo5uj64u47owy/teams/7ysu5473itgqtngty7yk6pxy5h/channels/categories”, “request_id”: “55bwhbdc9pd6xpe7yfg4qqwg1o”, “ip_addr”: “10.195.197.96”, “user_id”: “zsip74njh3bitdo5uj64u47owy”, “method”: “GET”, “err_where”: “GetSidebarCategories”, “http_code”: 404, “err_details”: “resource: SidebarCategories id: userId=zsip74njh3bitdo5uj64u47owy,teamId=7ysu5473itgqtngty7yk6pxy5h”}
And when I try to change the collation with
(...)
alter table SharedChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
alter table SidebarCategories CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
alter table SidebarChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
(...)
I have the errors:
(...)
ERROR 3664 (HY000): Failed to delete SDI 'mattermost.SharedChannels' in tablespace 'mattermost/SharedChannels'.
ERROR 1025 (HY000): Error on rename of './mattermost/SidebarCategories' to './mattermost/#sql2-4ad-ea' (errno: 197 - Tablespace cannot be accessed)
ERROR 1025 (HY000): Error on rename of './mattermost/SidebarChannels' to './mattermost/#sql2-4ad-ea' (errno: 197 - Tablespace cannot be accessed)
(...)
Other tables are correctly altered. What should be the correct syntax?