"Please check connection, Mattermost unreachable" after upgrading to 7.10.3

  • hosting mattermost omnibus in a lxc container ubuntu 22.04
  • nginx reverse proxy in the host
  • everything was perfectly fine with mattermost server 7.10.2
  • after upgrading to 7.10.3 I get the “Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port” error.
  • nginx is correctly set to handle websocket connections as it worked with 7.10.2

Any ideas what might have happened during the upgrade?

If anyone encounters the same problem, this seems to be the issue:

In case of omnibus installation you need to set:

mmctl --local config set ServiceSettings.AllowCorsFrom "*"

Thanks for nothing

1 Like

Hi @contumax and welcome to the Mattermost forums!

Is your SiteUrl maybe wrong? I cannot reproduce that on my Omnibus setup with MM 7.10.3.
Where did you see the message? In the web app or only in one of the clients and if so, which one? Mobile or desktop?

Hi @agriesser, thanks for response.

SiteUrl was the same as in 7.10.2 and previous versions. I saw the message everywhere: in the web app, in the desktop app and a slightly different message in the mobile app (android).

Yes, I don’t doubt that - but maybe it has always been “wrong”? It should point to the exact URL which is used for accessing your server by your clients.
Is your nginx also forwarding the hostname to the backend or do you connect to the backend with an internal dns name (container name f.ex.) or with the IP address?

I use nginx conf from the omnibus installation:

upstream backend {
   server 127.0.0.1:8065;
   keepalive 32;
}

proxy_cache_path /tmp/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

server {

  server_name chat.domain.com;

  error_log   /var/log/nginx/mattermost_error.log;

    # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
  add_header Strict-Transport-Security max-age=15768000;

  location ~ /api/v[0-9]+/(users/)?websocket$ {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      client_max_body_size 50M;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Frame-Options SAMEORIGIN;
      proxy_buffers 256 16k;
      proxy_buffer_size 16k;
      client_body_timeout 60;
      send_timeout 300;
      lingering_timeout 5;
      proxy_connect_timeout 90;
      proxy_send_timeout 300;
      proxy_read_timeout 90s;
      proxy_pass http://backend;
  }

  location ~ /plugins/focalboard/ws/* {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      client_max_body_size 50M;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Frame-Options SAMEORIGIN;
      proxy_buffers 256 16k;
      proxy_buffer_size 16k;
      client_body_timeout 60;
      send_timeout 300;
      lingering_timeout 5;
      proxy_connect_timeout 90;
      proxy_send_timeout 300;
      proxy_read_timeout 90s;
      proxy_pass http://backend;
  }

  location / {
      client_max_body_size 50M;
      proxy_set_header Connection "";
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Frame-Options SAMEORIGIN;
      proxy_buffers 256 16k;
      proxy_buffer_size 16k;
      proxy_read_timeout 600s;
      proxy_cache mattermost_cache;
      proxy_cache_revalidate on;
      proxy_cache_min_uses 2;
      proxy_cache_use_stale timeout;
      proxy_cache_lock on;
      proxy_http_version 1.1;
      proxy_pass http://backend;
  }

    listen [::]:443 ssl ipv6only=on;
    listen 443 ssl;
    # letsencrypt ssl
}
1 Like

Gosh, dude - you just rescued me from this never-ending troubleshooting hell I’ve been stuck in for three days! Thanks a million!

For any others that use tarball manual installation, you can set AllowCorsFrom to "*" in mattermost/config/config.json.

1 Like