Discovery from a proxy

Problem:
I’m trying to do discovery from a proxy.
It boots the fdi-image, but when it tries to POST the results (I guess), I get a 404.

I have
proxy.url=https://$proxy_host:8443 proxy.type=proxy
in the “default” pxelinux.cfg file.

The proxy has the discovery plugin installed, it was installed with
"–enable-foreman-proxy-plugin-discovery --foreman-proxy-plugin-discovery-install-images=true "

Expected outcome:

Foreman and Proxy versions:
11:37:41 (PROD) root@foreman-app01-prod [~] # rpm -qa |grep foreman |sort
ansible-collection-theforeman-foreman-3.1.0-2.el8.noarch
foreman-3.2.1-1.el8.noarch
foreman-cli-3.2.1-1.el8.noarch
foreman-debug-3.2.1-1.el8.noarch
foreman-dynflow-sidekiq-3.2.1-1.el8.noarch
foreman-installer-3.2.1-2.el8.noarch
foreman-installer-katello-3.2.1-2.el8.noarch
foreman-openstack-3.2.1-1.el8.noarch
foreman-postgresql-3.2.1-1.el8.noarch
foreman-proxy-3.2.1-1.el8.noarch
foreman-release-3.2.1-1.el8.noarch
foreman-selinux-3.2.1-1.el8.noarch
foreman-service-3.2.1-1.el8.noarch
foreman-vmware-3.2.1-1.el8.noarch
rubygem-foreman_acd-0.9.0-1.fm3_1.el8.noarch
rubygem-foreman_ansible-7.1.0-1.fm3_2.el8.noarch
rubygem-foreman_discovery-20.0.1-1.fm3_2.el8.noarch
rubygem-foreman_hooks-0.3.17-2.fm2_5.el8.noarch
rubygem-foreman_host_reports-1.0.2-1.fm3_2.el8.noarch
rubygem-foreman_maintain-1.0.10-1.el8.noarch
rubygem-foreman_openscap-5.2.1-1.fm3_2.el8.noarch
rubygem-foreman_remote_execution-6.0.0-1.fm3_2.el8.noarch
rubygem-foreman_snapshot_management-2.0.1-1.fm2_6.el8.noarch
rubygem-foreman-tasks-6.0.1-1.fm3_2.el8.noarch
rubygem-foreman_templates-9.1.0-1.fm2_6.el8.noarch
rubygem-hammer_cli_foreman-3.2.0-1.20220214175116git323f240.el8.noarch
rubygem-hammer_cli_foreman_ansible-0.3.4-1.fm3_0.el8.noarch
rubygem-hammer_cli_foreman_discovery-1.1.0-1.fm3_2.el8.noarch
rubygem-hammer_cli_foreman_openscap-0.1.13-1.fm3_0.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.fm3_0.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.17-1.fm3_2.el8.noarch
rubygem-hammer_cli_foreman_templates-0.2.0-2.fm2_5.el8.noarch

Foreman and Proxy plugin versions:
11:49:37 (PROD) root@foreman-pxe02-prod [~] # rpm -qa |grep foreman |sort
ansible-collection-theforeman-foreman-3.1.0-2.el8.noarch
foreman-debug-3.2.1-1.el8.noarch
foreman-installer-3.2.1-2.el8.noarch
foreman-installer-katello-3.2.1-2.el8.noarch
foreman-proxy-3.2.1-1.el8.noarch
katello-ca-consumer-foreman-app01-prod.ewsrv.ch-1.0-1.noarch
12:22:57 (PROD) root@foreman-pxe02-prod [~] # rpm -qa |grep disc |sort
rubygem-smart_proxy_discovery-1.0.5-8.fm3_2.el8.noarch
12:23:10 (PROD) root@foreman-pxe02-prod [~] #

Distribution and version:
CentOS Stream release 8
(RPMs from around the end of June)

Ensure the module was enabled on the proxy, what do you see in proxy.log? Typically 404 is that the module was not enabled for some reason.

Well, it says it’s active:

The proxy-log (/var/log/foreman-proxy/proxy.log) doesn’t really say anything, sadly.

I do have an unbound-instance listening on the pxe-interface of the proxy to respond with the IP of the proxy-server for the hostname.

OK, the logs are in rhsm-pulpcore-https-8443_access_ssl.log.

10.38.221.204 - - [12/Aug/2022:17:36:05 +0200] "POST /discovery/create HTTP/1.1" 404 1564 "-" "Ruby"

So you are using an incorrect port. Keep in mind that depending on the installation scenario, the proxy port can be 8443 or 9090. Check the proxy configuration port setting.

1 Like

Thanks.

The comment in the config-file says 8443, so I assumed this is correct…

---
:enabled: true

# connection to discovered nodes
#:node_scheme: https
#:node_port: 8443