Foreman 3.3.0 API Error

Problem:
Foreman 3.3.0 API Error

API URL https://foreman.example.com/api/v2/hosts suppose to give hosts details in JSON format but getting following error

{
“error”: {“message”:“undefined method `failure’ for #ConfigReport:0x000000000ad773f0\n Did you mean? failed”}
}

Expected outcome: Hosts details in JSON format

Foreman and Proxy versions: 3.3.0

Foreman and Proxy plugin versions: 3.3.0
I have below plugins enabled as well,

foreman-tasks: 6.0.2
foreman_dhcp_browser: 0.0.8
foreman_host_reports: 1.0.2
foreman_puppet: 4.0.1
foreman_setup: 8.0.1

Distribution and version:
CentOS Linux release 7.9.2009 (Core)

Other relevant data:
The Foreman installation went fine without any issues.
The error popped while configuring the below Provisioning setup

$ foreman-installer
–enable-foreman-proxy
–foreman-proxy-tftp=true
–foreman-proxy-tftp-servername=10.x.x.x
–foreman-proxy-dhcp=true
–foreman-proxy-dhcp-interface=eth0
–foreman-proxy-dhcp-gateway=10.x.x.x
–foreman-proxy-dhcp-nameservers=“1.1.1.1,8.8.8.8”
–foreman-proxy-dns=true
–foreman-proxy-dns-interface=eth0
–foreman-proxy-dns-zone=example.com
–foreman-proxy-dns-reverse=x.x.10.in-addr.arpa
–foreman-proxy-dns-forwarders=1.1.1.1
–foreman-proxy-dns-forwarders=8.8.8.8
–foreman-proxy-oauth-consumer-key=*********
–foreman-proxy-oauth-consumer-secret=********

Error message from the above command

2022-09-07 14:56:57 [ERROR ] [configure] /Stage[main]/Foreman::Register/Foreman_host[foreman.example.com]: Could not evaluate: Error making GET request to Foreman at https://foreman.example.com/api/v2/hosts: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on foreman.example.com for detailed information
2022-09-07 14:56:58 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-foreman.example.com]: Could not evaluate: Error making GET request to Foreman at https://foreman.example.com/api/v2/hosts: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on foreman.example.com for detailed information
2022-09-07 14:57:02 [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.

Hello @Mickey,

Here is the recent post with the solution: /api/hosts generates an error - #6 by rodney

1 Like

Thanks @ofedoren , Will try this option.