Deleting items from list, using web interface

I had 10+ regex entries, and wanted to delete them, using the web interface.
Clicking on the garbage can icon deletes the entry only if you wait until the green message appears. If the user clicks on the next garbage can icon, before the green message appears, the first entry will disappear from the web interface but is not removed from the database, which is verifyable by simply refreshing the list (click on the menu item).
There should be something there to prevent the user from clicking on the next item until the delete has been completed...

There will be something to prevent the user from clicking on the next item until the delete (or any other operation) has been completed.

On slower hardware, waiting for database updates can take some time. Deleting a larger list (such as when deleting a whole whitelist or blacklist) might be a frustratingly long process while waiting for each line to update the DB.

I suggest queueing the changes and adding a save button to process the whole batch at once.

1 Like

I tried this on a Raspberry Pi 3B+ and never saw delays of more than 20-40 msec. I don't think any other devices will be horribly slower?

The behavior is strange on my Pi Zero.

On my whitelist, the first item deleted is fast, the next one seems very slow, around 6 seconds by my informal timer. I base this on the time from clicking the trashcan until the time the notice appears that it was removed.

I think the problem is that the second item is not actually removed from the database. I can run pihole -w -l and it second item deleted is still present. Reloading the browser brings it back on the GUI too.

Hmm, and it still showed the green success message for you on the web? Can you generate the same situation when trying to delete an entry from the CLI?

Yes, green success message is present on GUI.

On CLI, first try removes item, waited for a few seconds and second try reports database is locked and fails:

pi@pi0:~ $ pihole -w -d metrics.icloud.com
  [i] Removing metrics.icloud.com from the whitelist...
Error: database is locked
  [✓] Reloading DNS lists

Waited longer and I get this error:

pi@pi0:~ $ pihole -w -d metrics.icloud.com
  [i] Removing metrics.icloud.com from the whitelist...
  [✗] kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

It does look like the entry eventually gets removed through the CLI.

Looking at /var/log/pihole-FTL.log, I found it had crashed:

