DB Error - relation "idx_teams_description" does not exist

I have installed 9.1.1. I’m trying to get mattermost going. There is an error logged in postgress:


017-04-26_22:13:42.46519 ERROR: relation “idx_teams_description” does not exist
2017-04-26_22:13:42.46521 STATEMENT: SELECT $1::regclass

I found that after finding this:


[2017/04/26 14:56:34 PDT] [CRIT] Failed to ping DB err:dial unix /var/opt/gitlab/postgresql/.s.PGSQL.5432: connect: no such file or directory
[2017/04/26 14:56:35 PDT] [CRIT] Failed to ping DB err:dial unix /var/opt/gitlab/postgresql/.s.PGSQL.5432: connect: no such file or directory

Any ideas?

Thanks, Andy

Looks like this idx_teams_description is not a real error.


func (s SqlTeamStore) CreateIndexesIfNotExists() {
s.CreateIndexIfNotExists(“idx_teams_name”, “Teams”, “Name”)
s.RemoveIndexIfExists(“idx_teams_description”, “Teams”)

So it looks like it is just removing an old view. Schema probably changed.

Still need to figure out DB connect error.

Sorry to keep replying to my own post, but maybe it will help someone later.

It looks like there is a race condition in the startup of mattermost. It starts before postgres is up and running:

gitlab-ctl start
ok: run: gitaly: (pid 30725) 0s
ok: run: gitlab-monitor: (pid 30731) 1s
ok: run: gitlab-workhorse: (pid 30734) 0s
ok: run: logrotate: (pid 30749) 1s
ok: run: mattermost: (pid 30755) 0s
ok: run: nginx: (pid 30775) 1s
ok: run: node-exporter: (pid 30795) 0s
ok: run: postgres-exporter: (pid 30801) 0s
ok: run: postgresql: (pid 30826) 1s
ok: run: prometheus: (pid 30828) 0s
ok: run: redis: (pid 30849) 1s
ok: run: redis-exporter: (pid 30882) 0s
ok: run: sidekiq: (pid 30888) 1s
ok: run: unicorn: (pid 30891) 0s

The unix socket /var/opt/gitlab/postgresql/.s.PGSQL.5432 does indeed exist. I see postgres and unicorn have it open.

I tried to figure out the ruby start process, but got lost in the convoluted scripts. I’ve never looked at ruby before. I’m imagine they make perfect sense to a ruby developer. Not me :slight_smile