New foreman/katello install failed - rake aborted!

foreman-installer --interactive --scenario katello

ERROR 2019-04-16T11:59:13 main] Execution of ‘/usr/sbin/foreman-rake – config -k ‘puppetdb_dashboard_address’ -v ‘http://localhost:8080/pdb/dashboard’’ returned 1: /usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP

(Many ERRORs follow …)

[root@foreman10125 ~]# foreman-rake SmartProxy.pulp_master
/usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
rake aborted!
Don’t know how to build task ‘SmartProxy.pulp_master’ (see --tasks)
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>’
(See full trace by running task with --trace)

Any ideas?

Additional info:

CentOS 7 - Minimal on a VM:
foreman 1.20.1
puppet 5.5.10
katello 3.10.0

rake aborted!
NoMethodError: undefined method settings_type' for nil:NilClass /usr/share/foreman/lib/tasks/config.rake:105:inblock in run_key_values’
/usr/share/foreman/lib/tasks/config.rake:100:in each' /usr/share/foreman/lib/tasks/config.rake:100:inrun_key_values’
/usr/share/foreman/lib/tasks/config.rake:77:in run' /usr/share/foreman/lib/tasks/config.rake:167:inblock in <top (required)>’
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>’
Tasks: TOP => config
(See full trace by running task with --trace)

One more question:
What command do I run with the --trace option?

It’s not part of foreman-installer, nor foreman-rake.

This command failed and you want to run it manually in order to see what error it gives. but I think you mispasted it I do not see matching quotes correctly and I am not sure if it is complete. Maybe @ekohl knows more details for this puppet step.

I wonder if the puppetdb plugin actually broke. Which version of that plugin do you have installed right now?

The actual error returned was this:

[ERROR 2019-04-16T11:59:13 main] /Stage[main]/Foreman::Plugin::Puppetdb/Foreman_config_entry[puppetdb_dashboard_address]/value: change from ‘’ to ‘http://localhost:8080/pdb/dashboard’ failed: Execution of ‘/usr/sbin/foreman-rake – config -k ‘puppetdb_dashboard_address’ -v ‘http://localhost:8080/pdb/dashboard’’ returned 1: /usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP

But I am wondering if I even need puppetdb?
In a previous installation, I set puppetdb_enabled = No in the Foreman Settings to get around an issue when trying to delete a host.

The plugin is optional. Unless you’ve installed puppetdb, it doesn’t really make sense. Foreman can use Puppet fine without Puppetdb.

What’s the best way to clean up after a failed installation?
Is there anything I need to remove?

Or would it be enough to edit /etc/foreman-installer/scenarios.d/katello-answers.yaml
and change:

foreman::plugin::puppetdb:
package: tfm-rubygem-puppetdb_foreman
address: https://localhost:8081/pdb/cmd/v1
dashboard_address: http://localhost:8080/pdb/dashboard
ssl_ca_file: /etc/puppetlabs/puppet/ssl/certs/ca.pem
ssl_certificate: /etc/puppetlabs/puppet/ssl/certs/foreman10125.net.mb.pem
ssl_private_key: /etc/puppetlabs/puppet/ssl/private_keys/foreman10125.net.mb.pem
api_version: ‘4’

To:
foreman::plugin::puppetdb: false

and just run the installer again?

Changing the answers file should never be needed. If you do, you found a bug. You can run foreman-installer --no-enable-foreman-plugin-puppetdb but that unmanages it. It doesn’t actually clean up. I think yum remove foreman-plugin-puppetdb might break because it could leave some database changes behind. Someone with more knowledge of the core can probably answer that.

My fear is that using --no-enable-foreman-plugin-puppetdb will still try to install it (build, make, whatever), then not enable it. I might be forced to start over from a fresh VM and clean installation without puppetdb.

But it is worth a try …

foreman-installer --interactive --no-enable-foreman-plugin-puppetdb --scenario katello

Installing Done [100%]
Success!

Thank you!

This is related to Bug #26695: "/usr/sbin/foreman-rake -- config -k 'puppetdb_dashboard_address' -v" fails installation - Installer - Foreman.
We ran into the same issue on test-updating our foreman test system. Unfortunately the parameter --no-enable-foreman-puppetdb removes all PuppetDB config in puppetserver etc., although the web UI of foreman says that the plugin is still active. The agent runs don’t work correctly anymore after using this option.

Maintainers: Please work fastly on getting the fix of said bug into the next minor releases for 1.20 and 1.21, thanks!

Since fixes got released only for the very current Foreman Version, here a little manual, how i managed to successfully update from 1.19 to 1.20:

Every occurence of “dashboard_address” (or “puppetdb_dashboard_address”) needs to be completely removed here:

  • /etc/foreman-installer/scenarios.d/foreman-answers.yaml
  • /usr/share/foreman-installer/parser_cache/foreman.yaml
  • /usr/share/foreman-installer/modules/foreman/manifests/plugin/puppetdb.pp
  • /usr/share/foreman-installer/modules/foreman/manifests/plugin/puppetdb/params.pp

Important: Not only remove the affected line, but also a block which the line starts
Also very important: In the puppet manifests the documentation part with dashboard must also be removed, because the installer checks it!
Wit the changed manifests the cache is outdated, so the installer needs to check the modules again, but fails to do so, if puppet-strings is not installed, so install it with puppet’s gem:

/opt/puppetlabs/bin/puppet/bin/gem install yard
/opt/puppetlabs/bin/puppet/bin/gem install puppet-strings

Now you can successfully run foreman-installer and continue with the update process as usual.

Have fun! :slight_smile: