kea4 crash when "remote-network4-del" command is issued with "subnets-action":"delete"
- kea configuration:
"Dhcp4": {
"config-control": {
"config-databases": [
{
"name": "keadb",
"password": "keapass",
"type": "mysql",
"user": "keauser"
}
]
},
"control-socket": {
"socket-name": "/home/wlodek/installed/git/var/run/kea/control_socket",
"socket-type": "unix"
},
"hooks-libraries": [
{
"library": "/home/wlodek/installed/git/lib/kea/hooks/libdhcp_cb_cmds.so"
},
{
"library": "/home/wlodek/installed/git/lib/kea/hooks/libdhcp_mysql_cb.so"
}
],
"interfaces-config": {
"interfaces": [
"enp0s9"
]
},
"lease-database": {
"type": "memfile"
},
"loggers": [
{
"debuglevel": 99,
"name": "kea-dhcp4",
"output_options": [
{
"output": "/home/wlodek/installed/git/var/log/kea.log"
}
],
"severity": "DEBUG"
}
],
"server-tag": "abc"
}
wlodek@debian9-64-2:kea (master) $ /home/wlodek/installed/git/sbin/kea-dhcp4 -V
1.6.0-beta-git
git 5511725555138213de4f48dc1091d65b5db47034
linked with:
log4cplus 1.1.2
OpenSSL 1.0.2s 28 May 2019
database:
MySQL backend 8.1, library 10.1.37-MariaDB
PostgreSQL backend 5.1, library 90613
Memfile backend 2.1
- added server-tag "abc" to database
- added network "net1" with server-tag "abc"
{'arguments': {'remote': {'type': 'mysql'},
'server-tags': ['abc'],
'shared-networks': [{'interface': 'enp0s9', 'name': 'net1'}]},
'command': 'remote-network4-set',
'service': ['dhcp4']}
{
"arguments": {
"shared-networks": [
{
"name": "net1"
}
]
},
"result": 0,
"text": "IPv4 shared network successfully set."
}
all is cool 4. now let's delete this network:
{'arguments': {'remote': {'type': 'mysql'},
'shared-networks': [{'name': 'net1'}],
'subnets-action': 'delete'},
'command': 'remote-network4-del',
'service': ['dhcp4']}
and we already getting message about dhcp4 service offline
{
"result": 1,
"text": "unable to forward command to the dhcp4 service: End of file. The server is likely to be offline"
}
but kea-ctrl-agent is actually forwarding this message, which kea logs shows:
2019-07-16 10:24:35.097 INFO [kea-dhcp4.commands/2207] COMMAND_RECEIVED Received command 'remote-network4-del'
2019-07-16 10:24:35.097 DEBUG [kea-dhcp4.callouts/2207] HOOKS_CALLOUTS_BEGIN begin all callouts for hook $remote_network4_del
2019-07-16 10:24:35.097 DEBUG [kea-dhcp4.mysql-cb-hooks/2207] MYSQL_CB_GET_TYPE4 get type
2019-07-16 10:24:35.097 DEBUG [kea-dhcp4.mysql-cb-hooks/2207] MYSQL_CB_DELETE_SHARED_NETWORK_SUBNETS4 delete shared network: net1 subnets
2019-07-16 10:24:35.097 DEBUG [kea-dhcp4.database/2207] DATABASE_MYSQL_START_TRANSACTION starting new MySQL transaction
but it died during this performing -del; data from database was NOT removed, there is NO kea error log, message at the end of tests indicate that kea-dhcp4 is not working
FAILED[192.168.51.3] sudo: /home/wlodek/installed/git/sbin/keactrl stop
[192.168.51.3] out: INFO/keactrl: kea-dhcp4 isn't running.
[192.168.51.3] out: INFO/keactrl: kea-dhcp6 isn't running.
[192.168.51.3] out: INFO/keactrl: kea-dhcp-ddns isn't running.
[192.168.51.3] out: INFO/keactrl: Stopping kea-ctrl-agent...
[192.168.51.3] out: INFO/keactrl: kea-netconf isn't running.
and in fact there are leftovers:
wlodek@debian9-64-2:kea (master) $ ls -l /home/wlodek/installed/git/var/run/kea/
total 4
srwxr-xr-x 1 root root 0 Jul 16 10:24 control_socket
-rw-r--r-- 1 root root 5 Jul 16 10:24 kea.kea-dhcp4.pid
I don't have time to debug it but journalctl
shows this error:
debian9-64-2 kernel: kea-dhcp4[2207]: segfault at 4a1 ip 00007f28f6569484 sp 00007ffef7962d90 error 4 in libmariadbclient.so.18.0.0[7f28f653b000+37f000]
- problem occur no matter if there is or isn't subnet configured for network.
- problem NOT occur on "subnets-action":"keep"