Unable to install foreman with Ketello plugin

Problem:
Unable to install foreman with Ketello plugin
Expected outcome:
foreman should get installed with ketello plugin
Foreman and Proxy versions:

Foreman and Proxy plugin versions:

rpm -qa | grep -i foreman

rubygem-foreman_column_view-0.4.0-6.fm3_3.el8.noarch
foreman-vmware-3.4.1-1.el8.noarch
foreman-selinux-3.4.1-1.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.fm3_0.el8.noarch
foreman-debug-3.4.1-1.el8.noarch
foreman-dynflow-sidekiq-3.4.1-1.el8.noarch
rubygem-foreman_maintain-1.2.1-1.el8.noarch
rubygem-foreman_discovery-21.0.4-1.fm3_4.el8.noarch
foreman-installer-katello-3.4.1-1.el8.noarch
foreman-proxy-3.4.1-1.el8.noarch
rubygem-hammer_cli_foreman-3.4.0-1.el8.noarch
foreman-installer-3.4.1-1.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.17-1.fm3_2.el8.noarch
foreman-3.4.1-1.el8.noarch
rubygem-foreman_remote_execution-8.0.0-2.fm3_4.el8.noarch
foreman-ec2-3.4.1-1.el8.noarch
foreman-release-3.4.1-1.el8.noarch
foreman-service-3.4.1-1.el8.noarch
rubygem-foreman-tasks-7.0.0-1.fm3_4.el8.noarch
rubygem-foreman_default_hostgroup-6.0.0-2.fm3_3.el8.noarch
foreman-cli-3.4.1-1.el8.noarch
rubygem-foreman_memcache-0.1.1-5.fm3_3.el8.noarch
foreman-postgresql-3.4.1-1.el8.noarch

Distribution and version:

cat /etc/redhat-release

Red Hat Enterprise Linux release 8.6 (Ootpa)

Other relevant data:

# foreman-installer --scenario katello   --no-enable-puppet   --no-enable-foreman-plugin-bootdisk   --no-enable-foreman-proxy   --foreman-initial-organization "cadence"   --foreman-initial-location "sanjose"   --foreman-initial-admin-username admin   --foreman-initial-admin-password C@dence$123   --foreman-proxy-foreman-base-url=https://satellite.cadence.com   --foreman-db-host sjprdsatdb01.cadence.com   --foreman-db-password cadence   --foreman-db-database foreman   --foreman-db-manage false   --katello-candlepin-db-host sjprdsatdb01.cadence.com   --katello-candlepin-db-name candlepin   --katello-candlepin-db-password cadence   --katello-candlepin-manage-db false   --foreman-proxy-content-pulpcore-manage-postgresql false   --foreman-proxy-content-pulpcore-postgresql-host sjprdsatdb01.cadence.com   --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore   --foreman-proxy-content-pulpcore-postgresql-password cadence   --foreman-proxy-content-pulpcore-postgresql-user pulp   --certs-server-cert "/root/foreman_cert/satellite_cadence_com_cert.pem"   --certs-server-key "/root/foreman_cert/foreman_cert_key.pem"   --certs-server-ca-cert "/root/foreman_cert/ca_cert_bundle.pem"   --enable-foreman-plugin-memcache   --enable-foreman-plugin-discovery   --enable-foreman-plugin-default-hostgroup   --enable-foreman-plugin-column-view   --enable-foreman-compute-vmware
2022-12-21 00:02:36 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-12-21 00:02:38 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-12-21 00:02:38 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-12-21 00:02:44 [NOTICE] [configure] Starting system configuration.
2022-12-21 00:02:52 [NOTICE] [configure] 250 configuration steps out of 1242 steps complete.
2022-12-21 00:02:55 [NOTICE] [configure] 500 configuration steps out of 1244 steps complete.
2022-12-21 00:02:57 [NOTICE] [configure] 750 configuration steps out of 1249 steps complete.
2022-12-21 00:03:35 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
2022-12-21 00:03:35 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
2022-12-21 00:03:35 [NOTICE] [configure] 1000 configuration steps out of 1251 steps complete.
2022-12-21 00:03:42 [ERROR ] [configure] Systemd start for foreman-proxy failed!
2022-12-21 00:03:42 [ERROR ] [configure] journalctl log for foreman-proxy:
2022-12-21 00:03:42 [ERROR ] [configure] -- Logs begin at Fri 2022-12-16 14:13:29 EST, end at Wed 2022-12-21 00:03:42 EST. --
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: Starting Foreman Proxy...
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: Failed to start Foreman Proxy.
2022-12-21 00:03:42 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]/ensure: change from 'stopped' to 'running' failed: Systemd start for foreman-proxy failed!
2022-12-21 00:03:42 [ERROR ] [configure] journalctl log for foreman-proxy:
2022-12-21 00:03:42 [ERROR ] [configure] -- Logs begin at Fri 2022-12-16 14:13:29 EST, end at Wed 2022-12-21 00:03:42 EST. --
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: Starting Foreman Proxy...
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2022-12-21 00:03:42 [ERROR ] [configure] Dec 21 00:03:42 sjprdsatapp01 systemd[1]: Failed to start Foreman Proxy.
2022-12-21 00:03:42 [NOTICE] [configure] 1250 configuration steps out of 1251 steps complete.
2022-12-21 00:03:44 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/katello.log

