Bug #27357
undefined local variable or method `katello' when running upgrade-mongo-storage-engine
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1731794
Description of problem:
execute MongoDB upgrade by using below command
- satellite-installer --upgrade-mongo-storage-engine
But Mongo DB upgrade get failed with undefined local variable or method `katello' for #<Kafo::HookContext:0x0000000244e920> (NameError).
- satellite-installer --upgrade-mongo-storage-engine
/usr/share/foreman-installer/katello/hooks/pre_validations/30-mongo_storage_engine.rb:36:in `block (4 levels) in load'
: undefined local variable or method `katello' for #<Kafo::HookContext:0x0000000244e920> (NameError)
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hooking.rb:34:in `instance_eval'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hooking.rb:34:in `block (4 levels) in load'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hook_context.rb:16:in `instance_exec'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hook_context.rb:16:in `execute'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hooking.rb:51:in `block in execute'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hooking.rb:49:in `each'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/hooking.rb:49:in `execute'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/kafo_configure.rb:140:in `execute'
from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/kafo_configure.rb:119:in `run'
from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
from /usr/share/gems/gems/kafo-3.0.0/lib/kafo/kafo_configure.rb:163:in `run'
from /usr/sbin/satellite-installer:8:in `<main>'
And Satellite log look like below.
[ INFO 2019-07-19T04:42:51 main] All hooks in group pre_values finished
[ INFO 2019-07-19T04:42:51 main] Running installer with args [["--upgrade-mongo-storage-engine"]]
[ INFO 2019-07-19T04:42:51 main] Executing hooks in group pre_validations
[DEBUG 2019-07-19T04:42:51 main] Hook /usr/share/foreman-installer/katello/hooks/pre_validations/10-check_foreman_proxy_pulp.rb returned nil
[DEBUG 2019-07-19T04:42:51 main] Hook /usr/share/foreman-installer/katello/hooks/pre_validations/12-check_capsule_tar.rb returned nil
[ INFO 2019-07-19T04:42:51 main] Installer finished in 1.66178942 seconds
Version-Release number of selected component (if applicable):
6.6.0 snap 11
How reproducible:
100
Steps to Reproduce:
1. satellite-installer --upgrade-mongo-storage-engine
2.
3.
Actual results:
See above
Expected results:
MongoDB is migrated from MMAPv1 to WiredTiger
Additional info:
Associated revisions
History
#1
Updated by Evgeni Golov over 3 years ago
- Assignee set to Evgeni Golov
- Category set to foreman-installer script
- Subject changed from undefined local variable or method `katello' when running upgrade-mongo-storage-engine to undefined local variable or method `katello' when running upgrade-mongo-storage-engine
- Project changed from Foreman to Installer
#2
Updated by The Foreman Bot over 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman-installer/pull/374 added
#3
Updated by The Foreman Bot over 3 years ago
- Fixed in Releases 1.23.0 added
#4
Updated by Evgeni Golov over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset installer|220b749e223b481761afb32559b56e3a75ce59ea.
#5
Updated by Ewoud Kohl van Wijngaarden over 3 years ago
- Triaged changed from No to Yes
- Fixed in Releases 1.22.1 added
Fixes #27357 - properly check for katello scenario
In ff9143a4a38fd2b0bd35c8103546014effb6b96b we removed the `katello` var
that contained "is this runnining with katello enabled" fact, but only
replaced one of the two uses of said var in the code.
This commit also updates the second place to use
`module_enabled?('katello')` directly