Trying to delete all active DHCP leases at once fails

Hi,

while playing around with v6beta I found in Currently active DHCP leases section, ticking the select all button and ticking the bin button aferwards results in an error.
I have 3 active DHCP leases and when I try to delete them all at once a red square on the upper right appears saying
The provided IPv4 adress is invalid 192,192,192
FTL.log says:
2023-11-28 15:21:51.013 API: The provided IPv4 address is invalid (192,192,192)

Trying to delete the leases 1by1 works quite well.

Did a debug as well if needed
https://tricorder.pi-hole.net/eWfWcJWd/

cheers :slight_smile:

Thanks for your report. I have a proposed bugfix for this and would greately appreciate if you could verify it. Simply run

pihole checkout web fix/mass_delete_dhcp_leases

to get it and then test away :slight_smile:

This bug fix is "proposed" as I am currently unable to test it myself but looking at the code it seems quite obvious to me what the issue was so :crossed_fingers: that this fix is already enough.

sure, after switching to fix/mass_delete_dhcp_leases

the error persists but the red square now contains my active leases

**The provided IPv4 address is invalid**
192.168.8.206,192.168.8.236,192.168.8.243

FTL.log is similar
2023-11-28 15:54:53.142 API: The provided IPv4 address is invalid (192.168.8.206,192.168.8.236,192.168.8.243)

Okay, I see what is going on... I simplified the whole code. Could you please run the checkout command and repeat your test?

Almost I'd say.

  1. DHCP leases get removed now :+1: :tada:
  2. 3 squares fall down on the upper right, 2 blue undefinded and a green success
× **Deleting lease...**
undefined

× **Deleting lease...**
undefined

× **Successfully deleted lease**
  1. FTL.log doesn't mention any complains

One of my colleagues just pointed me to

https://github.com/pi-hole/web/pull/2792

where I fixed the exact same bug already one month ago - but this fix somehow never made it into development-v6 so far...

So scratch my "new" bug fix here and please test

pihole checkout web fix/del_dhcp_leases

instead. Sorry for the confusion...

1 Like

lol no worries but hey big up for having such nice colleagues :slight_smile: I switched branch and it also removes the DHCP leases.
Unfortunately the squares popped up so fast, my eyes almost weren't able to catch it :slight_smile: .
So basically I got 3 blue squares now saying undefinded and 3 green squares for successfully deleted lease. So 2 popups (1 undefined , 1 success) per lease.

Where do they say "undefined"? In the first or second row?

I'm very sorry for the confusion but my eyes have tricked me. I did a screen recording to capture the squares output (please bare with me, it's so fast)) and they state:
'successfully deleate lease' in blue for all (3) deleted leases
followed by exactly the same message in (3) green squares

läuft! :tada: :slight_smile:

thanks for the fast hands on :+1:

1 Like