Missing require in letsencrypt subcommand
Summary
if gitlab-ctl renew-le-certs
fails, it can't find the Rainbow
method, used to colourise user output.
Steps to reproduce
With letsencrypt configured and running, run gitlab-ctl renew-le-certs
and have the chef run fail.
You can force the failure with the following hack to point at a recipe that doesn't exist:
diff -u /opt/gitlab/embedded/cookbooks/renew-letsencrypt.json{.orig,}
--- /opt/gitlab/embedded/cookbooks/renew-letsencrypt.json.orig 2018-04-09 08:47:36.521211389 +0000
+++ /opt/gitlab/embedded/cookbooks/renew-letsencrypt.json 2018-04-09 08:48:07.166350210 +0000
@@ -1,5 +1,5 @@
{
"run_list": [
- "recipe[gitlab::letsencrypt_renew]"
+ "recipe[gitlab::letsencrypt_renew_404]"
]
}
What is the current bug behavior?
[chef output snipped]
Chef Client failed. 0 resources updated in 03 seconds
/opt/gitlab/embedded/service/omnibus-ctl/letsencrypt.rb:22:in `block in load_file': undefined method `Rainbow' for #<Omnibus::Ctl:0x0000000001e5d250> (NoMethodError)
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/lib/omnibus-ctl.rb:202:in `block in add_command_under_category'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/lib/omnibus-ctl.rb:730:in `run'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/bin/omnibus-ctl:31:in `<top (required)>'
from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
What is the expected correct behavior?
[chef output snipped]
Chef Client failed. 0 resources updated in 03 seconds
There was an error renewing Let's Encrypt certificates, please checkout the output
Details of package version
ce 10.6.3
# rpm -qa | grep gitlab gitlab-ce-10.6.3-ce.0.el7.x86_64
Not reproducable with 'ee' packages, as 'rainbow' is also loaded via files/gitlab-ctl-commands-ee/lib/geo/promote_to_primary.rb
and files/gitlab-ctl-commands-ee/lib/geo/replication.rb
Edited by Richard Clamp