PIHole broken after pihole software upgrade. Ran fine prior several months

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.

The debug token is not valid (or it is expired).

Can you please generate a new one?

This message only means the web interface is not able to connect with pihole-FTL, but it doesn't really explain why it's not connecting.

This other message is saying there is another service using port 53.

This explains the issue.
pihole-FTL needs port 53 to run, but the port is already taken, resulting in a failure to start.

Why there is something else using port 53?

We don't know (we need a debug log to make sure), but you said the system was broken after a software update.

I guess the OS update installed (or re-activated) some other service and broke Pi-hole.

A fresh debug log will really help in this case.

Sorry. I know I promised to do another debug script, but I got waylaid.
I did a fresh one this morning, here's the token:

https://tricorder.pi-hole.net/R1eVqMjq/

Thanks.

Is there a way to post the install log (without taking up so much space), or is it necessary?
The only reason I mention it is because it mentioned a "bug that should be posted."

The output you posted above shows that unbound is binding to port 53, preventing FTL from doing so.

There appears to have been a change to unbound recently which also caught me out (I use Docker containers for both PiHole and unbound). The custom port must be specified above the interface in the custom.conf otherwise it is ignored.

1 Like

Unbound is using port 53.

The debug log shows the same:

*** [ DIAGNOSING ]: Ports in use
[✗] udp:127.0.0.1:53 is in use by unbound (https://docs.pi-hole.net/main/prerequisites/#ports)
[✗] udp:[::1]:53 is in use by unbound (https://docs.pi-hole.net/main/prerequisites/#ports)
[✗] tcp:127.0.0.1:53 is in use by unbound (https://docs.pi-hole.net/main/prerequisites/#ports)
    tcp:0.0.0.0:8080 is in use by lighttpd
[✗] tcp:*:80 is in use by apache2 (https://docs.pi-hole.net/main/prerequisites/#ports)
[✗] tcp:[::1]:53 is in use by unbound (https://docs.pi-hole.net/main/prerequisites/#ports)
    tcp:[::]:8080 is in use by lighttpd

The output of ss -tulpn sport = 53 already showed that, but I missed that information in the original text (I think the unformatted text confused me).

Solution:

  • If you don't want to use Unbound, you need to disabled it.
  • If you want to use Unbound as upstream server, you need to configure it to use a different port.

I don't get it. All I did was upgrade Pihole. :hot_face:
I have noticed an article floating around that talks about using unbound as a resolver with pihole, but I have not read it entirely, nor have I installed it, or done anything with it.
Why is unbound blocking the pihole/FTL process all of a sudden, after only upgrading pihole?! :hot_face:

(Since then, I performed update & upgrade ob the Pi. But that was when it first broke, I was hoping it might help to fix it.)

Anyway, I'll see if I can figure out what I need to do to fix this.
Thanks, I think. I'll be back to let you know if it works! :grinning:
(In other posts, removing dnsmasq is what fixed this same error message, but it didn't work here.) :scream:

This:

Sorry for the delay in my response. I disabled unbound like this:
'sudo systemctl disable unbound'
'sudo reboot now'
and it has been working ever since.
However, I am still having problems. My router, which is running openwrt is making many, many DNS requests! I have it setup to use a DNS proxy, which is the PiHole. That seems to be working fine (except my phone says "No internet" when connected to Wifi, even though I have rebooted phone. I can't figure out how to see what DNS it is using, it's not listed.)
I'll need to look for support somewhere else, since the problem is not the Pihole!
I even increased the allowable DNS requests to 5000 in 60 sec, but the router is still exceeding that!
It shouldn't be making DNS requests at all, I would think--and even if some, surely not so many. In the Pihole log, it shows the individual clients, and this laptop is right behind the router in DNS requests.
Anyway, thanks for helping to sort out the problem with the Pihole. I still don't understand why it happened just by upgrading the Pihole software....

Good. You solved the port issue.

Maybe you created a DNS loop (or a partial loop).
This seems to be a configuration issue.

Please, generate a new debug log with the current configuration.

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