Skip to content

Commit a3b93e5

Browse files
committed
Fix unintialized constant exception handler error
When `gitlab-ctl reconfigure` hits an HTTP error while trying to download local cookbooks, the application runs into an `uninitialized constant GitLabHandler::Exception::OmnibusHelper` error: ``` ERROR: Running exception handlers ERROR: Report handler GitLabHandler::Exception raised #<NameError: uninitialized constant GitLabHandler::Exception::OmnibusHelper> ERROR: /opt/gitlab/embedded/cookbooks/package/libraries/handlers/gitlab.rb:30:in `report' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/handler.rb:296:in `run_report_unsafe' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/handler.rb:284:in `run_report_safely' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/handler.rb:155:in `block in run_exception_handlers' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/handler.rb:153:in `each' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/handler.rb:153:in `run_exception_handlers' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/handler.rb:164:in `block in <class:Handler>' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/client.rb:443:in `block in run_failed' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/client.rb:442:in `each' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/client.rb:442:in `run_failed' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/client.rb:306:in `rescue in run' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/client.rb:299:in `run' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/application.rb:305:in `run_with_graceful_exit_option' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/application.rb:281:in `block in run_chef_client' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/local_mode.rb:42:in `with_server_connectivity' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/application.rb:264:in `run_chef_client' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/application/base.rb:352:in `run_application' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/application.rb:67:in `run' ERROR: /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/chef-bin-17.10.0/bin/cinc-client:25:in `<top (required)>' ERROR: /opt/gitlab/embedded/bin/cinc-client:25:in `load' ERROR: /opt/gitlab/embedded/bin/cinc-client:25:in `<main>' ERROR: Exception handlers complete ``` This was seen in https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16897 and raised as a side issue in https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8245. Changelog: fixed
1 parent 6881a23 commit a3b93e5

File tree

1 file changed

+1
-0
lines changed
  • files/gitlab-cookbooks/package/libraries/handlers

1 file changed

+1
-0
lines changed

files/gitlab-cookbooks/package/libraries/handlers/gitlab.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
require 'chef/handler'
1818
require 'rainbow'
19+
require_relative '../omnibus_helper'
1920

2021
module GitLabHandler
2122
class Exception < Chef::Handler

0 commit comments

Comments
 (0)