Skip to content

Upgrading 12.0.3 to 12.1 fails

Summary

Upgrading 12.0.3-ce (ubuntu-bionic) to 12.1.0-ce (ubuntu-bionic) fails

Installing Cookbook Gems:
Compiling Cookbooks...

================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.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'

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 arguments 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=14.13.11
platform=ubuntu
platform_version=18.04
ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client

Workaround

If you're experiencing this failure, and supplying alertmanager['flags'] or prometheus['flags'] in gitlab.rb, please make the following modifications:

  • node['gitlab']['alertmanager'] => node['monitoring']['alertmanager']
  • node['gitlab']['prometheus'] => node['monitoring']['prometheus']
Edited by Jason Plum