Test Live Url Fail

i use nginx and mattermost.
and System console->Web Server->Test Live URL is failed.

tail -f logs/mattermost.log
{“level”:“info”,“ts”:1582182872.0400913,“caller”:“cors@v1.7.0/cors.go:356”,“msg”:“Actual request no headers added: origin 'https://xx.xxxx.com not allowed”,“source”:“cors”}
{“level”:“error”,“ts”:1582182902.040658,“caller”:“mlog/log.go:175”,“msg”:“This is not a valid live URL”,“path”:“/api/v4/site_url/test”,“request_id”:“7918j13tuig43ynupt7rqidjew”,“ip_addr”:“xxx.xxx.xxx.xxx”,“user_id”:“3izu85ofrf8hzjisecr8xbzzda”,“method”:“POST”,“err_where”:“testSiteURL”,“http_code”:400,“err_details”:“”}

what is wrong.

Hello there, @walker

An example of a successful test looks like this:

Since the error complains that it is not a valid live URL, can you please confirm the URL that you are using to access Mattermost on your web / desktop app as well as the DNS resolution result either via nslookup or dig command?

Additionally, may I know if it is a public facing instance? If yes, can you share the URL here?

Dear Ahmad,

We are using web to access the server.
This IP is public facing - https://35.196.235.51

These are the DNS results

; <<>> DiG 9.10.3-P4-Debian <<>> 35.196.235.51
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 59527
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;35.196.235.51. IN A
;; AUTHORITY SECTION:
. 86399 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2020041600 1800 900 604800 86400
;; Query time: 33 msec
;; SERVER: 169.254.169.254#53(169.254.169.254)
;; WHEN: Thu Apr 16 08:01:09 UTC 2020
;; MSG SIZE rcvd: 117

Hello, @sysadmintf

Just had this tested on my end and I can confirm that I am seeing the same thing:

{"level":"debug","ts":1587087592.7783213,"caller":"web/handlers.go:85","msg":"Received HTTP request","method":"POST","url":"/api/v4/site_url/test","request_id":"iojeqhhz97dqxbsic8mor44auo"}
{"level":"error","ts":1587087593.2401292,"caller":"mlog/log.go:175","msg":"This is not a valid live URL","path":"/api/v4/site_url/test","request_id":"iojeqhhz97dqxbsic8mor44auo","ip_addr":"10.0.2.2","user_id":"p6djq1dupinx8qjsnqcs94zkbo","method":"POST","err_where":"testSiteURL","http_code":400,"err_details":""}

Looking into this deeper, I can see that we have an issue with the certificate:

May I know if you have a valid FQDN and SSL certificate assigned to this Mattermost instance? For example, https://community.mattermost.com?

Dear Ahmad,

FQDN is not assigned and I am not using SSL certificate for this Mattermost instance.

Dear Ahmad Danial.

My server is not public.

And There is no problem with the domain.
$>dig xx.xxxxx.co.kr

; <<>> DiG 9.10.6 <<>> mm.tbase.co.kr
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41603
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 4

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mm.tbase.co.kr. IN A

;; ANSWER SECTION:
xx.xxxxx.co.kr. 3600 IN A xx.xx.xxx.xx

;; AUTHORITY SECTION:
xx.xxxxx.co.kr. 3600 IN NS ns.xxxx.co.kr.

My server has the following structure.
nigix(ssl:443, vhost) -> mattermost:8065

Hello, @sysadmintf @walker

I can confirm that there is no issue with running dig and nslookup on the domain as I can see the same output on my end as well:

Ahmad-Danials-MacBook-Pro:~ ahmaddanialmohammad$ dig mm.tbase.co.kr

; <<>> DiG 9.10.6 <<>> mm.tbase.co.kr
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10063
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;mm.tbase.co.kr.			IN	A

;; ANSWER SECTION:
mm.tbase.co.kr.		3531	IN	A	15.165.110.58

;; Query time: 15 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Apr 18 00:11:51 +08 2020
;; MSG SIZE  rcvd: 59

Ahmad-Danials-MacBook-Pro:~ ahmaddanialmohammad$ nslookup mm.tbase.co.kr
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	mm.tbase.co.kr
Address: 15.165.110.58

The reason why the Test Live URL is failing is because of the server not publicly available over the internet. If you can run the following command and share the output, that will help me understand the structure of your instance better:

cat /opt/mattermost/config/config.json | grep -A18 "ServiceSettings"

Dear Ahmad,

This the output for cat config.json | grep -A18 “ServiceSettings”

  sysadmin@mattermost-100420-vm:~/apps/mattermost/server/config$ cat config.json | grep -A18 "ServiceSettings"                                           
"ServiceSettings": {
    "SiteURL": "https://35.196.235.51",
    "WebsocketURL": "",
    "LicenseFileLocation": "",
    "ListenAddress": "127.0.0.1:8065",
    "ConnectionSecurity": "",
    "TLSCertFile": "",
    "TLSKeyFile": "",
    "TLSMinVer": "1.2",
    "TLSStrictTransport": false,
    "TLSStrictTransportMaxAge": 63072000,
    "TLSOverwriteCiphers": [],
    "UseLetsEncrypt": false,
    "LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
    "Forward80To443": false,
    "TrustedProxyIPHeader": [
        "X-Forwarded-For",
        "X-Real-IP"
    ],