[2020-01-27 06:21:27.578 14984] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-01-27 06:21:27.579 14984] ---------------------------->  FTL crashed!  <----------------------------
[2020-01-27 06:21:27.579 14984] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-01-27 06:21:27.579 14984] Please report a bug at https://github.com/pi-hole/FTL/issues
[2020-01-27 06:21:27.579 14984] and include in your report already the following details:
[2020-01-27 06:21:27.579 14984] FTL has been running for 84621 seconds
[2020-01-27 06:21:27.579 14984] FTL branch: release/v5.0
[2020-01-27 06:21:27.580 14984] FTL version: vDev-9889501
[2020-01-27 06:21:27.580 14984] FTL commit: 9889501
[2020-01-27 06:21:27.580 14984] FTL date: 2020-01-23 19:12:40 +0100
[2020-01-27 06:21:27.580 14984] FTL user: started as pihole, ended as pihole
[2020-01-27 06:21:27.581 14984] Compiled for arm (compiled on CI) using arm-linux-gnueabihf-gcc (crosstool-NG crosstool-ng-1.22.0-88-g8460611) 4.9.3
[2020-01-27 06:21:27.581 14984] Received signal: Segmentation fault
[2020-01-27 06:21:27.581 14984]      at address: 0x6e617273
[2020-01-27 06:21:27.581 14984]      with code: SEGV_MAPERR (Address not mapped to object)
[2020-01-27 06:21:27.582 14984] Backtrace:
[2020-01-27 06:21:27.584 14984] B[0000]: 0x50bdb4, /usr/bin/pihole-FTL(+0x2bdb4) [0x50bdb4]
[2020-01-27 06:21:27.584 14984] B[0001]: 0xb6da6130, /lib/arm-linux-gnueabihf/libc.so.6(__default_rt_sa_restorer+0) [0xb6da6130]
[2020-01-27 06:21:27.584 14984] B[0002]: 0x57092c, /usr/bin/pihole-FTL(+0x9092c) [0x57092c]
[2020-01-27 06:21:27.585 14984] B[0003]: 0x5819a0, /usr/bin/pihole-FTL(+0xa19a0) [0x5819a0]
[2020-01-27 06:21:27.585 14984] B[0004]: 0x5e2774, /usr/bin/pihole-FTL(+0x102774) [0x5e2774]
[2020-01-27 06:21:27.585 14984] B[0005]: 0x5e2920, /usr/bin/pihole-FTL(sqlite3_finalize+0x64) [0x5e2920]
[2020-01-27 06:21:27.585 14984] B[0006]: 0x503c28, /usr/bin/pihole-FTL(gravityDB_close+0x80) [0x503c28]
[2020-01-27 06:21:27.585 14984] B[0007]: 0x50bb84, /usr/bin/pihole-FTL(FTL_reload_all_domainlists+0x14) [0x50bb84]
[2020-01-27 06:21:27.585 14984] B[0008]: 0xb6da6130, /lib/arm-linux-gnueabihf/libc.so.6(__default_rt_sa_restorer+0) [0xb6da6130]
[2020-01-27 06:21:27.586 14984] B[0009]: 0xb6ed83d4, /lib/arm-linux-gnueabihf/libpthread.so.0(accept+0x5c) [0xb6ed83d4]
[2020-01-27 06:21:27.586 14984] B[0010]: 0x505844, /usr/bin/pihole-FTL(telnet_listening_thread_IPv6+0xdc) [0x505844]
[2020-01-27 06:21:27.586 14984] ------ Listing content of directory /dev/shm ------
[2020-01-27 06:21:27.586 14984] File Mode User:Group  Filesize Filename
[2020-01-27 06:21:27.587 14984] rwxrwxrwx root:root 260 .
[2020-01-27 06:21:27.587 14984] rwxr-xr-x root:root 4K ..
[2020-01-27 06:21:27.588 14984] rw------- pihole:pihole 4K FTL-per-client-regex
[2020-01-27 06:21:27.599 14984] rw------- pihole:pihole 12K FTL-dns-cache
[2020-01-27 06:21:27.599 14984] rw------- pihole:pihole 53K FTL-overTime
[2020-01-27 06:21:27.600 14984] rw------- pihole:pihole 2M FTL-queries
[2020-01-27 06:21:27.601 14984] rw------- pihole:pihole 20K FTL-forwarded
[2020-01-27 06:21:27.601 14984] rw------- pihole:pihole 20K FTL-clients
[2020-01-27 06:21:27.602 14984] rw------- pihole:pihole 66K FTL-domains
[2020-01-27 06:21:27.603 14984] rw------- pihole:pihole 16K FTL-strings
[2020-01-27 06:21:27.603 14984] rw------- pihole:pihole 12 FTL-settings
[2020-01-27 06:21:27.604 14984] rw------- pihole:pihole 120 FTL-counters
[2020-01-27 06:21:27.604 14984] rw------- pihole:pihole 28 FTL-lock
[2020-01-27 06:21:27.605 14984] ---------------------------------------------------
[2020-01-27 06:21:27.605 14984] Thank you for helping us to improve our FTL engine!
[2020-01-27 06:21:27.605 14984] FTL terminated!

SQLite3 (embedded into FTL) crashed here. This is not really nice. We'll have to monitor if this is a single time issue or if it happens more often.

Okay, so it seems we're not properly checking for availability of the database when editing. I'll check this.

Thank you for looking into this. I will continue to test and monitor.

Ran pihole -up before trying to test again and it failed with an FTL crash:

