Admin page suddenly showing no data, but pihole suppressing ads OK

The issue I am facing:
The admin page shows no data, and this is the first time I've experienced this. Pihole is suppressing ads, so it's functioning, but on the dashboard, Statistics of Total Queries, Ads Blocked, Percentage blocked show only '---'. (And it's the same in Chrome and Firefox.)

Long term data also shows no information. Instead it shows empty Graphics and Top Lists, and an error alert when clicking Query log.
Items under Tools provide no information (except Generate debug log). They're either empty or give an error alert.

Details about my system:
I've been running pihole on a Raspberry pi4 (Buster) for years. Server is Apache2.
lighttpd is installed but it keeps stopping if I try to start it so I changed lighttpd port to 8080 in /etc/lighttpd/lighttpd.conf
server. port = 8080

What I have changed since installing Pi-hole:
Nothing. I've updated pi OS and pihole, but I do that regularly.
This happened just after I did a clean re-install of Windows 10. I don't know how (or even if) that could be related to what's happening on a Raspberry pi.

Debug Token:

9Y0dmL3c

Here's more detail of what I've tried:

pihole -c shows that it's active.

I've updated the pi, and pihole. I've done a pihole repair. The admin page still looks the same.

The Query Log shows actual blocked and OK domains, but Long-term data & Query Log shows none, and says an unknown error occurred while loading the data and I need to increase PHP memory limit. I did that to 256MB, but that didn't help.


I click on Pi-hole diagnosis in left hand navigation. Alert pops up:
DataTables warning: table id=messagesTable - Ajax error. For more information about this error, please see 7. Warning: Ajax error

Followed instructions there and found the following via the developer console:

ethicalads.min.js:1 
 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
ssl.google-analytics.com/ga.js:1 
 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
dynamic.php?comments…2Ftech-notes%2F7:17 Uncaught ReferenceError: ethicalads is not defined

Next I generated a debug log and found the following:

  1. Gateway issue:---------------------------------------------------------
[i] Default IPv4 gateway: 192.168.0.1
192.168.0.1
   * Pinging 192.168.0.1
192.168.0.1...
[✗] Gateway did not respond. (https://discourse.pi-hole.net/t/why-is-a-default-gateway-important-for-pi-hole/3546)

but from command line there's no problem accessing it:

pi@raspberrypi:~ $ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.684 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.638 ms
^C

The pi is connected to the router with an Ethernet cable, not WiFi.

  1. lighttpd issues:---------------------------------------------------------
    [✗] lighttpd daemon is failed

From online suggestions here 18.04 - Failed to start Lighttpd Daemon on boot - Ask Ubuntu,
I saw that installing gamin fixed this for someone. Didn't for me but the above is for Ubuntu anyway.
Also, that chown -R www-data:www-data /var/log/lighttpd/ might fix it. Again it didn't for me.
tried to purge and reinstall:

sudo apt-get purge lighttpd
sudo apt-get install lighttpd
sudo pihole -r
No difference.

/var/log/lighttpd/error-pihole.log contains this:

2022-08-05 21:27:15: (server.c.1464) server started (lighttpd/1.4.53) 
2022-08-05 21:27:15: (server.c.1493) WARNING: unknown config-key: alias.url (ignored)

The repair showed all green ticks except for these:

[i] Target: https://mirror1.malwaredomains.com/files/justdomains
  [✗] Status: Not found
  [✗] List download failed: no cached list available

[i] Target: https://hosts-file.net/ad_servers.txt
  [✗] Status: Not found
  [✗] List download failed: no cached list available

[✗] tcp:*:80 is in use by apache2 (Prerequisites - Pi-hole documentation)
port for lighttpd was 80, as was apache2, so there's a conflict. Changed lighttpd port to 8080 in

/etc/lighttpd/lighttpd.conf 
server. port = 8080

rebooted the pi, and trying to start lighttpd gives the same error message


*** [ DIAGNOSING ]: Dashboard and block page
[✗] Block page X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 200 OK
Date: Fri, 05 Aug 2022 07:53:00 GMT
Server: Apache/2.4.38 (Raspbian)
Content-Type: text/html;charset=UTF-8

[✗] Web interface X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 200 OK
Date: Fri, 05 Aug 2022 07:53:00 GMT
Server: Apache/2.4.38 (Raspbian)
Set-Cookie: PHPSESSID=k37rn4hpkflkb7gb45javd66sa; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=UTF-8

Finally I moved pihole-FTL.db to my own directory and did
service pihole-FTL start

After that, the admin page looked the same, Pi-hole diagnosis gave the same error alert, and a new run of Generate debug log showed the same errors.

To me it seems likely that all these errors come from one issue, but I haven't been able to find any suggestion that work on here or on reddit.

Debug token 9Y0dmL3c

The change you are making is subject to over-write during a Pi-hole update or repair (as indicated in the prominent warning at the top of the file you are editing):

###############################################################################
#     FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE.     #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#              CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE:              #
#                         /etc/lighttpd/external.conf                         #
###############################################################################

A permanent method of changing the lighttpd port (for lighttpd version 1.4.46 or later):

Check your lighttpd version with this command.

lighttpd -v

If that returns 1.4.46 or above, you can overwrite the port from Pi-hole's lighttpd.conf in your external.conf like this:

server.port := 8888

Note that the := operator isn't supported in older versions of lighttpd .

What is the exact URL you are using to access the web admin GUI?

Why do you have two separate IP's assigned to the ethernet interface on the Pi?

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] oncue1.com is 0.0.0.0 on lo (127.0.0.1)
[✓] oncue1.com is 0.0.0.0 on eth0 (192.168.0.117)
[✓] oncue1.com is 0.0.0.0 on eth0 (192.168.0.104)

Why?

Thanks for your help. Much appreciated.

version is lighttpd/1.4.53

I opened external.conf and it already contains
server.port := 8888
I didn't put it there IIRC, but perhaps I did long ago.

URL I'm using to access the web admin GUI is
http://192.168.0.104/admin/
as I have been for years.
and that's the major part of the problem. When I access
http://192.168.0.104:8888/admin/
All the expected data is present.

So I ran Generate debug log from that URL, and still see (just picking out the error lines)

[✗] Gateway did not respond.
[✗] tcp:*:80 is in use by apache2 
[✗] Failed to resolve doubleclick.com via a remote, public DNS server (2001:4860:4860::8888)
[✗] Block page X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 200 OK
Date: Fri, 05 Aug 2022 15:47:32 GMT
Server: Apache/2.4.38 (Raspbian)
Content-Type: text/html;charset=UTF-8

[✗] Web interface X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 200 OK
Date: Fri, 05 Aug 2022 15:47:32 GMT
Server: Apache/2.4.38 (Raspbian)
Set-Cookie: PHPSESSID=tfdiq3ftheqb5vful3o7b8sppg; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=UTF-8

Do you reckon I need to worry about these?

I don't know why have two separate IP's assigned to the ethernet interface on the Pi. I have a fixed IP (104), maybe 117 is being allocated automatically? I've been using pihole for so long I don't have a record of early setup. http://192.168.0.117:8888/admin/ also shows a working admin page with the same numbers. And it shows the same errors in a freshly generated debug log.

I'll remove the 117 IP.

I moved pihole-FTL.db to my own directory because I read something about it possibly being locked and doing that would cause it to be regenerated. I was at the stage of trying any suggestion.

Thanks again.

You have changed the port to 8888, so this URL should be:

http://192.168.0.104:8888/admin/

Without the port included, you are loading Apache, which isn't configured to serve Pi-hole web admin GUI data.

Yeah, understood, but I haven't changed anything recently and it's been working on :80 for years. I guess it must have changed under the lid in an update, but seems odd.

Anyway, I know what to do now, thanks.

Something is starting Apache on your device. That isn't related to any Pi-hole updates, so it must be something at the OS level.

You can disable and remove Apache, and then put Pi-hole back on port 80 and it's a stock install again.

I installed Apache2 as a web server for web development years ago and use it for that daily.

I used it for this before I installed pihole, also years ago.

Other than editing js/php/html files with VS Code (from Windows), all I do on this pi is update the OS and pihole, so it's a mystery as to what's changed. I could see the admin page on :80 until about a month ago.

I'm happy to use :8888 and just need to get rid of that extra ip address once I've looked up how to do it.

Thanks a lot.

If you've been able to access Pi-hole's UI when Apache has been serving port 80 while lighttpd was active on 8080, then your Apache must somehow have been configured to redirect or rewrite requests for pi.hole to lighttpd.
Did you consider to verify whether such an Apache configuration would still be in place?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.