Erro mattermost logs database external

The following error is being presented in mattermost logs

2015-11-03_20:17:36.13461 panic: Failed to open sql connection dial unix /var/opt/gitlab/postgresql/.s.PGSQL.5432: no such file or directory
2015-11-03_20:17:36.13467
2015-11-03_20:17:36.13469 goroutine 1 [running]:
2015-11-03_20:17:36.13472 github.com/mattermost/platform/store.setupConnection(0xb4ee10, 0x6, 0xc20802bb48, 0x8, 0xc20800c120, 0x5d, 0xa, 0xa, 0x0, 0xc2080c85d0)
2015-11-03_20:17:36.13473 /home/travis/gopath/src/github.com/mattermost/platform/store/sql_store.go:160 +0x581
2015-11-03_20:17:36.13474 github.com/mattermost/platform/store.NewSqlStore(0x0, 0x0)
2015-11-03_20:17:36.13475 /home/travis/gopath/src/github.com/mattermost/platform/store/sql_store.go:52 +0x106
2015-11-03_20:17:36.13476 github.com/mattermost/platform/api.NewServer()
2015-11-03_20:17:36.13482 /home/travis/gopath/src/github.com/mattermost/platform/api/server.go:33 +0x15a
2015-11-03_20:17:36.13483 main.main()
2015-11-03_20:17:36.13484 /home/travis/gopath/src/github.com/mattermost/platform/mattermost.go:55 +0x4d8
2015-11-03_20:17:36.13485
2015-11-03_20:17:36.13486 goroutine 6 [syscall]:
2015-11-03_20:17:36.13487 os/signal.loop()
2015-11-03_20:17:36.13490 /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
2015-11-03_20:17:36.13492 created by os/signal.initĀ·1
2015-11-03_20:17:36.13493 /usr/local/go/src/os/signal/signal_unix.go:27 +0x35
2015-11-03_20:17:36.13494
2015-11-03_20:17:36.13495 goroutine 7 [chan receive]:
2015-11-03_20:17:36.13496 database/sql.(*DB).connectionOpener(0xc20805d720)
2015-11-03_20:17:36.13497 /usr/local/go/src/database/sql/sql.go:589 +0x4c
2015-11-03_20:17:36.13498 created by database/sql.Open
2015-11-03_20:17:36.13499 /usr/local/go/src/database/sql/sql.go:452 +0x31c

Database postgres
Version 8.1.2
RHEL 6.6

solution:

Use the following syntax in gitlab.rb

mattermost[ā€˜sql_driver_nameā€™] = ā€˜postgresā€™
mattermost[ā€˜sql_data_sourceā€™] = ā€œ**postgres://**mmuser:mmuser_password@10.10.10.1:5432/mattermost?sslmode=disable&connect_timeout=10ā€
mattermost[ā€˜sql_data_source_replicasā€™] = [ā€œ**postgres://**mmuser:mmuser_password@10.10.10.1:5432/mattermost?sslmode=disable&connect_timeout=10ā€]
mattermost[ā€˜sql_max_idle_connsā€™] = 10
mattermost[ā€˜sql_max_open_connsā€™] = 10
mattermost[ā€˜sql_traceā€™] = true

1 Like