Fresh install after SD failure, DNS won't run now. Log link included

I am sure this is a very easy fix but I do not work in IT and am struggling here. Thank you in advance for all help!

I have been using Pi-hole for about 2 years.

I had an SD failure in my Pi this weekend.

Replaced the SD with a new card and reinstalled everything like shown on the Pi-hole site. Running a clean install of Debain bullseye 32bit with no desktop.

I do not have a micro-HDMI cable so I installed all of this to the SD card with a different Pi that has a monitor and keyboard connected to make it easier for me to work with. If command line troubleshooting will be needed, I will switch the SD card back to that machine. Hopefully I am overlooking a simple setting within Pi-hole itself.

I reinstalled everything using the latest version Pi-hole. (curl -sSL https://install.pi-hole.net | bash)

The ip is bound to the Pi-hole device at the router. Once I placed the new SD card into the original Pi, I am able to access the web interface through my network at its original address.

I can access the web interface for the system but it is now showing the DNS is not running and when enabled, it immediately stops.

Under the "settings" tab, I get the following error

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

Nothing on my wifi or network has changed from when it was working on the old setup last week. I do not remember having this issue when I setup the original installation. The old setup has been working great and without issues up until this past weekend when the SD died.

I am sure this is a super simple fix and I am overlooking something obvious. Please explain in simple terms how to fix this. Thank you in advance for your help!

Expected Behaviour:

Pi-hole to work as before.

Actual Behaviour:

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

Debug Token:

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

This is not the issue. This is just a side-effect of FTL crash.


The real problem is FTL is not running:

*** [ DIAGNOSING ]: Pi-hole-FTL full status
   ● pihole-FTL.service - LSB: pihole-FTL daemon
     Loaded: loaded (/etc/init.d/pihole-FTL; generated)
     Active: failed (Result: exit-code) since Mon 2022-10-17 13:38:14 CDT; 27min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 534 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=139)
        CPU: 198ms

...
Oct 17 13:38:14 raspberrypi pihole-FTL[594]: Segmentation fault
Oct 17 13:38:14 raspberrypi systemd[1]: pihole-FTL.service: Control process exited, code=exited, status=139/n/a
Oct 17 13:38:14 raspberrypi systemd[1]: pihole-FTL.service: Failed with result 'exit-code'.
Oct 17 13:38:14 raspberrypi systemd[1]: Failed to start LSB: pihole-FTL daemon.

And your database files are probably corrupted:

*** [ DIAGNOSING ]: Pi-hole FTL Query Database
...
[✗] Integrity errors in /etc/pihole/pihole-FTL.db found.


*** [ DIAGNOSING ]: Gravity Database
...
[✗] Integrity errors in /etc/pihole/gravity.db found.

Try to rename both files (keep them as backups):

  • pihole-FTL.db.old and
  • gravity.db.old

Execute pihole -r and select Repair.

Before I posted this, I thought it might be an issue with my install, I have tried this on 3 different SD cards. I would do the same install process and would end up with the exact same results.

I will now try to execute the repair but would a clean install have the issue over 3 installations?

I will let you know what the outcome is.

THANK YOU!!!!

I tried following your suggestions and get a "command not found" error

I am sure I am missing something very simple but I do not deal with this often. I am more than happy to work with you to figure this out! This latest issue is odd just because all of my old system worked as installed without issues!

I can send you the image and whatever else is needed. Please let me know.

Is this running on a Raspberry Pi?
If so, have a read below:

Have you checked or changed your power supply? Inadequate power does not allow the SBC to properly write to the SD card.

I have run these on 2 seperate systems. The power is completely different between the two. The "headless" system was how it has been running for the last 2yr+. The system that I can interact with on a reg. HDMI input does not have issues otherwise.

I have not tried to run the system on either interface until the latest issues have have presented themselves. I cannot say that the issue was NOT present until this latest interaction.

Have you tried running those three commands that I posted in below link?
EDIT: Click on it.

Sorry, I usually only have time to try things on this in the evening. I will try those commands in a little bit and report back! Thank you for all of your help up to this point!

Thank you for your help and I am sorry for the slow response! It has been busy here.

I have tried putting the the SD card back into a different Pi that i can connect a monitor to. I log in and tried running the commands you suggested on this new system. It just gives me another command line. It does not return an error or anything it is just as if I hit "enter" without typing anything.

I do have a 3rd power supply and a NEW sd card here. I am going to try and do a clean install see what happens now.

I "think" I made some progress on this here.

It seems to work on one pi but not the other

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

Made a new SD card image and it runs without issue on a full size 3b+

This is the unit I usually use to work with as it has full size HDMI output and USB ports. Once set up and functioning, I then transfer it all over to a Pi Zero w (v1.1). Then, once everything is happy, it gets tucked away out of site on a bookshelf with a smart switch so I can just ask for it to be turned off and on from anywhere in the house as needed. It has run like this without issue for 2 years without issue until lately. It stopped rebooting one day. When I swapped that SD card to the 3b to see what was going on, it failed to boot. I assumed that I had a bad SD. I did a fresh install using the 3b and then moved back to the pi 0 as before. I never fully tested it on the 3b to verify it was fully functional.

Everything seemed to load on the pi 0 just fine without any issues. I went to the admin dashboard once fully loaded and noticed the "red" DNS error.

I tried everything recommended here (to the best of my very limited ability).

I tried different SD cards, different power supplies, different cords and everything else I could think of. None of it was working.

How do i determine if my Pi 0 is actually bad? Is this an issue in the program or something I am doing to install it?

I am running it now on the 3b but would like to know how to fix the pi 0 if possible.

Thank you again for all of the help!

James

Don't do that.
Swapping sd cards around different systems with different CPUs is not a good idea.

Pi-hole's pihole-FTL binaries are compiled for specific CPU architectures.
The install process will determine your CPU type and download the matching binary.

Shifting your sd card from your 3B (quad core armv7) over to a Zero W (single core armv6) won't work, as you are trying to run Pi-hole's armv7 binary on an armv6 platform.

That makes complete sense! I do not why it worked a few years ago but after it working without issue, I assumed it would work again. I did it the exact same way as before but apparently going from the 3b to the zero was my real issue.

Thanks for the fast response!

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