Upgrade is lost after reboot

I am having an upgrade issue. This has been going on for at least a year. My work around is never reboot the Raspberry Pi unless absolutely necessary.

I am running 2 pi-holes (Rpi-3s) on my network and this issue applies to both and to several different update attempts (issue is repeatable).

Expected Behavior:
I have upgraded to Pihole v5.6 FTL v5.11 and Web Interface 5.8. The expected behavior is the upgrade remains after a reboot of the Rpi-3.

Actual Behavior:
After upgrade everything is working fine. But after a reboot, Pi-hole comes up running Pihole v5.2.4, FTL v5.7 and Web interface 5.4 but still processing DNS requests. Also changes made to the Web interface on Pihole v5.6 are lost, and "Conditional Forwarding" which was unchecked before reboot is checked after reboot.

Debug Token #1 After upgrade to pihole v5.6:
https://tricorder.pi-hole.net/moDKLJ3I/

Debug Token #2 After reboot of Rpi-3 (pihole now back at v5.24):
https://tricorder.pi-hole.net/a6nDPiRg

Thanks in advance for any help you can provide.

David

Your first debug log shows your database to be corrupted:

*** [ DIAGNOSING ]: contents of /var/log
-rw-r--r-- 1 pihole pihole 231K Nov 19 20:20 /var/log/pihole-FTL.log
   -----head of pihole-FTL.log------
   [2021-06-03 08:59:00.579 13031/T13035] Notice: Database size is 1571.80 MB, deleted 173 rows
   [2021-11-19 19:43:00.133 566/T570] SQLite3 message: database corruption at line 81498 of [a26b6597e3] (11)
   [2021-11-19 19:43:03.073 566M] SQLite3 message: disk I/O error in "SELECT aliasclient_id FROM network WHERE id = (SELECT network_id FROM network_addresses WHERE ip = ? AND aliasclient_id IS NOT NULL GROUP BY ip HAVING max(lastSeen));" (5898)
   [2021-11-19 19:43:03.073 566M] getAliasclientIDfromIP("192.168.128.232") - SQL error prepare: disk I/O error
   [2021-11-19 19:43:03.073 566M] WARN: getOverTimeID(1637371500): 24554 is too large: 1622639100
   [2021-11-19 19:43:03.074 566M] getMACfromIP("192.168.128.232") - Database not available
(...)
   -----tail of pihole-FTL.log------
   [2021-11-19 20:20:00.009 24633/T24637] SQLite3 message: disk I/O error in "DELETE FROM network_addresses WHERE lastSeen < 1605838800;" (5898)
   [2021-11-19 20:20:00.009 24633/T24637] ERROR: SQL query "DELETE FROM network_addresses WHERE lastSeen < 1605838800;" failed: disk I/O error
   [2021-11-19 20:20:00.019 24633/T24637] SQLite3 message: API call with invalid database connection pointer (21)
   [2021-11-19 20:20:00.019 24633/T24637] SQLite3 message: misuse at line 166280 of [5c9a6c0687] (21)
   [2021-11-19 20:20:00.019 24633/T24637] Error while trying to close database: bad parameter or other API misuse

In addition, the I/O errors would suggest there is an issue with your storage device.
(Your time seems also off, but that's not likely related to your upgrade issue.)

You wouldn't employ some kind of in-memory filesystem where you also store (some of) Pi-hole's data?
Or, as you run two Pi-holes, you wouldn't try to share databases among them?

Your second debug log contains only unintelligible trash at the beginning

��?%fe80::d610
(...)

That again would suggest a storage device issue (or maybe just a problem with uploading the log).

Could you check whether /var/log/pihole_debug.log would contain the same trashy lines at the start (presuming that you haven't created a new debug log in the meantime)?

If it is indeed your sd card storage, those failures may be prompted by an insufficient power supply for your RPi. You chould check your RPi's system logs for any recent occurences of voltage issues:

zgrep -ni “voltage” /var/log/syslog*

Syslog shows no entries for "voltage"

adblock@Pi-Hole-2:/var/log $ cat syslog | grep voltage
adblock@Pi-Hole-2:/var/log $ zgrep -ni "voltage" syslog
adblock@Pi-Hole-2:/var/log $ zgrep -ni "voltage" syslog*

However I see gravity database entries in the syslog.

Jun  3 07:39:06 Pi-Hole-2 systemd[1]: Starting Clean php session files...
Jun  3 07:39:06 Pi-Hole-2 systemd[1]: Started Clean php session files.
Jun  3 07:40:01 Pi-Hole-2 CRON[20560]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 07:50:01 Pi-Hole-2 CRON[20635]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 08:00:01 Pi-Hole-2 CRON[20711]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 08:09:01 Pi-Hole-2 CRON[20775]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; the
n /usr/lib/php/sessionclean; fi)
Jun  3 08:09:06 Pi-Hole-2 systemd[1]: Starting Clean php session files...
Jun  3 08:09:06 Pi-Hole-2 systemd[1]: Started Clean php session files.
Jun  3 08:10:01 Pi-Hole-2 CRON[20832]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 08:17:01 Pi-Hole-2 CRON[20889]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Jun  3 08:20:01 Pi-Hole-2 CRON[20917]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 08:30:01 Pi-Hole-2 CRON[20994]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 08:39:01 Pi-Hole-2 CRON[21061]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; the
n /usr/lib/php/sessionclean; fi)
Jun  3 08:39:06 Pi-Hole-2 systemd[1]: Starting Clean php session files...
Jun  3 08:39:06 Pi-Hole-2 systemd[1]: Started Clean php session files.
Jun  3 08:40:01 Pi-Hole-2 CRON[21116]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 08:50:01 Pi-Hole-2 CRON[21184]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 09:00:01 Pi-Hole-2 CRON[21261]: (root) CMD (   PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jun  3 09:00:45 Pi-Hole-2 systemd[1]: Starting Daily apt download activities...
Jun  3 09:00:47 Pi-Hole-2 systemd[1]: Started Daily apt download activities.
Jun  3 09:00:47 Pi-Hole-2 systemd[1]: apt-daily.timer: Adding 4h 57min 9.608817s random time.
Jun  3 09:00:47 Pi-Hole-2 systemd[1]: apt-daily.timer: Adding 6h 29min 5.730881s random time.
borders.112.2o7.net
boscovs.com.ssl.sc.omtrdc.net
bostoncommonpress.112.2o7.net
bostonscientificcorporation.112.2o7.net
brangista.122.2o7.net
brightcove.112.2o7.net
brighthouse.122.2o7.net
britishskybroadcasti.tt.omtrdc.net
bruceclay.112.2o7.net
btbusiness.d1.sc.omtrdc.net
btbusiness.tt.omtrdc.net
btcom.112.2o7.net
btigspresalessandt.112.2o7.net
budgetcarhire.112.2o7.net
builderonlinecom.112.2o7.net
businessweekpoc.112.2o7.net
buycom.122.2o7.net
buzzfeed.d1.sc.omtrdc.net
buzznet.112.2o7.net

I think my best course of action will be to re-install the OS and pihole from scratch. Thanks for your help.
David

Fair choice.

If you'd decide for further analysis instead, please answer my previous questions: