[Solved] Pi-hole version on the fritz after lastupdate

I updated Dietpi to V136 and, as I have done in the past, I un-installed, then re-installed pi-hole to ensure I have all the latest lists.

Pi-hole installs and runs fine, however when I went to check it through the web interface, it reports back:

“Pi-hole needs to be updated to at least 2.7 before you can use features like whitelisting/blacklisting from this web interface!”

Checking at the bottom of the web interface page it shows:

“Pi-hole Version (Update available!) Web Interface Version v1.4.4.2”

The latest version of Pi-hole is:

Pi-Hole V2.9.5

Edit: Gah… I forgot to add it’s is the Raspberry Pi image I’m using on a RPi 2.

Hi,

We’ve had a few users report this.
Possibly some files left over from the existing installation that we missed during the uninstall.

Please can you paste the results of the following commands:

ls -lha /var/www
ls -lha /var/www/pihole
ls -lha /var/www/html
ls -lha /etc/.pihole
ls -lha /etc/pihole
root@DietPi:~# ls -lha /var/www
total 88K
drwxrwxr-x  3 www-data www-data 4.0K Nov  8 18:40 .
drwxr-xr-x 12 root     root     4.0K Apr  6  2016 ..
-rwxrwxr-x  1 www-data www-data  38K Apr  6  2016 apc.php
drwxrwxr-x  3 www-data www-data 4.0K Nov  7 17:15 html
-rwxrwxr-x  1 www-data www-data   68 Nov  8 18:40 index.html
-rwxrwxr-x  1 www-data www-data 3.3K Apr  6  2016 index.lighttpd.html
-rwxrwxr-x  1 www-data www-data  23K Apr  6  2016 opcache.php
-rwxrwxr-x  1 www-data www-data   20 Apr  6  2016 phpinfo.php
lrwxrwxrwx  1 www-data www-data   19 Nov  8 18:40 pihole -> /var/www/html/admin
root@DietPi:~# ls -lha /var/www/pihole
lrwxrwxrwx 1 www-data www-data 19 Nov  8 18:40 /var/www/pihole -> /var/www/html/admin
root@DietPi:~# ls -lha /var/www/html
total 16K
drwxrwxr-x 3 www-data www-data 4.0K Nov  7 17:15 .
drwxrwxr-x 3 www-data www-data 4.0K Nov  8 18:40 ..
drwxrwxr-x 9 www-data www-data 4.0K Nov  7 17:15 admin
-rwxrwxr-x 1 www-data www-data 3.3K Aug  6 16:43 index.lighttpd.html
root@DietPi:~# ls -lha /etc/.pihole
total 12K
drwxr-xr-x  2 root root 4.0K Sep  8 01:07 .
drwxr-xr-x 86 root root 4.0K Nov  8 18:39 ..
-rw-r--r--  1 root root 3.2K Sep  8 01:07 adlists.default
root@DietPi:~# ls -lha /etc/pihole
total 7.5M
drwxrwxrwx  2 root root 4.0K Nov  6 01:48 .
drwxr-xr-x 86 root root 4.0K Nov  8 18:39 ..
-rw-rw-rw-  1 root root 3.2K Nov  6 01:47 adlists.default
-rw-rw-rw-  1 root root    0 Sep  8 01:09 blacklist.txt
-rw-rw-rw-  1 root root 3.6M Nov  6 01:48 gravity.list
-rw-rw-rw-  1 root root 921K Nov  6 01:47 list.0.raw.githubusercontent.com.domains
-rw-rw-rw-  1 root root  12K Nov  6 01:47 list.1.adblock.gjtech.net.domains
-rw-rw-rw-  1 root root 267K Nov  6 01:47 list.2.mirror1.malwaredomains.com.domains
-rw-rw-rw-  1 root root 641K Sep  8 01:08 list.3.sysctl.org.domains
-rw-rw-rw-  1 root root 8.0K Nov  6 01:47 list.4.zeustracker.abuse.ch.domains
-rw-rw-rw-  1 root root  613 Sep  8 01:08 list.5.s3.amazonaws.com.domains
-rw-rw-rw-  1 root root  43K Sep  8 01:08 list.6.s3.amazonaws.com.domains
-rw-rw-rw-  1 root root 1.8M Nov  6 01:47 list.7.hosts-file.net.domains
-rw-rw-rw-  1 root root 274K Nov  6 01:48 list.8.raw.githubusercontent.com.domains
-rw-rw-rw-  1 root root  34K Nov  6 01:48 list.9.ransomwaretracker.abuse.ch.domains
-rw-rw-rw-  1 root root  193 Sep  8 01:19 whitelist.txt

Hi,

Thanks. Please try the following to uninstall PiHole:

rm -R /etc/pihole
rm -R /etc/.pihole
rm -R /var/www/html/admin
# - symlink
rm -R /var/www/pihole

Reinstall by running dietpi-software and selecting PiHole for installation.

