Problem
Starting with Mattermost v7.8, a stricter origin validation check was introduced for WebSocket connections to improve security. This change can cause connectivity issues when users access Mattermost from different domains/origins than the configured site URL.
Symptoms
Users experiencing this issue will see:
Additionally, the following functionality may be affected:
- Channels and posts not updating in real-time
- Notifications not appearing
- General loss of real-time chat functionality
- Users may need to refresh the page to see new messages
Solution
To resolve this issue, you need to configure Mattermost to allow WebSocket connections from additional origins. Follow these steps, either in your config.json or system console:
Verify Site URL Configuration
Ensure that your Site URL is correctly configured in your Mattermost configuration:
"ServiceSettings": { "SiteURL": "https://your-mattermost-domain.com"}
The Site URL should match the primary domain users use to access Mattermost.
Configure CORS Settings
Add the AllowCorsFrom setting to allow WebSocket connections from additional origins:
"ServiceSettings": { "SiteURL": "https://your-mattermost-domain.com", "AllowCorsFrom": "https://alternative-domain.com https://another-domain.com"}
Important: Replace the example domains with the actual domains your users access Mattermost from. Multiple domains should be separated by spaces.
Restart Mattermost
After making configuration changes, restart your Mattermost server for the changes to take effect:
sudo systemctl restart mattermost
Verify the Fix
Ask affected users to:
- Clear their browser cache and cookies for the Mattermost site
- Refresh the Mattermost page
- Check that real-time features are working (posts updating, notifications appearing)
Additional Resources
For more detailed information about CORS configuration and other integration settings, refer to the official Mattermost documentation:
Comments
Article is closed for comments.