DHCP6: ALLOC_ENGINE_V6_ALLOC_FAIL error seen in the logs
name: Bug report
about: Create a report to help us improve
Describe the bug
I'm using KEA DHCPv6 to assign two type of addresses:
- IPv6 loopback to router with an infinite lease
- IoT endpoint with a 30 days lease using rapid-commit
Each time KEA assigns an IPv6 address to an endpoint, I see the following warning message in the logs:
2021-02-22 02:48:30.828 INFO [kea-dhcp6.leases/1] DHCP6_LEASE_ALLOC duid=[00:03:00:06:00:a7:42:10:00:e9:06:fa], tid=0xdb0147: lease for address fd12:0:0:4::4 and iaid=0 has been allocated for 2592000 seconds
2021-02-22 02:48:30.828 WARN [kea-dhcp6.alloc-engine/1] ALLOC_ENGINE_V6_ALLOC_FAIL duid=[00:03:00:06:00:a7:42:10:00:e9:06:fa], tid=0xdb0147: failed to allocate an IPv6 address after 0 attempt(s)
But the endpoint actually got its address initially so everything looks good. After sometime and some churns in the network where the endpoint requests several times their addresses, KEA actually stops replying and we start seeing the following error:
2021-02-23 02:17:09.719 INFO [kea-dhcp6.leases/1] DHCP6_LEASE_ALLOC duid=[00:03:00:06:08:4f:a9:10:00:21:ad:e8], tid=0x2fa760: lease for address fd12:0:0:5::2 and iaid=0 has been allocated for 2592000 seconds
2021-02-23 02:17:09.719 WARN [kea-dhcp6.alloc-engine/1] ALLOC_ENGINE_V6_ALLOC_FAIL duid=[00:03:00:06:08:4f:a9:10:00:21:ad:e8], tid=0x2fa760: failed to allocate an IPv6 address after 0 attempt(s)
2021-02-23 02:17:09.720 ERROR [kea-dhcp6.packets/1] DHCP6_PACKET_SEND_FAIL failed to send DHCPv6 packet: pkt6 send failed: sendmsg() returned with an error: Message too long
At this point, the only way to recover is to delete the leases csv file and restart the DHCP server. It will recreate a new one and load the previous leases from kea-leases6.csv.2
To Reproduce Steps to reproduce the behavior:
- Run Kea dhcpv6 daemon. (/uploads/f386848ed04dc709e249c36d2c5c53bb/kea-dhcp6.conf)
- The IoT endpoints sends a DHCPv6 solicit which is relayed by a router
- The server does the address allocation and add this warning message to the logs.
- Initially the allocation works despite the warning message but after sometime, it starts failing.
Expected behavior The server should be able to assign the IPv6 address without any error and in a reliable way.
Environment:
- Kea version: 1.6.3
- OS: Ubuntu 20.04 (based layer for a docker image deployed on a Centos7 host)
Additional Information
- Config file: kea-dhcp6.conf
- log file: kea-dhcpv6.log
- kea-leases6.csv lease file when the issue is happening: kea-leases6.csv
- kea-leases6.csv.2 lease file when the issue is happening: kea-leases6.csv.2
Contacting you e-mail is preferred