Problem:
Getting below error while we are executing foreman-installer script:
[root@w2dapl0048746 modules]# foreman-installer -i --scenario katello
Traceback (most recent call last):
2: from /sbin/foreman-installer:5:in <main>' 1: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require’
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require': cannot load such file -- kafo (LoadError) 18: from /sbin/foreman-installer:5:in ’
17: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:147:in require' 16: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:158:in rescue in require’
15: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:158:in require' 14: from /usr/local/share/gems/gems/kafo-6.5.0/lib/kafo.rb:3:in <top (required)>’
13: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in require' 12: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in require’
11: from /usr/local/share/gems/gems/kafo-6.5.0/lib/kafo/kafo_configure.rb:17:in <top (required)>' 10: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require’
9: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require' 8: from /usr/local/share/gems/gems/kafo-6.5.0/lib/kafo/configuration.rb:4:in <top (required)>’
7: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require' 6: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require’
5: from /usr/local/share/gems/gems/kafo-6.5.0/lib/kafo/puppet_module.rb:2:in <top (required)>' 4: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require’
3: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require' 2: from /usr/local/share/gems/gems/kafo-6.5.0/lib/kafo/param.rb:3:in <top (required)>’
1: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require' /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require’: cannot load such file – kafo/data_type (LoadError)
Expected outcome:
It suppose to go the interactive mode to select required modules. I am trying to install it in a Rocky 8 server.
What version of Foreman/Katello are you trying to install?
From the kafo version in your stacktrace, you are at most on 3.6, which is already over a year old.
Is this a fresh install or an upgrade?
Just to be sure:
I assume you just installed the release RPMs as well as the Puppet Repo/release RPM, did dnf install foreman-installer-katello and then ran foreman-installer?
Were there any other steps you have taken?
Side note: Is there any specific reason you try to install a release that’s nearly a year old? Only the the two newest versions are usually considered supported, which currently would be 3.9 and 3.8.
Ok currently i am trying with latest versions. But getting same error
[root@xxxxyum.repos.d]# foreman-installer -i --scenario katello --puppet-server true --foreman-proxy-puppet true --puppet-server-ca true --foreman-proxy-puppetca true
Scenarios are being compared, that may take a while…
Traceback (most recent call last):
20: from /sbin/foreman-installer:8:in <main>' 19: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/kafo_configure.rb:54:in run’
18: from /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:140:in run' 17: from /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:140:in new’
16: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/kafo_configure.rb:132:in initialize' 15: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/scenario_manager.rb:127:in check_scenario_change’
14: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/scenario_manager.rb:157:in confirm_scenario_change' 13: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/scenario_manager.rb:117:in show_scenario_diff’
12: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/scenario_manager.rb:217:in load_and_setup_configuration' 11: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:268:in preset_defaults_from_puppet’
10: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:258:in params' 9: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:132:in modules’
8: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:396:in register_data_types' 7: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:396:in each’
6: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:397:in block in register_data_types' 5: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:397:in each’
4: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/configuration.rb:398:in block (2 levels) in register_data_types' 3: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/data_type_parser.rb:37:in register’
2: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/data_type_parser.rb:37:in each' 1: from /usr/share/gems/gems/kafo-7.3.0/lib/kafo/data_type_parser.rb:39:in block in register’
/usr/share/gems/gems/kafo-7.3.0/lib/kafo/data_type.rb:31:in `register_type’: Data type Apache::LogLevel is already registered, cannot be re-registered (ArgumentError)
[root@xxxxxx yum.repos.d]# rpm -qa | grep -i foreman
foreman-installer-3.9.0-1.el8.noarch
foreman-release-3.9.0-1.el8.noarch
foreman-installer-katello-3.9.0-1.el8.noarch
[root@xxxxxx yum.repos.d]#
This is at least a new error.
The most obvious thing I see is, that foreman-installer thinks you are changing scenarios. Did you try to run it with a different scenario before? Does the symlink /etc/foreman-installer/scenarios.d/last_scenario.yaml exist and if so, which file does it link to?
It looks like you might have ran foreman-installer without --scenario katello in the past (or at least you system seems to think so). You do not have any running Foreman services and foreman-installer never went through on anything, right? If yes, try removing the last_scenario.yaml via unlink /etc/foreman-installer/scenarios.d/last_scenario.yaml. I guess that should be save if the installer never got to do something productive. If that does not help, or if you had actually run foreman-installer before without the Katello scenario, I would suggest reinstalling your system.
Switching scenarios (like it tries to) is technichaly possible for kafo (the framework used in foreman-installer), but for Foreman it is not supported and probably not tested.