Skip to content

"gitlab-ctl show-config" command is broken on 18.4

Summary

A customer reported that gitlab-ctl show-config is broken after they upgraded from 18.3.1 to 18.4.1, with error:

There was an error running gitlab-ctl reconfigure:
uninitialized constant Gitlab::GitlabShell

They confirmed they get the same error on another instance, and even when they created a new instance with 18.4.1.

I was able to reproduce the issue by upgrading my test instance from 18.3.1 to 18.4.1

Steps to reproduce

  1. install

What is the current bug behavior?

running gitlab-ctl show-config fails

What is the expected correct behavior?

running gitlab-ctl show-config should work normally

Relevant logs and/or screenshots

$ gitlab-ctl show-config

Output

Cinc Client, version 18.3.0
Patents: https://www.chef.io/patents
Infra Phase starting
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/ffi-yajl-2.6.0/lib/ffi_yajl/encoder.rb:42: warning: undefining the allocator of T_DATA class FFI_Yajl::Ext::Encoder::YajlGen
Resolving cookbooks for run list: ["package::show_config"]
Synchronizing cookbooks:
  - package (0.1.0)
  - runit (5.1.7)
Installing cookbook gem dependencies:
Compiling cookbooks...
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/selinux_distro_helper.rb:2: warning: already initialized constant SELinuxDistroHelper::REDHAT_RELEASE_FILE
/opt/gitlab/embedded/cookbooks/package/libraries/helpers/selinux_distro_helper.rb:2: warning: previous definition of REDHAT_RELEASE_FILE was here
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/selinux_distro_helper.rb:3: warning: already initialized constant SELinuxDistroHelper::OS_RELEASE_FILE
/opt/gitlab/embedded/cookbooks/package/libraries/helpers/selinux_distro_helper.rb:3: warning: previous definition of OS_RELEASE_FILE was here
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/secrets_helper.rb:4: warning: already initialized constant SecretsHelper::SECRETS_FILE
/opt/gitlab/embedded/cookbooks/package/libraries/helpers/secrets_helper.rb:4: warning: previous definition of SECRETS_FILE was here
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/secrets_helper.rb:5: warning: already initialized constant SecretsHelper::SECRETS_FILE_CHEF_ATTR
/opt/gitlab/embedded/cookbooks/package/libraries/helpers/secrets_helper.rb:5: warning: previous definition of SECRETS_FILE_CHEF_ATTR was here
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/secrets_helper.rb:6: warning: already initialized constant SecretsHelper::SKIP_GENERATE_SECRETS_CHEF_ATTR
/opt/gitlab/embedded/cookbooks/package/libraries/helpers/secrets_helper.rb:6: warning: previous definition of SKIP_GENERATE_SECRETS_CHEF_ATTR was here
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/gitlab_cluster.rb:16: warning: already initialized constant GitlabCluster::CONFIG_PATH
/opt/gitlab/embedded/cookbooks/package/libraries/gitlab_cluster.rb:16: warning: previous definition of CONFIG_PATH was here
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/gitlab_cluster.rb:17: warning: already initialized constant GitlabCluster::JSON_FILE
/opt/gitlab/embedded/cookbooks/package/libraries/gitlab_cluster.rb:17: warning: previous definition of JSON_FILE was here
Loading Cinc Auditor profile files:
Loading Cinc Auditor input files:
Loading Cinc Auditor waiver files:

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

NameError
---------
uninitialized constant Gitlab::GitlabShell

