Mattermost, Inc.

[Solved] Initial setup problems with connection to database

I’m following the instructions here. I’m on ubuntu 14.04 server, and it was a fresh install with nothing on it.

When I got to step 8 under “Setup Mattermost Server” and run ./platform I get an error:

[CRIT] Failed to ping db err:dial tcp connection refused
panic: Failed to open sql connection dial tcp connection refused

goroutine 1 [running]:, 0x6, 0xc20800bc88, 0x8, 0xc208054120, 0x5d, 0xa, 0xa, 0x4e0500, 0x95d960)
    /home/travis/gopath/src/ +0x581, 0x0)
    /home/travis/gopath/src/ +0x106
    /home/travis/gopath/src/ +0x15a
    /home/travis/gopath/src/ +0x4d8

goroutine 6 [syscall]:
    /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
    /usr/local/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 7 [chan receive]:, 0x7f4746a23ff0, 0xc20802c008)
    /home/travis/gopath/src/ +0x7a
created by
    /home/travis/gopath/src/ +0x6b

goroutine 8 [select]:·002()
    /home/travis/gopath/src/ +0xa53
created by
    /home/travis/gopath/src/ +0x3da

goroutine 9 [chan receive]:
    /usr/local/go/src/database/sql/sql.go:589 +0x4c
created by database/sql.Open
    /usr/local/go/src/database/sql/sql.go:452 +0x31c

This problem is almost identical to this one, but they just say they were able to fix that first problem, and never said how.

my 5432 port is open;

sudo netstat -tulpn

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0    *               LISTEN      922/sshd        
tcp        0      0*               LISTEN      1028/postgres   
tcp        0      0    *               LISTEN      1121/nginx      
tcp6       0      0 :::22                   :::*                    LISTEN      922/sshd        
tcp6       0      0 ::1:5432                :::*                    LISTEN      1028/postgres   

Any ideas?

Is the db on a different box? can you connect via the psql command?

maybe something like

Hi, thanks for the response. I’m setting up Mattermost all on a single machine, including the db. From the instructions, I set up a postgres user on my machine, and I am able to run psql and connect and view the database.

I am a postgres noob, so I’ll link my pg_hba.conf just to make sure I don’t have something obviously wrong there.

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Can you past in the db connection string in config.json minus the username/pwd ? It looks like it’s trying to connect to I think you can probably have instead. What psql cmd did you run?

Well that was simple enough. I appreciate the help. If I change it to it works fine. I tried that earlier, but I think I tried it when I had another setting incorrect. Thanks again!