We're Hiring!

Mattermost, Inc.

Posgres New Install on Ubuntu 20.04 - Failed to Ping DB

I’m still having notification issues despite my other ticket trying to resolve that. In my latest attempt, I’m just going to rebuild Mattermost from scratch but this time keeping the SQL database local and using Postgres instead of MySQL to try and eliminate any possible duplicate issues.

Install has gone fine, no errors for either the Postgres installer or anything else. I’m going through the guide on MM’s site. As soon as I go to do the initial startup to finish up setup, I get this:

{“level”:“info”,“ts”:1617035011.356926,“caller”:“app/server.go:230”,“msg”:“Server is initializing…”,“go_version”:“go1.15.5”}
{“level”:“info”,“ts”:1617035011.3571055,“caller”:“app/web_hub.go:83”,“msg”:“Starting websocket hubs”,“number_of_hubs”:8}
{“level”:“info”,“ts”:1617035011.3588688,“caller”:“utils/i18n.go:91”,“msg”:“Loaded system translations”,“for locale”:“en”,“from locale”:"/opt/mattermost/i18n/en.json"}
{“level”:“info”,“ts”:1617035011.367739,“caller”:“sqlstore/store.go:255”,“msg”:“Pinging SQL”,“database”:“master”}
{“level”:“error”,“ts”:1617035011.3719404,“caller”:“sqlstore/store.go:267”,“msg”:“Failed to ping DB”,“error”:“dial tcp: lookup 0E: Temporary failure in name resolution”,“retrying in seconds”:10}
{“level”:“info”,“ts”:1617035021.3722568,“caller”:“sqlstore/store.go:255”,“msg”:“Pinging SQL”,“database”:“master”}
{“level”:“error”,“ts”:1617035021.3744595,“caller”:“sqlstore/store.go:267”,“msg”:“Failed to ping DB”,“error”:“dial tcp: lookup 0E: Temporary failure in name resolution”,“retrying in seconds”:10}
{“level”:“info”,“ts”:1617035031.374606,“caller”:“sqlstore/store.go:255”,“msg”:“Pinging SQL”,“database”:“master”}
{“level”:“error”,“ts”:1617035031.3769426,“caller”:“sqlstore/store.go:267”,“msg”:“Failed to ping DB”,“error”:“dial tcp: lookup 0E: Temporary failure in name resolution”,“retrying in seconds”:10}

I’ve opened the port in the firewall despite it all being local. I made sure the cluster was started. I’ve searched and done every single suggestion i found regarding the error and no changes. Is this because i’m on Postgres 12? I’m just really confused why i’m having this issue on a clean install.

Config file for the SQL settings look like:

“SqlSettings”: {
“DriverName”: “postgres”,
“DataSource”: “postgres://mmadmin:pwdwithspeccharacters@127.0.0.1:5432/mattermost?sslmode=disable\u0026connect_timeout=10”,
“DataSourceReplicas”: ,
“DataSourceSearchReplicas”: ,
“MaxIdleConns”: 20,
“ConnMaxLifetimeMilliseconds”: 3600000,
“ConnMaxIdleTimeMilliseconds”: 300000,
“MaxOpenConns”: 300,
“Trace”: false,
“AtRestEncryptKey”: “w95kz87q8i7sywjeepab7rdwp5yj9z9e”,
“QueryTimeout”: 30,
“DisableDatabaseSearch”: false
},

Am I missing something?

If I can ask, can you confirm that you followed these instructions when you configured the Postgres database to work with Mattermost? Here’s the link:

https://docs.mattermost.com/install/install-ubuntu-1604-postgresql.html

yes that’s the exact guid i used

well, it was the guide from mattermost but for Ubuntu 20.04

And can you confirm that this is done correctly as well?

This

seems to be showing that you have a \u0026 in your postgres configuration line, which I don’t think is supposed to be there. Can you check and see if that is correct, or if it needs to be removed?

yes that’s what i used. What’s interesting is that’s happening automatically. That is actually the “&” symbol and as soon as i save the file that’s what it does.

1 Like

@ahmaddanial could this (see quote below) be a potential error in the parsing and writing of the configuration file by Mattermost? Or would you think it more likely that it is a system-level issue?

Hi, @XxLilBoPeepsxX

The & symbol should not be an issue as mine works perfectly fine.

"DataSource": "postgres://<username>:<password>@<url>:5432/mattermost?sslmode=disable\u0026connect_timeout=10",

The error that we see here - Temporary failure in name resolution could be related to your DNS. Can you please check on the following article to see if it helps?

This involves the steps to ensure that the DNS resolver is writable - sudo chmod o+r /etc/resolv.conf and temporarily changing your DNS to use Google’s nameserver 8.8.8.8. For example:

Let me know how it goes on your end. Thanks.

1 Like

To simplify it i just ended up going forward with a MySQL instance local instead of the Postgres.