Skip to content

Fix typo in `pgbouncer-exporter` in gitlab.rb template

Michael Bisbjerg requested to merge LordMike/omnibus-gitlab:patch-1 into master

If I explicitly set pgbouncer-exporter['enable'] = false in a Gitlab CE Omnibus setup, the gitlab-ctl reconfigure fails. This seems like a typo in the config, as all other options are with underscores. Changing it to pgbouncer_exporter['enable'] = false works (although, given it's CE, it probably changes nothing).

gitlab-ctl reconfigure where config file contains pgbouncer-exporter:

# gitlab-ctl reconfigure
Starting Chef Client, version 13.6.4
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
  - postgresql (0.1.0)
  - gitlab (0.0.1)
  - registry (0.1.0)
  - mattermost (0.1.0)
  - package (0.1.0)
  - gitaly (0.1.0)
  - consul (0.0.0)
  - nginx (0.1.0)
  - letsencrypt (0.1.0)
  - runit (0.14.2)
  - acme (3.1.0)
  - crond (0.1.0)
  - compat_resource (12.19.0)
Installing Cookbook Gems:
Compiling Cookbooks...

================================================================================
  ERROR: Encountered unsupported config key 'exporter' in /etc/gitlab/gitlab.rb.
================================================================================

================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `[]=' for nil:NilClass

Cookbook Trace:
---------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:100:in `block in from_file'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config_mash.rb:28:in `auto_vivify'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:100:in `from_file'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:23:in `from_file'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in `from_file'

Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:

 93:    def ee_attribute(name, **config)
 94:      config = { ee: true }.merge(config)
 95:      attribute(name, **config)
 96:    end
 97:
 98:    def from_file(_file_path)
 99:      # Allow auto mash creation during from_file call
100>>     Gitlab::ConfigMash.auto_vivify { super }
101:    end
102:
103:    def method_missing(method_name, *arguments) # rubocop:disable Style/MethodMissing
104:      # Give better message for NilClass errors
105:      # If there are no arguements passed, this is a 'GET' call, and if
106:      # there is no matching key in the configuration, then it has not been set (not even to nil)
107:      # and we will output a nicer error above the exception
108:      if arguments.length.zero? && !configuration.key?(method_name)
109:        breaktxt = '=' * 80

System Info:
------------
chef_version=13.6.4
platform=ubuntu
platform_version=16.04
ruby=ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client


Running handlers:
There was an error running gitlab-ctl reconfigure:

undefined method `[]=' for nil:NilClass

Running handlers complete
Chef Client failed. 0 resources updated in 02 seconds

I run Gitlab CE v. 11.2.3.

Edited by GitLab Release Tools Bot

Merge request reports