ERROR with smart_proxy_dhcp_dnsmasq- No subnets configured

Problem:
smart_proxy_dhcp_dnsmasq is throwing an error when a machine connects to dnsmasq See error below. Dnsmasq is configured to serve DHCP, DNS and TFTP for a test environment. Subnet is already confgured in Foreman. Machines get IP successfully but does not continue to PXE boot. In the UI I see the below error from smart proxy.

Expected outcome:
dnsmasq plugin is able to find the subnet configured in foreman

Foreman and Proxy versions:
3.9.1

Foreman and Proxy plugin versions:
smart_proxy_dhcp_dnsmasq - 1.0

Other relevant data:

Forgot to add the dnsmasq.conf settings

domain-needed
bogus-priv
no-resolv
server=8.8.8.8
local=/localdomain/
interface=enp0s8
except-interface=enp0s3
listen-address=192.168.56.101
bind-interfaces
expand-hosts
domain=localdomain
dhcp-range=192.168.56.102,192.168.56.150,12h
dhcp-optsfile=/var/lib/foreman-proxy/dhcp/dhcpopts.conf
dhcp-hostsfile=/var/lib/foreman-proxy/dhcp/dhcphosts
enable-tftp
tftp-root=/srv/tftp
tftp-no-fail
dhcp-leasefile=/var/lib/dnsmasq/dhcp.leases
log-queries
log-dhcp

What I find strange is- the foreman API, hammer cli return the subnet details succesfully. The failure is in a core foreman ruby code(dhcp_common) which is trying to retrieve the subnet and not the dnsmasq plugin per se. The error can show up any other place where dhcp_common code is being called. Wondering if there is some foreman installation related or ruby related configuration I am missing. I have zero ruby xp and hitting a wall trying to debug this. Any help is much appreciated.

Foreman isn’t getting free ips as well under Create Hosts>Interfaces>Edit. Noticed just now.
image

Hello,

try to look at /var/log/foreman-proxy/proxy.log during the subnet operations, it may tell you more. Very likely your proxy for some reason can’t fetch the data from the dnsmasq. I don’t use this plugin myself, @ananace may know better.

It may be also useful to share the config from /etc/foreman-proxy/settings.d/dhcp_dnsmasq.yml

1 Like