copied and pasted all the commands as listed and ran them. Pi-hole still shows as installed and won’t let me install as it thinks it’s installed already.

Pi-hole is still running, but I no longer have the web consol. Should I reboot or should I attempt an uninstall from dietpi-software first or…

Hi,

Lets set the installation state back to 0. If PiHole asks questions to remove packages, say NO to all of them.

dietpi-software uninstall 93

Then installation should now be available.

[edit] I see I was typing while you answered… I did essentially what you described. {Oops… I let it delete whatever it wanted to, but it didn’t seem to harm anything]


Hi,

I have this sneaking suspicion that I was supposed to run the remove script first and then do the manual commands to clear anything else out.

I ran the remove script from dietpi-software and then I could re-install pi-hole. This time I got the lastest web consol and all appears to be well.

My only remaining problem is that I used to edit /etc/dsnmask.conf to switch from google’s DNS servers to OpenDNS. That file has changed big time and I cannot find where to edit the DNS address anymore… perhaps SystemD looks at another file somewhere else for that information?

The DNS server change is not a big deal, it works fine as is.

Thanks for your help.

Regards

Christian

Ah… I see that my whitelist is completely empty… fortunately, I have a screen shot of it, so I re-created it and added all the addresses via the web consol. I’m pretty sure the blacklist was empty as I never added anything there myself.

Hi,

I believe pihole uses the following config file for dnsmasq:

/etc/dnsmasq.d/01-pihole.conf

DNS entries are defined with lines that start with:

server=

If you cant find them in the pihole config, set them in the dnsmasq config:

/etc/dnsmasq.conf

I’ll have a look later, however another issue has cropped up.

I am not getting any statistics showing in the web consol. Perhaps this is related to my allowing the un-install to delete things, but I would have thought that Pi-Hole has started to write new logs?

I did not notice this yesterday, as I am used to having zero stats when it first starts up… but today, things are still at zero, including the number of domains being blocked which shows as zero, yet in use, ADs are being blocked, so Pi-Hole must be working.

The stats can take forever to show if the log file gets too big. Delete the log and they should reappear.

Everything in /var/log is empty… the file names are there, but zero data inside the logs… this goes for ALL the logs…

DietPi by default has Ramlog installed. All log files are mounted to RAM and cleared every hour.
https://dietpi.com/forum/t/dietpi-survey-information/32/1

The PiHole log files have an exclusion to the above Ramlog (/var/log/pihole), they are only cleared daily. So its most likely incorrect permissions on the file.

Check permissions with (should be www-data:www-data):

ls -lha /var/log/pihole.log

Permissions are:

root@DietPi:/var/log# ls -l pihole.log
-rwxrwxr-x 1 www-data www-data 0 Nov 10 14:27 pihole.log

Just to quickly get this done I did:

root@DietPi:/var/log# chmod 777 pihole.log

And after chmod it reads:

root@DietPi:/var/log# ls -l pihole.log
-rwxrwxrwx 1 www-data www-data 0 Nov 10 14:27 pihole.log

chmod appears to have had no effect on the problem. I wonder if I should just do a fresh install and get things back to normal? That would seem to be the “easy” way…


edit: I forgot to mention, it’s not just the log… it’s every data listing in the web consol:

0 Ads blocked today; 0 DNS inquiries; 0.0% of today’s traffic is ads; 0 Domains being blocked

I wonder if I should just do a fresh install and get things back to normal? That would seem to be the “easy” way…

Yep, never fails :slight_smile:

PiHole updates those stats by reading the logfile. So, possible the log file is not being updated correctly by dnsmasq.

Check the contents of /etc/dnsmasq.d/01-pihole.conf for logfile entry as per : pi-hole/advanced/01-pihole.conf at master · pi-hole/pi-hole · GitHub

Also, check dnsmasq is running with:

systemctl status dnsmasq -l

Hmmm… me thinks this does not look good.

root@DietPi:~# systemctl status dsnmasq -l
● dsnmasq.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
root@DietPi:~#

Argh… it was all my fault in the first place!

Update to Dietpi V137 has come along and I reluctantly installed it but I uninstalled Pi-Hole first (which probably had no bearing on this). I updated to 137 and then selected Pi-Hole for installation. On the last update, things appeared to break, leaving me with a limping system, which, by the way, I did not fix, but simply left it limping until today.

During the installation of Pi-Hole, a screen pops up that asks you to select the network interface… the last time I was updating I figured there was no point, as nothing had changed, and my ip address was set in the router etc, but in fact, hitting OK instead of cancel took me to new screens which had additional selections of DNS choice etc. and after following the bouncing ball, I was left with a perfectly working Pi-hole! The Web consol works correctly, all my stats show up as they should, and my chosen DNS is actually being used.

So I’m afraid, all that trouble earlier on can be blamed squarely on me and not Dietpi.

Regards

Kaptain “Doh…” Zero