Mattermost Peer-to-Peer Forum

Upgraded from 3.7 to 3.8 broke websockets! help!


#21

@jasonblais

  1. Mattermost instance just only one domain, but Nginx reverse proxy server has multi domain with virtual host.
  2. "AllowCorsFrom": "" -> websocket does not work (client 403 error), mattermost instance (websocket connect err: websocket: origin not allowed code=500
  1. "AllowCorsFrom": "domain.com" -> same to “”, websocket does not work (client 403 error), mattermost instance (websocket connect err: websocket: origin not allowed code=500

thanks for your help.


#22

Thanks @mouson for your patience as we try to troubleshoot the issue,

Can you help take a look in the request headers of a request that doesn’t work when you set "AllowCorsFrom": "domain.com" and see what the browser sets?

For example, for https://pre-release.mattermost.com it sets the origin to: Origin: https://pre-release.mattermost.com


#23

@jasonblais

When I set "AllowCorsFrom": "domain.com" and client use chrome (version: 57.0.2987.133) developer tool.

Request header:
Connection: Upgrade
Host: domain.com
Origin: https://domain.com


#24

Thanks @mouson,

Looks like your browser has https://domain.com as the Site URL.

  1. Can you try setting the following
"AllowCorsFrom": "domain.com"
"SiteURL": "https://domain.com"
  1. If the above doesn’t work, does your domain name use any non-English characters?

#25

@jasonblais thanks.

  1. I try to setting
"AllowCorsFrom": "domain.com"
"SiteURL": "https://domain.com"

but that doesn’t work.

  1. my real domain name is discuss.netask.net there is only english characters.

  2. Can you help me modify the code to show origin details info when an error [EROR] websocket connect err: websocket: origin not allowed ?


#26

Hey @mouson, I invited you to our Peer-to-Peer channel at https://pre-release.mattermost.com if you want to troubleshoot the issue.

The origin should send https://discuss.netask.net since that’s the domain name, so we’re not sure yet what the issue might be.

For 3), you would need to add a log line in this function: https://github.com/mattermost/platform/blob/master/utils/api.go#L16


#27

We had the same problem when we switch from 3.7 to 3.8.2.

I had to set AllowCors to * in order to fix it.
Hence we use only one domain this can’t be the real solution (It’s more a workaround).

It looks like you screwed something up.


#28

Hi @makzr,

Thanks for your feedback.

As jasonblais has suggested above, it might be better if you join our daily build server where we can troubleshoot the issue? Once you’ve joined the team, you can join the Peer-to-peer Help channel by clicking on More... at the foot of the public channel list in the left-hand-side.