Is this your first installation? I highly recommend to follow the docs and start with a simple installation and then later add additional plugins. If you follow the docs you wouldn’t break it to start with. --no-enable-foreman-proxy is definitively never mentioned in any katello server docs and it absolutely doesn’t make any sense, in particular if you even add foreman-proxy options, too.

Follow the docs. You’ll need the standard options, certs, and for the database. Add the rest later, if you really need, one by one.

And as the error message tells you at the end:

The log file should show why it cannot seed the database or what failed exactly.

1 Like

Hi @sarang and welcome to the Foreman community.

Please have a look at Installing Foreman 3.4 Server with Katello 4.6 Plugin on RHEL/CentOS for a basic installation of Foreman and Katello. Most installations instructions for plug-in are part of the guides where you actually need/use them, for example Installing VMware Plugin in Provisioning Hosts.

If this is our real password, please change and do not use this in the future as default password any more as you now leaked it.

Not a real password. :slight_smile:

  1. I did stripdown my command a little.

  2. /var/log/foreman-installer/katello.log points to below.
    Not sure what is ‘unknown attribute ‘description’’

2022-12-21 09:24:26 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Starting to evaluate theresource (998 of 1251)
2022-12-21 09:24:26 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: '/usr/sbin/foreman-rake db:seed' won't be executed because of failed check 'refreshonly'
2022-12-21 09:24:26 [DEBUG ] [configure] Exec[foreman-rake-db:seed](provider=posix): Executing '/usr/sbin/foreman-rake db:seed'
2022-12-21 09:24:26 [DEBUG ] [configure] Executing with uid=foreman: '/usr/sbin/foreman-rake db:seed'
2022-12-21 09:24:33 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: rake aborted!
2022-12-21 09:24:33 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: ActiveModel::UnknownAttributeError: unknown attribute 'description' for Setting::DefaultHostgroup.

  1. I did run the command manually.
