Skip to content

GitLab Mattermost on its own server results in reconfigure error on postgresql_extension[pg_trgm]

Summary

Running GitLab Mattermost on its own server results in reconfigure error on postgresql_extension[pg_trgm] which leads to other parts of reconfigure not working.

It is attempting to load extension into a database that does not exist and should not exist

Related to #3102 (closed) & #2670 (closed)

Steps to reproduce

gitlab.rb

external_url 'http://gitlab.example.com'
gitlab_rails['enable'] = false

Run gitlab-ctl reconfigure

What is the current bug behavior?

There was an error running gitlab-ctl reconfigure:

postgresql_extension[pg_trgm] (gitlab::postgresql line 213) had an error: Mixlib::ShellOut::ShellCommandFailed: postgresql_query[enable pg_trgm extension] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/resources/extension.rb line 6) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[enable pg_trgm extension (gitlab-psql)] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/resources/query.rb line 11) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /opt/gitlab/bin/gitlab-psql -d gitlabhq_production -c "CREATE EXTENSION IF NOT EXISTS pg_trgm" ----
STDOUT:
STDERR: psql: FATAL:  database "gitlabhq_production" does not exist
---- End output of /opt/gitlab/bin/gitlab-psql -d gitlabhq_production -c "CREATE EXTENSION IF NOT EXISTS pg_trgm" ----
Ran /opt/gitlab/bin/gitlab-psql -d gitlabhq_production -c "CREATE EXTENSION IF NOT EXISTS pg_trgm" returned 2

What is the expected correct behavior?

Reconfigure should work

Details of package version

Provide the package version installation details

gitlab-ce-10.4.0-ce.0.el7.x86_64

Environment details

  • Operating System: RHEL7.3
  • Installation Target, remove incorrect values:
    • VM on VMWare
  • Installation Type, remove incorrect values:
    • Upgrade from version 10.1
  • Is there any other software running on the machine: no
  • Is this a single or multiple node installation? multi
Edited by Ben Bodenmiller