Project

General

Profile

Bug #5847

Successfully adds DHCP record, while GUI reports timeout

Added by Jon Skarpeteig over 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

From the GUI:

Unable to save
Create DHCP Settings for test.fqdn.com task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::RequestTimeout]: Request Timeout) for proxy http://dhcp.fqdn.com:8443/dhcp

From foreman proxy.log (at the same time the GUI request starts):

DEBUG -- : Added 1.1.1.1 / 00:50:56:00:00:00 to 1.1.1.1/255.255.255.0

I can also see the entry in dhcpd.leases file correctly.

Using ISC-DHCP and foreman-proxy on a remote node.


Related issues

Related to Smart Proxy - Bug #1090: When editing DHCP records, ISC backend times out if the number of subnets is large.Resolved2011-08-05

History

#1 Updated by Dominic Cleal over 6 years ago

  • Category set to DHCP
  • Priority changed from High to Normal

I think the "Added" debug logs are actually retrieving the existing leases or reservations from the subnet and adding them to an internal record, before actually adding a reservation. That said, it might well be that the request completes while Foreman itself has timed out.

You might find the fix from #5712 helps if you have many subnets, as it allows you to restrict which subnets it'll load from your DHCP server so will run faster.

#2 Updated by Jon Skarpeteig over 6 years ago

Seems you're right about the subnets. For some reason it seems it's loading every single subnet. This happens after the "Added" debug log message though

#3 Updated by Jon Skarpeteig over 6 years ago

I can confirm that the patch indeed solves the problem. However, it's still very slow (even with just the one subnet I added).

I'm a bit confused as to why it needs to re-read the full subnet after an add operation?

D, [2014-05-21T10:07:34.823707 #3788] DEBUG -- : true
D, [2014-05-21T10:07:34.823783 #3788] DEBUG -- : omshell: executed - set hardware-address = 00:50:56:00:00:00
D, [2014-05-21T10:07:34.823841 #3788] DEBUG -- : true
D, [2014-05-21T10:07:34.823935 #3788] DEBUG -- : omshell: executed - set hardware-type = 1
D, [2014-05-21T10:07:34.823987 #3788] DEBUG -- : true
D, [2014-05-21T10:07:34.824200 #3788] DEBUG -- : omshell: executed - set statements = "filename = \"pxelinux.0\"; next-server = 0a:2f:00:00; option host-name = \"host.fqdn\";"
D, [2014-05-21T10:07:34.824258 #3788] DEBUG -- : true
D, [2014-05-21T10:07:34.824334 #3788] DEBUG -- : omshell: executed - create
D, [2014-05-21T10:07:34.824386 #3788] DEBUG -- : true
I, [2014-05-21T10:07:34.847729 #3788] INFO -- : Added DHCP reservation for host.fqdn (1.1.1.1 / 00:50:56:00:00:00)
D, [2014-05-21T10:12:29.163547 #4709] DEBUG -- : Reading config file /etc/dhcpd.conf

#4 Updated by Ohad Levy over 6 years ago

Jon Skarpeteig wrote:

I'm a bit confused as to why it needs to re-read the full subnet after an add operation?

The proxy is a stateless API service, meaning, it does not remember anything between requests, this is done because:
  1. no need to keep another db in the proxy
  2. easier to write

We could consider caching things (like list of subnets etc), but normally I think they whole list should not be loaded automatically, only for requests that need it, therefor, if it reloads the data after creating the record, there might be a hidden extra request coming from foreman which is not required?

#5 Updated by Jon Skarpeteig about 6 years ago

Right now the foreman-proxy use several minutes to list a single C-class subnet. It's burning 100% CPU on a single thread until it's complete. As the GUI sits and waits for this process on both edit and save operation - it's a horrible user experience.

#6 Updated by Dominic Cleal about 6 years ago

  • Related to Bug #1090: When editing DHCP records, ISC backend times out if the number of subnets is large. added

#7 Updated by Ruslan Kiianchuk about 6 years ago

I'm getting this, when I try to upvote:

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

#8 Updated by Sarguru Nathan about 6 years ago

Hi,

I think the suggest IP that comes in the network tab of adding host page is what causes the load of entire subnet data (loadsubnetdata function) which is very expensive. For simple cases of addition Im not sure if it is needed since omshell should return an error on conflict etc. Please correct me if Im wrong.

Is there a way to disable the suggestion part ? Or is there any other cleaner work around for this?

Ohad Levy wrote:

Jon Skarpeteig wrote:

I'm a bit confused as to why it needs to re-read the full subnet after an add operation?

The proxy is a stateless API service, meaning, it does not remember anything between requests, this is done because:
  1. no need to keep another db in the proxy
  2. easier to write

We could consider caching things (like list of subnets etc), but normally I think they whole list should not be loaded automatically, only for requests that need it, therefor, if it reloads the data after creating the record, there might be a hidden extra request coming from foreman which is not required?

#9 Updated by Dominic Cleal about 6 years ago

IP suggestion can be disabled in 1.6 (#6529), edit the Subnet in the UI and untick the IPAM checkbox.

#10 Updated by Sarguru Nathan about 6 years ago

Dominic Cleal wrote:

IP suggestion can be disabled in 1.6 (#6529), edit the Subnet in the UI and untick the IPAM checkbox.

Thanks Dominic . I tried it and didnt find much improvement. The perfomance penalty seems to be from loadSubnetData function which gets called 4 times while adding a new host (which Im not sure why) . Probably caching could be a solution to cut down its time by 4 .

Also available in: Atom PDF