gitlab-exporter fails when using puma as the Rack server in 13.9
Summary
Referencing Use a different Rack server When using
gitlab_exporter['server_name'] = 'puma'
in gitlab.rb
in 13.9, 13.10 it fails with
2021-04-19_15:38:09.64867 == Sinatra (v2.0.8.1) has taken the stage on 9168 for development with backup from Puma
2021-04-19_15:38:09.64881 == Sinatra has ended his set (crowd applauds)
2021-04-19_15:38:09.65033 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/launcher.rb:166:in `run': uninitialized constant Bundler::ORIGINAL_ENV (NameError)
2021-04-19_15:38:09.65034 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/rack/handler/puma.rb:71:in `run'
2021-04-19_15:38:09.65034 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1526:in `start_server'
2021-04-19_15:38:09.65035 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1460:in `run!'
2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/lib/gitlab_exporter/cli.rb:190:in `run'
2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter:13:in `main'
2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter:19:in `<top (required)>'
2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/bin/gitlab-exporter:23:in `load'
2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/bin/gitlab-exporter:23:in `<main>'
A temporary workaround is to edit
# diff -p /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter.org /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter
*** /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter.org 2021-04-14 09:33:51.000000000 +1000
--- /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter 2021-04-20 11:51:24.711397827 +1000
***************
*** 3,8 ****
--- 3,9 ----
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "rubygems"
+ require "bundler"
require "bundler/setup"
require "optparse"
require "gitlab_exporter"
add require "bundler"
to /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter
Related MR Make Puma an explicit dependency
Steps to reproduce
Add gitlab_exporter['server_name'] = 'puma'
to gitlab.rb
What is the current bug behavior?
gitlab-exporter
fails to start
What is the expected correct behavior?
gitlab-exporter
starts
Relevant logs
Relevant logs
2021-04-19_15:38:09.64867 == Sinatra (v2.0.8.1) has taken the stage on 9168 for development with backup from Puma 2021-04-19_15:38:09.64881 == Sinatra has ended his set (crowd applauds) 2021-04-19_15:38:09.65033 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/launcher.rb:166:in `run': uninitialized constant Bundler::ORIGINAL_ENV (NameError) 2021-04-19_15:38:09.65034 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/rack/handler/puma.rb:71:in `run' 2021-04-19_15:38:09.65034 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1526:in `start_server' 2021-04-19_15:38:09.65035 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1460:in `run!' 2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/lib/gitlab_exporter/cli.rb:190:in `run' 2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter:13:in `main' 2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-exporter-10.0.0/bin/gitlab-exporter:19:in `' 2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/bin/gitlab-exporter:23:in `load' 2021-04-19_15:38:09.65036 from /opt/gitlab/embedded/bin/gitlab-exporter:23:in `'
Details of package version
Provide the package version installation details
# rpm -qa | grep 'gitlab' gitlab-ee-13.9.6-ee.0.el7.x86_64
Environment details
- Operating System: Amazon Linux 2 (using el7 packages)
- Installation Target, remove incorrect values:
- Bare Metal Machine
- VM: AWS
- Installation Type, remove incorrect values:
- New Installation -
13.9.6
- New Installation -
- Is this a single or multiple node installation? single
- Resources
- CPU:
2
- Memory total:
4GB
- CPU:
Configuration details
Provide the relevant sections of `/etc/gitlab/gitlab.rb`
gitlab_exporter['server_name'] = 'puma'
Edited by Alexander Strachan