[2020-01-27 16:48:34.341 3663] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-01-27 16:48:34.341 3663] ---------------------------->  FTL crashed!  <----------------------------
[2020-01-27 16:48:34.341 3663] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-01-27 16:48:34.341 3663] Please report a bug at https://github.com/pi-hole/FTL/issues
[2020-01-27 16:48:34.342 3663] and include in your report already the following details:
[2020-01-27 16:48:34.342 3663] FTL has been running for 40 seconds
[2020-01-27 16:48:34.342 3663] FTL branch: release/v5.0
[2020-01-27 16:48:34.342 3663] FTL version: vDev-9a5a941
[2020-01-27 16:48:34.342 3663] FTL commit: 9a5a941
[2020-01-27 16:48:34.342 3663] FTL date: 2020-01-27 14:52:36 -0800
[2020-01-27 16:48:34.343 3663] FTL user: started as pihole, ended as pihole
[2020-01-27 16:48:34.343 3663] Compiled for arm (compiled on CI) using arm-linux-gnueabihf-gcc (crosstool-NG crosstool-ng-1.22.0-88-g8460611) 4.9.3
[2020-01-27 16:48:34.343 3663] Received signal: Segmentation fault
[2020-01-27 16:48:34.344 3663]      at address: 0x226
[2020-01-27 16:48:34.344 3663]      with code: SEGV_MAPERR (Address not mapped to object)
[2020-01-27 16:48:34.344 3663] Backtrace:
[2020-01-27 16:48:34.345 3663] B[0000]: 0x4a7a54, /usr/bin/pihole-FTL(+0x2ba54) [0x4a7a54]
[2020-01-27 16:48:34.345 3663] B[0001]: 0xb6dbe130, /lib/arm-linux-gnueabihf/libc.so.6(__default_rt_sa_restorer+0) [0xb6dbe130]
[2020-01-27 16:48:34.345 3663] ------ Listing content of directory /dev/shm ------
[2020-01-27 16:48:34.346 3663] File Mode User:Group  Filesize Filename
[2020-01-27 16:48:34.346 3663] rwxrwxrwx root:root 260 .
[2020-01-27 16:48:34.347 3663] rwxr-xr-x root:root 4K ..
[2020-01-27 16:48:34.347 3663] rw------- pihole:pihole 4K FTL-per-client-regex
[2020-01-27 16:48:34.348 3663] rw------- pihole:pihole 12K FTL-dns-cache
[2020-01-27 16:48:34.349 3663] rw------- pihole:pihole 53K FTL-overTime
[2020-01-27 16:48:34.349 3663] rw------- pihole:pihole 2M FTL-queries
[2020-01-27 16:48:34.350 3663] rw------- pihole:pihole 20K FTL-forwarded
[2020-01-27 16:48:34.350 3663] rw------- pihole:pihole 20K FTL-clients
[2020-01-27 16:48:34.351 3663] rw------- pihole:pihole 66K FTL-domains
[2020-01-27 16:48:34.352 3663] rw------- pihole:pihole 8K FTL-strings
[2020-01-27 16:48:34.352 3663] rw------- pihole:pihole 12 FTL-settings
[2020-01-27 16:48:34.353 3663] rw------- pihole:pihole 120 FTL-counters
[2020-01-27 16:48:34.353 3663] rw------- pihole:pihole 28 FTL-lock
[2020-01-27 16:48:34.354 3663] ---------------------------------------------------
[2020-01-27 16:48:34.354 3663] Thank you for helping us to improve our FTL engine!
[2020-01-27 16:48:34.354 3663] FTL terminated!

I'm really sorry you're seeing so many crashes and really I'm not yet seeing where they are coming from. Speculations seem to point to a maybe broken SD card, however, I do not want to put the error elsewhere before I'm not convinced that this is the only viable option out there.

Could you please share the output of

addr2line -e /usr/bin/pihole-FTL 0x2ba54

I'm sorry. I nuked the card and re-imaged it from a backup as I couldn't get DNS resolution services to function on it anymore. I will try upgrading it again to Ver 5.0 and monitor the situation.

Thank you for your dedication to this project.

1 Like

So I tried upgrading again from the stock 4.3.2 version and FTL crashed:

