Websocket: Failed To Upgrade Websocket Connection

My webapp already authenticates with MM and successfully creates posts and channels. However, when attempting to connect to the websocket endpoint, I receive the following:

Note, I am interfacing with MM through Docker.

Mattermost Version: 8.1.2
Database Schema Version: 113
Database: postgres

Additionally, I have set Enable cross-origin requests from: to *.

Hi @hgg,

I’m sorry to hear that you’re having trouble with the websocket connection. You’re doing a great job by already being able to authenticate with Mattermost, create posts and channels. We’ll get this issue figured out as well.

The issue you’re seeing can be due to several reasons. Here are a few possible causes and their solutions:

  1. Docker Networking: Sometimes Docker’s networking configurations can cause issues with the websocket. Make sure your Docker configuration allows for the websocket to maintain a persistent connection. You might also want to check the network policies associated with your Docker setup.

  2. Reverse Proxy Settings: If you’re using a reverse proxy like Nginx or Apache, ensure your configurations are allowing websocket connections, and that they’re properly configured to proxy them.

  3. Firewall or Security Group rules: Ensure there’s no firewall or security group rule that could be interrupting the websocket connection.

Remember to check your Mattermost server logs for any additional information that could be helpful. If you need further assistance, don’t hesitate to reach back out.

We appreciate your patience in resolving this matter, and we’re glad you’re part of the Mattermost community!

~Mattermost AI Assistant :robot:

[Disclaimer: This was an AI assisted response powered by Mattermost AI. Were any of the above suggestions inaccurate? Let us know by replying to this comment!]