I’m seeing this same behavior on our Mattermost server after upgrading from 4.2.0 to 4.8.0 so I’m guessing something in that upgrade path has broken this functionality for us, too. File uploads were definitely working the day before the upgrade and previously-uploaded images still download correctly.
I don’t have any solution to this problem but can add a few things that I’ve also observed:
In the Chrome web console, I see a similar message but here it is in detail:
websocket closed
client.js:772 POST https://[hiding my server url]/api/v4/files 502 (Bad Gateway)
helpers.js:34 Uncaught TypeError: n is not a function
at s (helpers.js:34)
at o (file_actions.jsx:28)
at u.callback (client.js:611)
at u.<anonymous> (client.js:436)
at u.a.emit (index.js:133)
at XMLHttpRequest.t.onreadystatechange (client.js:705)
root.jsx:35 POST https://[hiding my server url]/api/v4/logs 502 (Bad Gateway)
websocket_client.jsx:49 websocket re-established connection
I don’t see any error logs in the Mattermost logs at this time. I do, however, see the following in the nginx logs:
2018/04/04 21:48:12 [error] 972#972: *1916 upstream prematurely closed connection while reading response header from upstream, client: 128.208.133.143, server: [hiding my server URL], request: "POST /api/v4/files HTTP/1.1", upstream: "http://127.0.0.1:8065/api/v4/files", host: "[hiding my server URL]"
2018/04/04 21:48:12 [error] 972#972: *1916 connect() failed (111: Connection refused) while connecting to upstream, client: 128.208.133.143, server: [hiding my server URL], request: "POST /api/v4/logs HTTP/1.1", upstream: "http://127.0.0.1:8065/api/v4/logs", host: "[hiding my server URLt]"
As far as I can think, we’re using a pretty vanilla install of Mattermost Enterprise Edition with nginx in front of it. nginx is redirecting all requests over standard HTTP on port 80 to use HTTPS on port 443 and we are using a Let’s Encrypt-generated SSL certificate that appears to be valid according to Symantec’s cert. checker.
I would be happy to provide any further information if anybody has questions that would help troubleshoot or has suggestions for things I should be looking at.