Cannot Save/Delete DHCP Record on Proxy

HI Guys,

I'm having this issue out of the blue where I have seen it was a bug but
fixed in 1.5.1… so I never had this issue.

E, [2014-06-26T10:39:54.486389 #9147] ERROR – : Removing a Proxy::DHCP
Record which doesn't exist

ERF12-4395 [ProxyAPI::ProxyException]: Unable to retrieve DHCP entry for
00:1a:4a:a8:0c:3f ([RestClient::BadRequest]: 400 Bad Request) for proxy
https://foremanserver:8443/dhcp

What can cause this ?

Cheers,

Matt

It seems to be a "bug": Bug #6396: an error removing a DHCP record (record doesn't exist) stops the delete process for a host - Smart Proxy - Foreman

··· Op donderdag 26 juni 2014 10:48:28 UTC+2 schreef yamaka...@gmail.com: > > HI Guys, > > I'm having this issue out of the blue where I have seen it was a bug but > fixed in 1.5.1... so I never had this issue. > > E, [2014-06-26T10:39:54.486389 #9147] ERROR -- : Removing a Proxy::DHCP > Record which doesn't exist > > > ERF12-4395 [ProxyAPI::ProxyException]: Unable to retrieve DHCP entry for > 00:1a:4a:a8:0c:3f ([RestClient::BadRequest]: 400 Bad Request) for proxy > https://foremanserver:8443/dhcp > > What can cause this ? > > Cheers, > > Matt >

Il giorno giovedì 26 giugno 2014 13:14:13 UTC+2, yamaka...@gmail.com ha
scritto:

It seems to be a "bug": http://projects.theforeman.org/issues/6396
>

Hi,
I just upgraded from 1.3 to 1.5.1 and I encountered the same problem, but I
cannot find a solution :(.

I have Foreman and ISC DHCPD on CentOS 6. I'm provisioning hosts on VMware.
If I restart the dhcpd service, then I can create a new host. But then it
fails if I try to create a second host.
Please note that it also fails if I create a host with a name I never used
before.

Foreman fails with the following error message:

Create DHCP Settings for mynewhostname.mydomain task failed with the
following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP
entry ([RestClient::BadRequest]: 400 Bad Request) for proxy
https://foreman.mydomain:8443/dhcp

In production.log the error is followed by these (and many more) lines:

/usr/share/foreman/lib/proxy_api/dhcp.rb:66:in rescue in set' /usr/share/foreman/lib/proxy_api/dhcp.rb:62:in set'
/usr/share/foreman/lib/net/dhcp/record.rb:28:in create' /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:22:in set_dhcp'

The proxy.log show these (and more):

E, [2014-07-02T13:47:09.043177 #11733] ERROR – : Removing a Proxy::DHCP
Record which doesn't exist
D, [2014-07-02T13:47:09.043250 #11733] DEBUG – :
/usr/share/foreman-proxy/bin/…/lib/proxy/dhcp/subnet.rb:184:in delete' /usr/share/foreman-proxy/bin/../lib/proxy/dhcp/server/isc.rb:64:in loadSubnetData'
/usr/share/foreman-proxy/bin/…/lib/proxy/dhcp/server/isc.rb:55:in scan' /usr/share/foreman-proxy/bin/../lib/proxy/dhcp/server/isc.rb:55:in loadSubnetData'

I applied both these patches, to no avail:
https://github.com/theforeman/smart-proxy/pull/174/files
https://github.com/theforeman/smart-proxy/pull/175/files

There's something strange, though…
When applying fix 174 in subnet.rb, I commented the original one, added one
more comment line, and then added the fixed line below.
So, why does the log above still point at line 184? There's a comment at
that position now, the real "raise" line is at 186…
I already restarted httpd and foreman services.
Are those files cached anywhere I couldn't find?
I modified /usr/share/foreman-proxy/lib/proxy/dhcp/subnet.rb by the way.
It's the only one I can find in my system.

Thank you very much.
Marco

It's the "foreman-proxy" service you need to restart, that should do the
trick.

··· On 02/07/14 15:04, zerozerounouno@gmail.com wrote: > I applied both these patches, to no avail: > https://github.com/theforeman/smart-proxy/pull/174/files > https://github.com/theforeman/smart-proxy/pull/175/files > > There's something strange, though... > When applying fix 174 in subnet.rb, I commented the original one, added > one more comment line, and then added the fixed line below. > So, why does the log above still point at line 184? There's a comment at > that position now, the real "raise" line is at 186... > I already restarted httpd and foreman services. > Are those files cached anywhere I couldn't find? > I modified /usr/share/foreman-proxy/lib/proxy/dhcp/subnet.rb by the way. > It's the only one I can find in my system.


Dominic Cleal
Red Hat Engineering

Finally… thank you!
What a waste of time… and I also looked at services to spot anything
related but apparently didn't look enough :-P.
That's when surrendering to the shameful "let's try a reboot" choice can
actually help ;).

Marco

··· Il giorno mercoledì 2 luglio 2014 17:00:40 UTC+2, Dominic Cleal ha scritto:

It’s the “foreman-proxy” service you need to restart, that should do the
trick.

Can you confirm that PRs 174/175 helped? I'm just doing some testing
on them now myself, but knowing they work "in the wild" is useful data
:slight_smile:

Greg

··· On 2 July 2014 17:36, wrote: > Finally... thank you! > What a waste of time... and I also looked at services to spot anything > related but apparently didn't look enough :-P. > That's when surrendering to the shameful "let's try a reboot" choice can > actually help ;).

Yes they did, although I'm not sure they were both necessary.

··· Il giorno mercoledì 2 luglio 2014 19:02:09 UTC+2, Greg Sutcliffe ha scritto:

Can you confirm that PRs 174/175 helped? I’m just doing some testing
on them now myself, but knowing they work “in the wild” is useful data