Executing the following operational command results in a Python traceback instead of displaying the DHCPv6 server leases:
show dhcpv6 server leases
Actual Behavior
The command terminates with the following exception:
File "/usr/lib/python3/dist-packages/vyos/kea.py", line 665, in kea_get_server_leases
data_lease['state'] = lease_state_long[lease['state']]
KeyError: 4
Expected Behavior
The command should successfully display all DHCPv6 server leases without throwing an exception.
Technical Details
The exception occurs in vyos/kea.py, inside the kea_get_server_leases() function.
The code attempts to map the lease state returned by Kea to a human-readable state using lease_state_long. However, the returned state value (4) is not present in the mapping dictionary.
This appears to be a missing lease state mapping or an incompatibility between the Kea lease state values and VyOS's internal state mapping.
Suggested Fix
Consider handling unknown lease states gracefully or extending lease_state_long to include all valid Kea DHCPv6 lease states.
Impact
The operational command for displaying DHCPv6 server leases is unusable when a lease with an unmapped state is encountered.