Bug #1270
closedDeleting Host or Updating IP address Gives Error 400
Description
When trying to delete a host or update the ip address from foreman the smart-proxy responds with an error 400.
This is what shows up in the proxy.log:
D, [2011-10-27T13:27:30.064255 #17487] DEBUG -- : Loading subnets for 127.0.0.1
D, [2011-10-27T13:27:30.064684 #17487] DEBUG -- : Added 10.130.108.0/255.255.252.0 to 127.0.0.1
D, [2011-10-27T13:27:30.064985 #17487] DEBUG -- : Added 10.130.112.0/255.255.252.0 to 127.0.0.1
D, [2011-10-27T13:27:30.066683 #17487] DEBUG -- : Loading subnet data for 10.130.108.0/255.255.252.0
I, [2011-10-27T13:27:30.357377 #17487] INFO -- : Enumerated hosts on 10.130.108.0
D, [2011-10-27T13:27:30.357491 #17487] DEBUG -- : Lazy loaded 10.130.108.0/255.255.252.0 records
E, [2011-10-27T13:27:30.358174 #17487] ERROR -- : 10.130.108.72 / 00:50:56:aa:00:6e is static - unable to delete
D, [2011-10-27T13:27:30.358301 #17487] DEBUG -- : /usr/share/foreman-proxy/bin/../lib/proxy/dhcp/server/isc.rb:14:in `delRecord'
/usr/share/foreman-proxy/bin/../lib/dhcp_api.rb:106:in `DELETE /dhcp/:network/:record'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in `call'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in `route'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `route!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `route!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run'
/usr/share/foreman-proxy/bin/../lib/sinatra-patch.rb:32:in `run!'
/usr/share/foreman-proxy/bin/smart-proxy:102
I'm using these versions:
foreman-proxy-0.3-0.1rc2
foreman-0.4-0.1rc4.noarch
Please let me know if you require any further information.
Updated by Ohad Levy about 13 years ago
- Status changed from New to Feedback
I could not reproduce this, is this an isolated problem? happens on all entries?
the error message does say that the dhcp reservation is in a conflict with what the proxy is expecting, which means it cant know for sure what to delete.
Updated by Johann Agnarsson about 13 years ago
You are correct, this was an isolated incident and was due to the machine having gotten an ip address from the DHCP server before it was added to foreman/puppet.
I don't suppose there is any way for the smart-proxy to see if the machine has been assigned an IP from dhcp already(since it should already exist in the leases file)?
Also, after upgrading to 0.3 it now inserts something like this (I at least didn't observe this behavior before):
dynamic;
hardware ethernet 00:50:56:aa:00:6e;
fixed-address 10.130.108.99;
supersede server.filename = "pxelinux.0";
supersede server.next-server = 0a:82:6c:cb;
supersede host-name = "bfdpuppet";
}
Into the dhcpd.leases, is there a specific place where we can configure the server.filename, as in my case it sits under "puppet-install/pxelinux.0" and was resulting in PXE File not found errors.
Updated by Ohad Levy about 13 years ago
- Target version deleted (
0.3)
Johann Agnarsson wrote:
You are correct, this was an isolated incident and was due to the machine having gotten an ip address from the DHCP server before it was added to foreman/puppet.
I don't suppose there is any way for the smart-proxy to see if the machine has been assigned an IP from dhcp already(since it should already exist in the leases file)?
this should be solved with #944, but in this case, the lease and reservation are not the same, so foreman was not 100% sure what it should do.
Also, after upgrading to 0.3 it now inserts something like this (I at least didn't observe this behavior before):
dynamic;
hardware ethernet 00:50:56:aa:00:6e;
fixed-address 10.130.108.99;
supersede server.filename = "pxelinux.0";
supersede server.next-server = 0a:82:6c:cb;
supersede host-name = "bfdpuppet";
}
Into the dhcpd.leases, is there a specific place where we can configure the server.filename, as in my case it sits under "puppet-install/pxelinux.0" and was resulting in PXE File not found errors.
sounds like a feature request :) nevertheless, we keep the directory structure very clean :)
Updated by Benjamin Papillon over 12 years ago
Hello,
As the main issue has been resolved, can you please close this ticket and open a new one with your feature request?
It'll help the dev team tracking what people want :)
Updated by Benjamin Papillon about 12 years ago
- Status changed from Feedback to Closed
- Target version set to Bug scrub
Closing this issue.
The feature request has been created under number #1952