[2020-01-28 10:23:20.655 10427] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-01-28 10:23:20.655 10427] ---------------------------->  FTL crashed!  <----------------------------
[2020-01-28 10:23:20.655 10427] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2020-01-28 10:23:20.655 10427] Please report a bug at https://github.com/pi-hole/FTL/issues
[2020-01-28 10:23:20.655 10427] and include in your report already the following details:
[2020-01-28 10:23:20.656 10427] FTL has been running for 1 seconds
[2020-01-28 10:23:20.656 10427] FTL branch: release/v5.0
[2020-01-28 10:23:20.656 10427] FTL version: vDev-9a5a941
[2020-01-28 10:23:20.656 10427] FTL commit: 9a5a941
[2020-01-28 10:23:20.656 10427] FTL date: 2020-01-27 14:52:36 -0800
[2020-01-28 10:23:20.657 10427] FTL user: started as pihole, ended as pihole
[2020-01-28 10:23:20.657 10427] Compiled for arm (compiled on CI) using arm-linux-gnueabihf-gcc (crosstool-NG crosstool-ng-1.22.0-88-g8460611) 4.9.3
[2020-01-28 10:23:20.657 10427] Received signal: Segmentation fault
[2020-01-28 10:23:20.657 10427]      at address: 0x226
[2020-01-28 10:23:20.657 10427]      with code: SEGV_MAPERR (Address not mapped to object)
[2020-01-28 10:23:20.658 10427] Backtrace:
[2020-01-28 10:23:20.659 10427] B[0000]: 0x472a54, /usr/bin/pihole-FTL(+0x2ba54) [0x472a54]
[2020-01-28 10:23:20.659 10427] B[0001]: 0xb6d36130, /lib/arm-linux-gnueabihf/libc.so.6(__default_rt_sa_restorer+0) [0xb6d36130]
[2020-01-28 10:23:20.659 10427] ------ Listing content of directory /dev/shm ------
[2020-01-28 10:23:20.659 10427] File Mode User:Group  Filesize Filename
[2020-01-28 10:23:20.660 10427] rwxrwxrwx root:root 260 .
[2020-01-28 10:23:20.660 10427] rwxr-xr-x root:root 4K ..
[2020-01-28 10:23:20.661 10427] rw------- pihole:pihole 4K FTL-per-client-regex
[2020-01-28 10:23:20.662 10427] rw------- pihole:pihole 12K FTL-dns-cache
[2020-01-28 10:23:20.662 10427] rw------- pihole:pihole 53K FTL-overTime
[2020-01-28 10:23:20.663 10427] rw------- pihole:pihole 983K FTL-queries
[2020-01-28 10:23:20.663 10427] rw------- pihole:pihole 20K FTL-forwarded
[2020-01-28 10:23:20.664 10427] rw------- pihole:pihole 20K FTL-clients
[2020-01-28 10:23:20.665 10427] rw------- pihole:pihole 66K FTL-domains
[2020-01-28 10:23:20.665 10427] rw------- pihole:pihole 12K FTL-strings
[2020-01-28 10:23:20.666 10427] rw------- pihole:pihole 12 FTL-settings
[2020-01-28 10:23:20.667 10427] rw------- pihole:pihole 120 FTL-counters
[2020-01-28 10:23:20.667 10427] rw------- pihole:pihole 28 FTL-lock
[2020-01-28 10:23:20.667 10427] ---------------------------------------------------
[2020-01-28 10:23:20.668 10427] Thank you for helping us to improve our FTL engine!
[2020-01-28 10:23:20.668 10427] FTL terminated!

Here is the output you requested:

pi@pi0:~ $ addr2line -e /usr/bin/pihole-FTL 0x2ba54
/root/project/src/signals.c:56

EDIT: here's the tricorder log:

Pihole_tricorder.txt (19.9 KB)

We updated the arm binary, did this resolve your issues @sawsanders?

Yes, I was able to upgrade to the newest version without FTL crashing. Deleting items in the whitelist is still hit and miss on my pi 0. It will remove the first item but has trouble trying to delete the next item unless you give it a minute or two. During the wait, it seems FTL is consuming 95-100% of the CPU

I will have to spend more time seeing if it’s a consistent issue and the exact steps to trigger it.

Thanks, this will be the same underlying issue as discussed here: Disabling Pi-Hole Breaks DNS for ~1 min - #19 by DL6ER

Thanks, but let me first address this issue before you waste any time here. I don't have the core code cloned to my phone so I'll check only when I'm back home (hopefully tomorrow).

@sawsanders See

Working great on the Pi Zero. My issues are resolved at this time.

Thanks for your work and dedication to this project!