[Solved] 504 error code in new install

I am getting an error pretty much on everything I do within mattermost.
We received an unexpected status code from the server (504)

I set everything up using this link ( https://github.com/mattermost/platform/blob/master/doc/install/Production-RHEL7.md ).

I am able to log in, and add text to different channels, add different channels, but when I try to make any changes in the control panel, or try to add anyone new in, I get this error.

I am also getting email errors

[2016/01/18 05:56:27 UTC] [EROR] SMTP server settings do not appear to be configured properly err=Failed to open TLS connection details=dial tcp 23.21.91.54:465: getsockopt: connection timed out

The mattermost server doesn’t send a 504 error. This appears to be coming from your proxy. Are you using nginx? Can you look in those logs for any corresponding errors?

10.5.5 504 Gateway Timeout

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.

      Note: Note to implementors: some deployed proxies are known to
      return 400 or 500 when DNS lookups time out.

Thanks for the reply!

I am using nginx, and this is what I am getting in the nginx error.log.

2016/01/19 06:54:36 [error] 28121#0: *37 upstream timed out (110: Connection timed out) while reading response header from upstream, client: XXX.XXX.67.2, server: 10.240.0.3, request: “POST /api/v1/admin/save_config HTTP/1.1”, upstream: “http://10.240.0.3:8065/api/v1/admin/save_config”, host: “XXX.XXX.137.82”, referrer: “http://XXX.XXX.137.82/admin_console/team_settings/?session_token_index=0

I found this site here that suggested upping the timeout for read proxy in nginx, but that just took longer to error :slightly_smiling:

hmm…not sure why saving settings in the system console would be failing. Is the directory that contains config.json and the file itself writeable by the process that’s running mattermost? Can you upload images successfully? That saves files locally too. You can always edit the config.json by hand, but there is still something wrong with your install, just not sure what it is.

yeah, I was able to upload files without issue.

I turned off email sending, and I stopped getting this error. and as soon as I turned it on, it came back. I was using the email settings in the matttermost install doc, but maybe I will try some different setting, since those didn’t work anyways.

Just to wrap this up, as soon as tried different settings, everything worked fine.