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