Kea-dhcp4 server fails to start on 23.09.b.20231017.1731
-
Installed 23.09.b.20231017.1731 and noticed that when switching over to kea that the kea-dhcp4 server does not start. However it shows the kea-dhcp6 server as started.
Cannot manually restart the service, tried to reboot and see if the that would resolve the issue after switching over, same issue.When reviewing the logs on the system it presents the following. NOTE that the item in the logs with the error is a Ubuntu Server 22.04.3 LTS VM that is currently turned off with a static IP and ARP assigned to it in ISC Dhcp via the Mac Address - hence the name ubserver2 (which is just for testing). I've also not manually assigned anything to dhcp 6 with ISC. So my thought was lets power it on to test if it starts properly. Since I could not manually start the KEA-dhcp4, rebooted pfSense then it then moved onto another devices that is power off specifically the Ipmi port on a SuperMicro Server that is used for testing UnRaid. (This UnRaid device is not in the logs from when testing earlier - the logs are from the most recent testing of when power off the ubserver2 again)
I've omitted the dhcp6 server ID and local Lan ip range - If a Netgate staff member wants to see the raw log information and kea-dhcp4.conf file - I'm more than happy to provide it directly to that individual. Truly not sure if anything could be ascertained from them but figured i would rather be safe than sorry down the road.
Here's the logs after switching back to Kea
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcp6.0x2b2d9aa12000] DHCP6_STARTED Kea DHCPv6 server version 2.4.0 started
Oct 17 20:10:48 kea-dhcp6 59306 WARN [kea-dhcp6.dhcp6.0x2b2d9aa12000] DHCP6_MULTI_THREADING_INFO enabled: yes, number of threads: 8, queue size: 64
Oct 17 20:10:48 kea-dhcp6 59306 WARN [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_NO_SOCKETS_OPEN no interface configured to listen to DHCP traffic
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcp6.0x2b2d9aa12000] DHCP6_USING_SERVERID server is using server-id xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx and stores in the file /var/db/kea/kea-dhcp6-serverid
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3600 sec
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_MEMFILE_BUILD_EXTENDED_INFO_TABLES6 building extended info tables saw 0 leases, extended info sanity checks modified 0 / updated 0 leases and 0 leases were entered into tables
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/dhcp6.leases
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_MEMFILE_DB opening memory file lease database: name=/var/lib/kea/dhcp6.leases persist=true type=memfile universe=6
Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/usr/local/etc/kea/kea-dhcp4.conf': invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13)
Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /usr/local/etc/kea/kea-dhcp4.conf, reason: invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13)
Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_PARSER_FAIL failed to create or run parser for configuration element reservations: invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13)
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcp6.0x2b2d9aa12000] DHCP6_CONFIG_COMPLETE DHCPv6 server has completed configuration: no IPv6 subnets!; DDNS: disabled
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.hooks.0x2b2d9aa12000] HOOKS_LIBRARY_LOADED hooks library /usr/local/lib/kea/hooks/libdhcp_lease_cmds.so successfully loaded
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.lease-cmds-hooks.0x2b2d9aa12000] LEASE_CMDS_INIT_OK loading Lease Commands hooks library successful
Oct 17 20:10:48 kea-dhcp4 58964 INFO [kea-dhcp4.dhcpsrv.0x2d9956812000] DHCPSRV_CFGMGR_NEW_SUBNET4 a new subnet has been added to configuration: 192.xx.xx.0/24 with params: valid-lifetime=7200
Oct 17 20:10:48 kea-dhcp4 58964 INFO [kea-dhcp4.hooks.0x2d9956812000] HOOKS_LIBRARY_CLOSED hooks library /usr/local/lib/kea/hooks/libdhcp_lease_cmds.so successfully closed
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.commands.0x2b2d9aa12000] COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /tmp/kea6-ctrl-socket
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw
Oct 17 20:10:48 kea-dhcp4 58964 INFO [kea-dhcp4.dhcpsrv.0x2d9956812000] DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT "dhcp-socket-type" not specified , using default socket type raw
Oct 17 20:10:48 kea-dhcp4 58964 INFO [kea-dhcp4.dhcpsrv.0x2d9956812000] DHCPSRV_CFGMGR_ADD_IFACE listening on interface ix1
Oct 17 20:10:48 kea-dhcp4 58964 WARN [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first.
Oct 17 20:10:48 kea-dhcp4 58964 WARN [kea-dhcp4.dhcpsrv.0x2d9956812000] DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled.
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.hooks.0x2b2d9aa12000] HOOKS_LIBRARY_CLOSED hooks library /usr/local/lib/kea/hooks/libdhcp_lease_cmds.so successfully closed
Oct 17 20:10:48 kea-dhcp4 58964 INFO [kea-dhcp4.hosts.0x2d9956812000] HOSTS_BACKENDS_REGISTERED the following host backend types are available:
Oct 17 20:10:48 kea-dhcp6 59306 WARN [kea-dhcp6.dhcp6.0x2b2d9aa12000] DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first.
Oct 17 20:10:48 kea-dhcp6 59306 WARN [kea-dhcp6.dhcpsrv.0x2b2d9aa12000] DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled.
Oct 17 20:10:48 kea-dhcp6 59306 INFO [kea-dhcp6.hosts.0x2b2d9aa12000] HOSTS_BACKENDS_REGISTERED the following host backend types are available:
Oct 17 20:10:48 kea-dhcp6 20593 INFO [kea-dhcp6.hooks.0xb273f012000] HOOKS_LIBRARY_CLOSED hooks library /usr/local/lib/kea/hooks/libdhcp_lease_cmds.so successfully closed
Oct 17 20:10:48 kea-dhcp6 20593 INFO [kea-dhcp6.lease-cmds-hooks.0xb273f012000] LEASE_CMDS_DEINIT_OK unloading Lease Commands hooks library successful
Oct 17 20:10:48 kea-dhcp6 20593 INFO [kea-dhcp6.dhcp6.0xb273f012000] DHCP6_SHUTDOWN server shutdown -
@tweek011 said in Kea-dhcp4 server fails to start on 23.09.b.20231017.1731:
Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/usr/local/etc/kea/kea-dhcp4.conf': invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13)
One of your static mappings has
ubserver2
in its "Client ID" field and that format isn't a valid client ID in Kea. Clear that (and any other invalid/unnecessary Client IDs) and it should start. -
@jimp That was it exactly - after editing and removing the Client ID from all my static mapping entries Kea was able to start up properly. Greatly appreciate it!
-
@tweek011 said in Kea-dhcp4 server fails to start on 23.09.b.20231017.1731:
@jimp That was it exactly - after editing and removing the Client ID from all my static mapping entries Kea was able to start up properly. Greatly appreciate it!
In the interest of the old quote "teach a man to fish and you feed him for a lifetime", I offer this hint for the future:
The solution to your problem was printed right in the log snippet you posted to the forum. Here it is:
Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/usr/local/etc/kea/kea-dhcp4.conf': invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13) Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /usr/local/etc/kea/kea-dhcp4.conf, reason: invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13) Oct 17 20:10:48 kea-dhcp4 58964 ERROR [kea-dhcp4.dhcp4.0x2d9956812000] DHCP4_PARSER_FAIL failed to create or run parser for configuration element reservations: invalid host identifier value 'ubserver2' (/usr/local/etc/kea/kea-dhcp4.conf:444:13)
Note there are three lines from the log that have ERROR in their header info. That's a big red flag. Reading the logged error message tells you there is an invalid host identifier value of 'ubserver2' in the configuration. Instead of having to wait hours for a reply on the forum from @jimp, you could have likely fixed the problem immediately by simply reading the Kea log file. Log files should always be the first thing you seek out and then read when troubleshooting network/computer/IT issues .
-
@bmeeks -- Feel better now that you got that off your chest?
-
I think I found a bug when switching to the kea DHCP implementation. It reads the various name servers and so forth in the Services-> DHCP Server->LAN setting, I had 2 ntp servers listed and kea would fail with a syntax error, inspecting the kea-dhcp4.conf file, it had improperly parsed and concatenated the 2 ntp sever entries as like thi in the conf file:
{
"name": "ntp-servers",
"data": "172.16.20.150, pool.ntp.org" < note the missing close quote on first entry and missing opening quote on the second.
}I changed it to this and all is fine, just FYI.
{
"name": "ntp-servers",
"data": "17x.16.20.150", "pool.ntp.org"
} -
@geoffb I can confirm that the parsing of the NTP block is buggy and we can reproduce it on all the uses cases. For the moment, the NTP field is not functional.