Cannot reach pi-hole console

I’ve had pi-hole running for about a month on a Raspberry Pi 3. Today, after a power outage and a restart, I cannot get to the pi-hole console, instead getting the message

This site can’t be reached

xx.xx.xx.xx refused to connect.

I also noticed that the log window in the balenaCloud console has messages that “DNS resolution is currently unavailable”

Nevertheless, I can successfully ping the machine, and I can access web sites using the Pi as the exclusive DNS server.

I’m not sure how I got into this situation.

Hey, do you see this message in the webterminal on the device dashboard? If so, are you trying to connect to one of the service containers or the hostOS? We probably need to access the device to debug this further, would you mind sharing your device UUID and enabling support access?

The internal IP address of the device is 192.168.1.8. When I type in 192.168.1.8/admin (to see the history of requests and blocks) in the URL window, Google Chrome even remembers the pi-hole logo from previous connections, but then I get the “can’t be reached” message. The balenaCloud dashboard says that the device is running.

It will be another day before I have continuous access to share device parameters.

Thank you for the extra information. When you are able to give us this information and grant access, we’ll look into it further and update you on what we find.

Device UIUD: a063ac919290bef7bc136a18669d94de

I’ve enabled public device URL.

Thanks, would it be possible to grant support access on the device? This will allow us to SSH into it to debug. To enable support access you can go to the device summary page on the dashboard (https://dashboard.balena-cloud.com/devices/a063ac919290bef7bc136a18669d94de/summary ) and click on the drop-down arrow just next to the blink device button (the lightbulb). This should open up a menu with a “Grant support access” item, I would also recommend leaving it enabled for around a week, this way different support agents can pick the issue up to investigate.

Done.

Checked out the device, and indeed your hunch seems to be correct for the powercut messing with your application. The resolution needed reading the pi-hole source code, in particular this file (not sure if it’s the same version on your device, but should be very close:

Going backwards from the error message the issue was that a file used by the DNS check, /etc/pihole/local.list, was empty. We’ve made a copy of it and moved elsewhere, then restarted the pihole service. Then the service came up fine, and that file was populated.

Thus it seems:

  • the crash resulted in an empty file there, as the contents are maybe not saved
  • pi-hole doesn’t seem to handle well, if there’s an empty file, just bails out of DNS resolution
  • removing that file and restarting the service is fine, as it will be populated otherwise by the service once everything runs normally.

So your device should be back to service, let us know if you have any issues still!

Thanks for tracking this down! I’m able to connect AND to login.

Hey @BKFC, we’ve also went to the upstream project, and added the fix to pi-hole itself.

When an updated pi-hole version comes out, and the balena-based project’s code is updated, this failure shouldn’t happen again. Cheers!

It looks like I’m having the same problem again. [We get power outages on a semi-regular basis]. I can ping the machine, but cannot connect to the admin web-based console.

@BKFC although our modification has been merged into the Pi-hole project it isn’t yet included in the latest release so you’ll have to perform the same fix again as @imrehg detailed above; delete /etc/pihole/local.list then restart the service and you should be good to go!