Summary
Websocket issues with Mattermost 6.0.0: WSClient error on open: Mattermost Websocket client is not ready
Some UI actions (e.g. adding a new board in Boards) are not working and require a page refresh (or changing channel and then coming back to the original one) to fetch updated data, maybe because the underlying websocket connection is not working as intended?
Steps to reproduce
Deploy mattermost 6.0.0 on a microk8s cluster using mattermost operator, standard ingress-nginx and a custom ingress with a wildcard SSL cert provisioned by cert-manager.
Expected behavior
Websocket connection should work.
Observed behavior
After upgrading to Mattermost 6.0.0, I noticed that some websocket errors came up when accessing Boards. More specifically, as soon as I access that I get errors in Chrome’s console
After some time, Boards shows an error as well.
However, it looks like the websocket connection is working as intended when I am on a regular channel (e.g. outside of Boards)
Please see all 3 screenshots here: Mattermost — ImgBB
Being a new user, I cannot post more than 1 pic and 2 links so I grouped them together.
Did anyone encounter similar issues? My custom ingress configuration is pretty standard
Thanks for the detailed report! Can you please check if you have the ServiceSettings.EnableReliableWebSockets server configuration property set to true?
Reliable websockets needs to be enabled for Boards to run properly on v6
Thanks for the info! Can you please post a full log from the browser after refreshing on a board page and another screenshot similar to the one you posted earlier of the websocket messages on this same refresh?
Please also have a look at this video that shows the Boards issues that may be linked to this websocket issue: Mattermost Boards Issue - YouTube (whenever the page flashes white, I was refreshing it manually)
From the frontend logs I’m missing a got connection id X message that gets logged when the websocket connection is initially established. Just to rule the reliable websockets out in case the server is not picking up the configuration, could you please run:
mmctl --local config get ServiceSettings.EnableReliableWebSockets
from one of the nodes of the cluster to see if it comes out true?
Besides that, what’s the browser/client that you’re using to access boards? how are you getting to the board? (from the icon top right of a channel, from the application header, changing to boards, etc)
Anyway, I set the reliablewebsockets option from env now and it looks like it fixed things, as now the Boards UI reacts when I e.g. create a Board, and I also saw the “got connection id X” message in the console. Thanks for pointing me to the mmctl command, I didn’t think about looking there and I only checked the config.json!
Basically, mmctl is telling me that the setting is false, but it is true in config.json.
I now set the settings through the env var MM_SERVICESETTINGS_ENABLERELIABLEWEBSOCKETS and it looks like it fixed things (UI responds to changes and I saw the got connection id X in the logs).
Thanks a lot for pointing me to mmctl, I didn’t think about it and I only looked at the config.json!
Let me know if I can be of further help for troubleshooting this.
Cluster setups tipicaly use the configuration in database feature to share the configuration amongst all the nodes, so that might be a reason why you’re seeing different values in the server config and in the config.json file, which would not be the source of truth anymore. Setting the value through env variables is a perfect long term solution, and you could use mmctl --local config set as well in case you need to modify the configuration again
Just came here because I had the same problem but in my case the solution was to enable reliable websockets in config.json.
I would suggest to mention this in the upgrade docs, because it seems like an important information.