Foreman with Katello Discovery Plugin errors

Problem:
Trying to add discovery plug 15.0 to already running Foreman 3.0 with Katello 4.2 but keep getting errors
Expected outcome:
No errors /var/log/foreman-proxy/proxy.log
Foreman and Proxy versions:
3.0 and Katello 4.2
Foreman and Proxy plugin versions:
Discovery version 15.0
Distribution and version:
CentOS 8.4
Other relevant data:
foreman-installer --scenario katello --enable-foreman-proxy-plugin-discovery --foreman-proxy-plugin-discovery-install-images=true
2021-10-08 00:18:32 [NOTICE] [root] Loading installer configuration. This will take some time.
2021-10-08 00:18:35 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2021-10-08 00:18:35 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2021-10-08 00:18:42 [NOTICE] [configure] Starting system configuration.
2021-10-08 00:18:52 [NOTICE] [configure] 250 configuration steps out of 2061 steps complete.
2021-10-08 00:18:54 [NOTICE] [configure] 500 configuration steps out of 2061 steps complete.
2021-10-08 00:18:54 [NOTICE] [configure] 750 configuration steps out of 2064 steps complete.
2021-10-08 00:18:56 [NOTICE] [configure] 1000 configuration steps out of 2069 steps complete.
2021-10-08 00:18:57 [NOTICE] [configure] 1250 configuration steps out of 2073 steps complete.
2021-10-08 00:19:14 [NOTICE] [configure] 1500 configuration steps out of 2073 steps complete.
2021-10-08 00:19:16 [NOTICE] [configure] 1750 configuration steps out of 2097 steps complete.
2021-10-08 00:19:21 [NOTICE] [configure] 2000 configuration steps out of 2097 steps complete.
2021-10-08 00:19:22 [ERROR ] [configure] Proxy labmgt.n3.mydomain.net has failed to load one or more features (Discovery), check for configuration errors
2021-10-08 00:19:22 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[labmgt.n3.mydomain.net]/features: change from [“Ansible”, “Dynflow”, “Logs”, “Pulpcore”, “Puppet”, “Puppet CA”, “Registration”, “SSH”, “TFTP”] to [“Ansible”, “Discovery”, “Dynflow”, “Logs”, “Pulpcore”, “Puppet”, “Puppet CA”, “Registration”, “SSH”, “TFTP”] failed: Proxy labmgt.n3.mydomain.net has failed to load one or more features (Discovery), check /var/log/foreman-proxy/proxy.log for configuration errors
2021-10-08 00:19:23 [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

Proxy Log
cat /var/log/foreman-proxy/proxy.log
2021-10-07T03:29:09 [I] Logging file reopened via USR1 signal
2021-10-07T18:26:22 b5a0447a [I] Started GET /version
2021-10-07T18:26:22 b5a0447a [I] Finished GET /version with 200 (0.38 ms)
2021-10-07T18:51:29 25b83e08 [I] Started GET /version
2021-10-07T18:51:29 25b83e08 [I] Finished GET /version with 200 (0.37 ms)
2021-10-08T00:19:21 c27c73c4 [I] Started GET /v2/features
2021-10-08T00:19:21 c27c73c4 [I] Finished GET /v2/features with 200 (20.65 ms)
2021-10-08T00:19:22 c27c73c4 [I] Started GET /ssh/pubkey
2021-10-08T00:19:22 c27c73c4 [I] Finished GET /ssh/pubkey with 200 (0.52 ms)
2021-10-08T00:19:22 c27c73c4 [I] Started GET /v2/features
2021-10-08T00:19:22 c27c73c4 [I] Finished GET /v2/features with 200 (19.73 ms)
2021-10-08T00:19:22 c27c73c4 [I] Started GET /v2/features
2021-10-08T00:19:22 c27c73c4 [I] Finished GET /v2/features with 200 (20.28 ms)
2021-10-08T00:26:53 [I] Execution plan cleaner removing 0 execution plans.

I had a similar issue. I found in postgres I had a bunch of duplicate entries in the permissions table related to discovery. I removed the duplicates and that seemed to work.

Thanks for the response. Do you have or can set out your step by step Postgres isn’t a strong point. Thanks

This is what can tell you if they are duplicated.

$ psql
psql (12.7)
Type "help" for help.

postgres=# \c foreman
You are now connected to database "foreman" as user "postgres".
foreman=# select * from permissions where name like '%disc%';
 id  |              name               | resource_type |         created_at         |         updated_at
-----+---------------------------------+---------------+----------------------------+----------------------------
 247 | view_discovered_hosts           | Host          | 2021-09-30 20:15:23.196893 | 2021-09-30 20:15:23.196893
 249 | submit_discovered_hosts         | Host          | 2021-09-30 20:15:23.246744 | 2021-09-30 20:15:23.246744
 251 | auto_provision_discovered_hosts | Host          | 2021-09-30 20:15:23.250692 | 2021-09-30 20:15:23.250692
 253 | provision_discovered_hosts      | Host          | 2021-09-30 20:15:23.26249  | 2021-09-30 20:15:23.26249
 255 | edit_discovered_hosts           | Host          | 2021-09-30 20:15:23.266313 | 2021-09-30 20:15:23.266313
 257 | destroy_discovered_hosts        | Host          | 2021-09-30 20:15:23.26958  | 2021-09-30 20:15:23.26958
 259 | view_discovery_rules            | DiscoveryRule | 2021-09-30 20:15:23.273183 | 2021-09-30 20:15:23.273183
 261 | create_discovery_rules          | DiscoveryRule | 2021-09-30 20:15:23.27686  | 2021-09-30 20:15:23.27686
 263 | edit_discovery_rules            | DiscoveryRule | 2021-09-30 20:15:23.280514 | 2021-09-30 20:15:23.280514
 264 | execute_discovery_rules         | DiscoveryRule | 2021-09-30 20:15:23.28474  | 2021-09-30 20:15:23.28474
 265 | destroy_discovery_rules         | DiscoveryRule | 2021-09-30 20:15:23.288748 | 2021-09-30 20:15:23.288748
(11 rows)```

Much appreciated

Using compatible versions would be a great start, for Foreman 3.0 that would be Discovery 18.0.

Mentioned permission problem is a very old bug, like 3-5 years old or something like that. If this is something new, I would be interested in details.

1 Like

Where would I find Discovery 18, this maybe my issue then. Thanks for assist

In Foreman 3.0 repositories (Katello 4.2 uses Foreman 3.0 repos too).

To upgrade simply do yum upgrade to upgrade the package.

Thanks for the information