[root@sjprdsatapp01 ~]# /usr/sbin/foreman-rake db:seed
rake aborted!
ActiveModel::UnknownAttributeError: unknown attribute 'description' for Setting::DefaultHostgroup.
/usr/share/gems/gems/activemodel-6.1.6.1/lib/active_model/attribute_assignment.rb:51:in `_assign_attribute'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:13:in `each'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/usr/share/gems/gems/activemodel-6.1.6.1/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/core.rb:518:in `initialize'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/inheritance.rb:72:in `new'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/inheritance.rb:72:in `new'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/persistence.rb:37:in `create'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:16:in `block (2 levels) in load_defaults'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:16:in `each'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:16:in `block in load_defaults'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:11:in `load_defaults'
/usr/share/foreman/app/services/setting_registry.rb:114:in `each'
/usr/share/foreman/app/services/setting_registry.rb:114:in `load'
/usr/share/foreman/config/initializers/foreman.rb:37:in `block in <top (required)>'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:427:in `instance_exec'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:603:in `catch'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:199:in `block in halting'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `each'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `invoke_before'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:105:in `run_callbacks'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:88:in `prepare!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `instance_exec'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `block in run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:17:in `benchmark'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `run'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:60:in `run_initializers'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:391:in `initialize!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:367:in `require_environment!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:seed => db:load_config => environment

Ah, you need this patch for default_hostgroup plugin: migrate to Settings DSL (#52) · theforeman/foreman_default_hostgroup@cbf79fe · GitHub

Seems we forgot to release it. CC @Marek_Hulan

I still get the same error even when I run ‘foreman-installler’ with ‘–no-enable-foreman-plugin-default-hostgroup’. Is this expected?

Any documentation on steps to be followed to apply this patch and test?

Yes, that is expected. That’s one of the problems if you start installing with so many options: all your previous options are saved and remembered. Some configuration has already been applied. With –no-enable-foreman-plugin-default-hostgroup you only tell the installer not to use the default-hostgroup plugin configuration module, i.e. it does not consider it and doesn’t make any changes to that part, but any configuration already in the database is still there. --no-enable-... doesn’t undo everything the enable option did before.

The safest way would be to start over on a new system with a fresh os installation, only using the absolutely necessary configuration options and later add plugins one by one… Otherwise you make the whole thing overly complicated.

@gvde Thanks for the suggestion of fresh system.
I was able to install it with minimal option for external database.

 foreman-installer --scenario katello \
>   --foreman-initial-organization "companyname" \
>   --foreman-initial-location "US" \
>   --foreman-initial-admin-username admin \
>   --foreman-initial-admin-password PASS123 \
>   --foreman-proxy-foreman-base-url=https://foreman.company.com \
>   --foreman-db-host db.company.com \
>   --foreman-db-password PASS123 \
>   --foreman-db-database foreman \
>   --foreman-db-manage false \
>   --katello-candlepin-db-host db.company.com \
>   --katello-candlepin-db-name candlepin \
>   --katello-candlepin-db-password PASS123 \
>   --katello-candlepin-manage-db false \
>   --foreman-proxy-content-pulpcore-manage-postgresql false \
>   --foreman-proxy-content-pulpcore-postgresql-host db.company.com \
>   --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore \
>   --foreman-proxy-content-pulpcore-postgresql-password PASS123  \
>   --foreman-proxy-content-pulpcore-postgresql-user pulp \
>   --certs-server-cert "/root/foreman_cert/satellite_cadence_com_cert.pem" \
>   --certs-server-key "/root/foreman_cert/foreman_cert_key.pem" \
>   --certs-server-ca-cert "/root/foreman_cert/ca_cert_bundle.pem"
     --no-enable-foreman-plugin-default-hostgroup

@evgeni Any timeline for the patch so that I can use ‘–enable-foreman-plugin-default-hostgroup’?

Also want to test couple of options.
–enable-foreman-plugin-memcache
–enable-foreman-plugin-discovery
Will it work if I just run below command or do I have to install again from scratch?
foreman-installer --scenario katello --enable-foreman-plugin-memcache --enable-foreman-plugin-discovery

There is no need to reinstall Foreman/Katello again. You can install plug-ins such as discovery later. See Configuring the Discovery Service in Provisioning Hosts guide.

2 Likes

@evgeni @Marek_Hulan Any timeline for the patch so that I can use ‘–enable-foreman-plugin-default-hostgroup’?

Also is 3.3 version also affected by same bug for ‘default_hostgroup’ plugin?

Any update on this?

Default hostgroup plugin got released, packaged and landed in the repositories for nightly, 3.5 and 3.4 yesterday.

I was able to install couple of plugins. installed them one by one.
–enable-foreman-plugin-discovery
–enable-foreman-plugin-default-hostgroup

However, getting errors when I ran below.

[root@sjprdsatapp01 ~]# foreman-installer --enable-foreman-plugin-memcache --enable-foreman-plugin-column-view
2023-01-19 03:15:36 [NOTICE] [root] Loading installer configuration. This will take some time.
2023-01-19 03:15:39 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2023-01-19 03:15:39 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2023-01-19 03:15:44 [NOTICE] [configure] Starting system configuration.
2023-01-19 03:15:53 [NOTICE] [configure] 250 configuration steps out of 1230 steps complete.
2023-01-19 03:15:55 [NOTICE] [configure] 500 configuration steps out of 1232 steps complete.
2023-01-19 03:15:58 [NOTICE] [configure] 750 configuration steps out of 1238 steps complete.
2023-01-19 03:16:17 [NOTICE] [configure] 1000 configuration steps out of 1239 steps complete.
2023-01-19 03:16:24 [ERROR ] [configure] /Stage[main]/Foreman::Register/Foreman_host[foreman-sjprdsatapp01.cadence.com]: Could not evaluate: Error making GET request to Foreman at https://sjprdsatapp01.cadence.com/api/v2/hosts: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on sjprdsatapp01.cadence.com for detailed information
2023-01-19 03:16:24 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-sjprdsatapp01.cadence.com]: Could not evaluate: Error making GET request to Foreman at https://satellite.cadence.com/api/v2/hosts: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on satellite.cadence.com for detailed information
2023-01-19 03:16:24 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[sjprdsatapp01.cadence.com]: Could not evaluate: Error making GET request to Foreman at https://satellite.cadence.com/api/v2/smart_proxies: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on satellite.cadence.com for detailed information
2023-01-19 03:16:26 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/katello.log

Attaching ‘/var/log/foreman/production.log’ for reference.

Appears to be issue with discovery service. Is there any way to roll back changes?

2023-01-18T03:30:03 [I|app|] Rails cache backend: File
2023-01-18T03:30:04 [W|app|] You are trying to replace import_subnets from . Adding allowed actions from plugin permissions to the existing one.
2023-01-18T03:30:04 [W|app|] Setting remote_execution_workers_pool_size has no definition, please define it before using
2023-01-18T03:30:05 [W|app|] Setting host_tasks_workers_pool_size has no definition, please define it before using
2023-01-18T03:30:05 [W|app|] Creating scope :exportable. Overwriting existing method Katello::Repository.exportable.
2023-01-18T03:30:06 [W|app|] Creating scope :completer_scope. Overwriting existing method Organization.completer_scope.
2023-01-18T03:30:07 [W|app|] Creating scope :execution_scope. Overwriting existing method Host::Managed.execution_scope.
2023-01-18T03:30:07 [W|app|] Creating scope :completer_scope. Overwriting existing method Location.completer_scope.
2023-01-18T03:30:08 [W|app|] Scoped order is ignored, it's forced to be batch order.
2023-01-18T03:30:09 [W|app|] unknown class DiscoveryRule, ignoring
2023-01-18T03:30:09 [I|app|] Backtrace for 'unknown class DiscoveryRule, ignoring' error (NameError): uninitialized constant DiscoveryRule
[production.log.gz|attachment](upload://wtLOLszW2kepKNWB1xX1edfFjQl.gz) (214.4 KB)

production.log.gz (214.4 KB)

Attaching ‘/var/log/foreman/production.log’ for reference.

Any update on this?