Cookbook Trace: (most recent call first)
----------------------------------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config/gitlab.rb:96:in `block (2 levels) in <module:Gitlab>'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:260:in `handler'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:182:in `block in generate_secrets'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:181:in `each'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:181:in `generate_secrets'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:203:in `generate_config'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/recipes/show_config.rb:22:in `from_file'

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

 89:      ee_attribute('geo_secondary', priority: 20).use { GeoSecondary }
 90:      ee_attribute('geo_logcursor')
 91:      ee_attribute('sentinel').use { Sentinel }
 92:      ee_attribute('suggested_reviewers').use { SuggestedReviewers }
 93:  
 94:      # Base GitLab attributes
 95:      attribute('gitlab_sshd',      priority: 5)
 96>>     attribute('gitlab_shell',     priority: 10).use { GitlabShell } # Parse shell before rails for data dir settings
 97:      attribute('gitlab_rails',     priority: 15).use { GitlabRails } # Parse rails first as others may depend on it
 98:      attribute('gitlab_workhorse', priority: 20).use { GitlabWorkhorse }
 99:      attribute('logging',          priority: 20).use { Logging }
100:      attribute('unicorn',          priority: 20)
101:      attribute('puma',             priority: 20).use { Puma }
102:      attribute('mailroom',         priority: 20).use { IncomingEmail }
103:      attribute('storage_check',    priority: 30).use { StorageCheck }
104:      attribute('nginx',            priority: 40).use { Nginx } # Parse nginx last so all external_url are parsed before it
105:      attribute('git_data_dirs',           default: ConfigMash.new)

System Info:
------------
chef_version=18.3.0
platform=ubuntu
platform_version=20.04
ruby=ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/cinc-client
executable=/opt/gitlab/embedded/bin/cinc-client


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

NameError
---------
uninitialized constant Gitlab::GitlabShell

Cookbook Trace: (most recent call first)
----------------------------------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config/gitlab.rb:96:in `block (2 levels) in <module:Gitlab>'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:260:in `handler'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:182:in `block in generate_secrets'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:181:in `each'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:181:in `generate_secrets'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:203:in `generate_config'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/recipes/show_config.rb:22:in `from_file'

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

 89:      ee_attribute('geo_secondary', priority: 20).use { GeoSecondary }
 90:      ee_attribute('geo_logcursor')
 91:      ee_attribute('sentinel').use { Sentinel }
 92:      ee_attribute('suggested_reviewers').use { SuggestedReviewers }
 93:  
 94:      # Base GitLab attributes
 95:      attribute('gitlab_sshd',      priority: 5)
 96>>     attribute('gitlab_shell',     priority: 10).use { GitlabShell } # Parse shell before rails for data dir settings
 97:      attribute('gitlab_rails',     priority: 15).use { GitlabRails } # Parse rails first as others may depend on it
 98:      attribute('gitlab_workhorse', priority: 20).use { GitlabWorkhorse }
 99:      attribute('logging',          priority: 20).use { Logging }
100:      attribute('unicorn',          priority: 20)
101:      attribute('puma',             priority: 20).use { Puma }
102:      attribute('mailroom',         priority: 20).use { IncomingEmail }
103:      attribute('storage_check',    priority: 30).use { StorageCheck }
104:      attribute('nginx',            priority: 40).use { Nginx } # Parse nginx last so all external_url are parsed before it
105:      attribute('git_data_dirs',           default: ConfigMash.new)

System Info:
------------
chef_version=18.3.0
platform=ubuntu
platform_version=20.04
ruby=ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/cinc-client
executable=/opt/gitlab/embedded/bin/cinc-client


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

uninitialized constant Gitlab::GitlabShell

Running handlers complete
Infra Phase failed. 0 resources updated in 05 seconds
[2025-10-02T07:35:11+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/cinc-stacktrace.out
[2025-10-02T07:35:11+00:00] FATAL: ---------------------------------------------------------------------------------------
[2025-10-02T07:35:11+00:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2025-10-02T07:35:11+00:00] FATAL: ---------------------------------------------------------------------------------------
[2025-10-02T07:35:11+00:00] FATAL: NameError: uninitialized constant Gitlab::GitlabShell

The stacktrace:

Generated at 2025-10-02 07:35:11 +0000
NameError: uninitialized constant Gitlab::GitlabShell
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config/gitlab.rb:96:in `block (2 levels) in <module:Gitlab>'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:260:in `handler'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:182:in `block in generate_secrets'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:181:in `each'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:181:in `generate_secrets'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/settings_dsl.rb:203:in `generate_config'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/recipes/show_config.rb:22:in `from_file'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/mixin/from_file.rb:34:in `instance_eval'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/mixin/from_file.rb:34:in `from_file'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/cookbook_version.rb:233:in `load_ruby_recipe'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/cookbook_version.rb:203:in `load_recipe'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/run_context.rb:429:in `load_recipe'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/run_context/cookbook_compiler.rb:228:in `block in compile_recipes'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/run_context/cookbook_compiler.rb:225:in `each'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/run_context/cookbook_compiler.rb:225:in `compile_recipes'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/run_context/cookbook_compiler.rb:109:in `compile'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/run_context.rb:259:in `load'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/policy_builder/expand_node_object.rb:103:in `setup_run_context'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/forwardable-1.3.3/lib/forwardable.rb:240:in `setup_run_context'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/client.rb:499:in `setup_run_context'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/client.rb:294:in `run'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/application.rb:305:in `run_with_graceful_exit_option'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/application.rb:281:in `block in run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/local_mode.rb:42:in `with_server_connectivity'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/application.rb:264:in `run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/application/base.rb:354:in `run_application'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-18.3.0/lib/chef/application.rb:67:in `run'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/chef-bin-18.3.0/bin/cinc-client:25:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/site_ruby/3.2.0/rubygems.rb:319:in `load'
/opt/gitlab/embedded/lib/ruby/site_ruby/3.2.0/rubygems.rb:319:in `activate_and_load_bin_path'
/opt/gitlab/embedded/bin/cinc-client:25:in `<main>'

Possible fixes

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by 🤖 GitLab Bot 🤖