To fix this add the orgin URL to the config file
eg
"AllowCorsFrom": " your orgin url ",
To find the orgin URL
- Open the browser and open the mattermost URL in the browser
- Press control + shift + i to open the Developer tool
- Go to network in that option

- Now refresh the page

- Click on it and find the orgin server name -> Paste it to the “AllowCrosFrom” and save
- Restart the mattermost service if you running it as a service or if you are running it as a Docker container, then restart the container
It will fix the socket issue