[BUG] Kea DHCP UI generates an invalid JSON config file

Started by marcog, January 31, 2024, 12:41:00 AM

Previous topic - Next topic
Hi,
I've configured the new DHCP Kea server but when I start it I see this warning in the log:


DHCP4_CONFIG_SYNTAX_WARNING configuration syntax warning: /usr/local/etc/kea/kea-dhcp4.conf:238.10: Extraneous comma. A piece of configuration may have been omitted.


I had a look at the file and indeed I noticed that an extra comma was added after the square bracket that closes the
"subnet4" array.

I pasted the file in a JSON linter and it was reported as invalid. I removed that comma and the JSON was marked valid.
I assume that the Kea warning is reporting the same issue..
Thanks for your work


Thanks for letting me know. I'll follow the issue there

--- kea-dhcp4.conf      2024-02-01 03:28:33.767775000 -0600
+++ kea-dhcp4.conf.ok   2024-02-01 03:07:07.834667000 -0600
@@ -65,7 +65,7 @@
             {
                 "library": "/usr/local/lib/kea/hooks/libdhcp_lease_cmds.so",
                 "parameters": { }
-            },
+            }
{% if not helpers.empty('OPNsense.Kea.dhcp4.ha.enabled') %}
             {
                 "library": "/usr/local/lib/kea/hooks/libdhcp_ha.so",