SOLUTION
The alertmanager configuration stanza suggested in /etc/gitlab/gitlab.rb
is incorrect. Instead of using the hash key ‘alertmanager’ it should read ‘user’.
@@ -1493,9 +1493,9 @@ alertmanager['enable'] = false
# alertmanager['log_directory'] = '/var/log/gitlab/alertmanager'
# alertmanager['admin_email'] = 'admin@example.com'
# alertmanager['flags'] = {
-# 'web.listen-address' => "#{node['gitlab']['alertmanager']['listen_address']}"
-# 'storage.path' => "#{node['gitlab']['alertmanager']['home']}/data"
-# 'config.file' => "#{node['gitlab']['alertmanager']['home']}/alertmanager.yml"
+# 'web.listen-address' => "#{node['gitlab']['user']['listen_address']}",
+# 'storage.path' => "#{node['gitlab']['user']['home']}/data",
+# 'config.file' => "#{node['gitlab']['user']['home']}/alertmanager.yml",
# }
# alertmanager['env_directory'] = '/opt/gitlab/etc/alertmanager/env'
# alertmanager['env'] = {
This is the result of running gitlab-ctl reconfigure
. This first occurred after attempting to upgrade gitlab with apt upgrade gitlab-ee
.
As it stands, my GitLab instance is partially installed; dpkg --configure gitlab-ee
fails and tells me that I need to run gitlab-ctl reconfigure
because a JSON file named for my hostname under /opt/gitlab/embedded/nodes/
is missing attributes. But this error prevents gitlab-ctl reconfigure
from completing, leaving an incomplete JSON file.
Can anybody help me get unstuck?
Starting Chef Client, version 14.13.11
resolving cookbooks for run list: ["gitlab-ee"]
Synchronizing Cookbooks:
- package (0.1.0)
- gitlab-ee (0.0.1)
- gitlab (0.0.1)
- consul (0.1.0)
- runit (4.3.0)
- repmgr (0.1.0)
- postgresql (0.1.0)
- redis (0.1.0)
- monitoring (0.1.0)
- registry (0.1.0)
- mattermost (0.1.0)
- gitaly (0.1.0)
- letsencrypt (0.1.0)
- nginx (0.1.0)
- acme (4.0.0)
- crond (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/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'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb:20: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
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