I installed PiHole on a Raspberry Pi 4, 8 GB memory, alongside Apache 2 (for web server). It was a very simple, straightforward installation. Nothing else was running on the Pi except Apache 2 server (and the Raspian OS) It has a static IP address and is connected to LAN via Ethernet.
Only other hardware things to point out, for completness are that I have a 1 TB NVMe SSD connected as boot drive via the USB3 interface (with a powered hub) and the power supply for the Pi is an "approved" (min 3.5A, 5V) supply wall-wart.
(I had configured lighttpd.conf admin interface to use server port 8080 to access the admin interface.) Everything has gone fine, as expected, for several months, until I performed an upgrade via "pihole -up" and rebooted last week. Ever since, my entire LAN has not had access to the Internet, because FTL cannot run.
Expected Behaviour:
Expected simple upgrade of pihole software, with no bugs.
Actual Behaviour:
The original error message is the same as what I have now, which I realize only indicates a specific condition at this time, namely a php script is crashing. Rebooting will generate a slightly different error message, but the net effect (I think) is that FTL cannot run.
["PHP error (2): fsockopen(): Unable to connect to 127.0.0.1:4711 (Connection refused) in /var/www/html/admin/scripts/pi-hole/php/FTL.php:47"]
Rebooting after a command of 'pihole -r' (to reconfigure as in installation),
results in this error message:
"DNSMASQ_CONFIG FTL failed to start due to failed to create listening socket for port 53: Address already in use"
[NOTE: Iam confused about this. Everything I have read online states that FTL uses port 53 for DNS. However, the PHP script that crashes ("FTL,php") specifies port 4711 in an earlier line!]
Basically, DNS no longer works on LAN. I have changed the router back to use Google DNS, but random clients (like my Windows 10 laptop) won't go back to that setting and even after multiple reboots, new re-leases to DHCP, etc, and there's no way to edit DNS on laptop unless I assign static IP.
It simply refuses to use the DNS specified on router. So, I have to connect to wifi on my router to access the LAN, printer, and ssh to the pi (or use the web/admin interface), or else I have to connect to the Xfinity "wireless gateway" to access the internet. Other clients on the LAN are being just as difficult. (I suspect that by the time I get the Pihole fixed, most or all of them will finally be using Google DNS, then I'll have the same difficulties getting them back to using the Pi on it's local, static address again.)
I have tried multiple pihole debugs (I will post latest key later, after I've reconnected to router, in order to ssh to pi and re-run debug script again.)
I have also done "pihole -r" (reconfigure) multiple times, rebooting after eqch one.
For a while, it seemed that the problem was that dnsmasq was running and conflicting with FTP, because I kept getting this error:
"DNSMASQ_CONFIG FTL failed to start due to failed to create listening socket for port 53: Address already in use"
Much googling and reading was done over last few days to determine how to solve that problem, or even if it was the real problem.
But after completely uninstalling pihole, rebooting, and running this command:
sudo apt-get remove dnsmasq-base
(to completely remove dnsmasq)
I still got the same error message when I reinstalled pihole, indicating that FTL couldn't run because something else was using the port (#53).
Also, this command:
sudo ss -tulpn sport = 53
gives this result:
Netid | State | Recv-Q | Send-Q | Local Address:Port | Peer Address:Port | Process |
---|---|---|---|---|---|---|
Udp | UNCONN | 0 | 0 | 127.0.0.1:53 | 0.0.0.0:* | users:((unbound,pid=798,fd=5)) |
Udp | UNCONN | 0 | 0 | : | : | users:((unbound,pid=798,fd=3)) |
Tcp | LISTEN | 0 | 256 | 127.0.0.1:53 | 0.0.0.0:* | users:((unbound,pid=798,fd=6)) |
tcp | LISTEN | 0 | 256 | [::]:* | [::]:* | users:((unbound,pid=798,fd=4)) |
...which shows that SOMETHING is still blocking the port, I just don't know enough to figure out what exactly.
All my reading and internet research seemed to indicate that the problem was caused by dnsmasq running, which blocked FTL from running.
Removing dnsmasq seemed to fix other people's problems after they got the same error message.
However, I did notice that when I reinstalled pihole, there was an indication in the console message that something went wrong. I can furnish the install log and prior "reconfigure" logs for anyone who can read them. I cannot make sense of them, unfortunately.
However, this latest attempt, after re-installing pihole, rebooting, then restarting the DNS service (because of the previous error message), now in the Pihole Admin Webpage I got a new error message:
Debugging information:
PHP error (2): fsockopen(): Unable to connect to 127.0.0.1:4711 (Connection refused) in /var/www/html/admin/scripts/pi-hole/php/FTL.php:47
I was able to figure out from this last error message that this problem refers a php script, specifically FTL.php, that crashes on line 47. However, that is simply a call to fsockopen(): that doesn't work, because a resource is already in use.
I have determined that dnsmasq is NOT running, it has been completely removed, and all its dependancies were autoremoved.
Frankly, I'm at a loss of what to do anymore. I've been going around in circles for days, and I need to get this working, I cannot spend more time on it. I have actual work to do, and need my internet working.
##Debug Token: https://tricorder.pi-hole.net/0XiIBgzi/
(This was from the latest debug script prior to uninstalling and re-installing the PiHole software.)
As noted, after I make this post, I will attach to my router, run the debug script again, and post the token.
And I can furnish the install logs that reference that a "bug needs to be reported."
I wish I could go back to the version of pihole I was runnung, but unfortunately, I had no backups, and I don't remember which version it was. I only know an approximate date, which was sometime in Janury 2024 that I installed it.
Thanks in advance to anyone who can provide help.