Foreman-installer fails when using --scenario katello

Problem:
Running foreman-installer --scenario katello fails with:

/usr/share/gems/gems/kafo-6.4.0/lib/kafo/data_type.rb:31:in 'register_type': Data type Apache::LogLevel is already registered, cannot be re-registered (ArgumentError)

Expected outcome:
foreman-installer completes without error.

Foreman and Proxy versions:
3.1.1-1

Foreman and Proxy plugin versions:

Distribution and version:
Alma Linux 8.5

Other relevant data:
I originally successfully installed Foreman without Katello, including the Chef plugin (we’re a long-time Chef shop). Our successful install script is:

foreman-installer \
--enable-foreman-plugin-chef \
--enable-foreman-plugin-tasks \
--enable-foreman-proxy-plugin-chef \
--foreman-proxy-plugin-chef-client-name="boss" \
--foreman-proxy-plugin-chef-enabled="true" \
--foreman-proxy-plugin-chef-private-key="/etc/chef/client.pem" \
--foreman-proxy-plugin-chef-server-url="https://manage.chef.io/organizations/..." \
--foreman-proxy-plugin-chef-ssl-verify="true" \
--foreman-proxy-plugin-chef-ssl-pem-file="/etc/letsencrypt/live/..." \
--foreman-proxy-plugin-chef-version="present" \
--foreman-proxy-foreman-ssl-ca="/etc/letsencrypt/live/..." \
--foreman-proxy-foreman-ssl-cert="/etc/letsencrypt/live/..." \
--foreman-proxy-foreman-ssl-key="/etc/letsencrypt/live/..." \
--foreman-client-ssl-cert="/etc/letsencrypt/live/..." \
--foreman-client-ssl-key="/etc/letsencrypt/live/..." \
--foreman-client-ssl-ca="/etc/letsencrypt/live/..." \
--no-enable-puppet \
--foreman-server-ssl-crl=""

We subsequently realized we want to install Katello, so I’ve uninstalled Foreman, and am trying to reinstall it, adding --scenario katello to the script. But that fails with the error listed above. It even fails with a simple --help:

# foreman-installer --scenario katello --help
Traceback (most recent call last):
	18: from /usr/sbin/foreman-installer:8:in `<main>'
	17: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:50:in `run'
	16: from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
	15: from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `new'
	14: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:157:in `initialize'
	13: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:316:in `set_parameters'
	12: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/scenario_manager.rb:217:in `load_and_setup_configuration'
	11: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:268:in `preset_defaults_from_puppet'
	10: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:258:in `params'
	 9: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:132:in `modules'
	 8: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:396:in `register_data_types'
	 7: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:396:in `each'
	 6: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:397:in `block in register_data_types'
	 5: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:397:in `each'
	 4: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:398:in `block (2 levels) in register_data_types'
	 3: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/data_type_parser.rb:20:in `register'
	 2: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/data_type_parser.rb:20:in `each'
	 1: from /usr/share/gems/gems/kafo-6.4.0/lib/kafo/data_type_parser.rb:22:in `block in register'
/usr/share/gems/gems/kafo-6.4.0/lib/kafo/data_type.rb:31:in `register_type': Data type Apache::LogLevel is already registered, cannot be re-registered (ArgumentError)

I don’t understand where Apache::LogLevel is already registered, and how to either unregister it, or tell foreman-installer to ignore it.

2 Likes

Have you solved it now?

When i try to reinstall Foreman for to install Katello. I met the same problme even if I don’t uninstall Foreman .

And I want to know how you to uninstalled Foreman?
I saw that the “katello-remove” command has been removed in this red hat solution :How to remove/uninstall pulp and foreman from Red Hat Satellite v 6 server? - Red Hat Customer Portal

Can somebody address this concern? I also encountered this error. Does this mean that scenarios/plugins should be specified before installing foreman?

You can add plugins after the fact, but you can’t easily switch scenarios, no.

Is there a guide to add katello as a plugin? Thanks for the response as well!

For Katello, no. While it is technically possible to add Katello after the fact, we don’t recommend (or document) that right now.
The deployment is just too different.

1 Like

Katello must be installed at the same time as Foreman. If you’ve already installed Foreman without Katello, you should start over. :wink:

2 Likes

Thank you for the responses. This will clear the issue on installing foreman with katello.