0

I have a Foreman smart client version 1.15.0 running on Windows Server 2016, which I am trying to use for managing Windows DHCP servers with Foreman.

When I try to populate the DHCP leases with the smart client, I get the error:

Error: ERF12-2600 [ProxyAPI::ProxyException]: Unable to retrieve DHCP subnets ([RestClient::BadRequest]: 400 Bad Request) for proxy https://co-foremanprx01.example.com:8443/dhcp

And the log on the proxy itself reads:

E, [2017-06-16T23:14:25.469891 ] ERROR -- : Error when enumerating subnets on co-util02.example.com. Unknown error '5'

DHCP configuration on the smart client is as follows:

 :enabled: true
 :use_provider: dhcp_native_ms 
 :server: co-util02.example.com

How can I debug this? What's going on?

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259

1 Answers1

0

Old answer is below, but turns out this was another red herring. When I registered the smart proxy as a Windows service, the error came back.

Turns out adding the service user to DHCP Administrators in Active Directory was not sufficient - you have to add the service user to the local DHCP Administrators group on the DHCP server itself.


Previous (wrong) solution is retained for prosperity below:

Documentation on running the foreman-proxy on Windows is woefully inadequate. The official foreman-proxy for Windows documentation is out of date.

By setting :log_level: DEBUG in the configuration file and then running the smart-proxy from the command line gave a further error:

Disabling all modules in the group ['dhcp_native_ms', 'dhcp'] due to a failure in one of them: cannot load such file -- dhcpsapi

Because apparently that's not an error that's worth logging unless you enable debug logging...

That error led to a Foreman bug report that gives totally different instructions on how to run the smart proxy on Windows from the console - you should run it from the console with

bundler exec ruby bin/smart-proxy

And voila - a working foreman DHCP proxy.

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259