500 Internal Server Error/503 Service Not Available

Expected Behaviour:

Be able to access the web app and monitor everything like normal.

Actual Behaviour:

When I go to my pihole webserver I either get a 503 or 500 error. I restart the pihole and for the most part the web interface works for a bit but then within 24 hours I start getting these errors. My pihole still works at resolving DNS requests and internet and adblocking works fine but I can't actually access the web app. I can SSH into it and I know it works by itself but just doesn't display the app.

Debug Token:

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

Your debug log shows many files were edited, but looking at the contents of the "edited" files, looks like they are corrupted.

Sample:

-.control-sidebar-light .control-sidebar-menu > ┌␋ > ▒ .└␊┼┤-␋┼°⎺ > ⎻ π
+.control-siDmbar-light .controL-sidebar-Menu > ┌␋ > ▒ .└␊┼┤-␋┼°⎺ > ⎻!π
   color: rgb(173, 165, 155);
 }
-.dropdown-menu > ┌␋ > ▒:␤⎺┴␊⎼ π
-  background-color: rgb(39, 42, 44);
-  color: rgb(200, 195, 188);
-}
-.dropdown-menu > .␍␋┴␋␍␊⎼ π
+.erotdown-ienu > ┌␋ > ▒:␤⎺┴␊⎼ π
+  background-color: rgb(39, 42$ 44);
+  clor: rgbh200,(191, 188);
+}.␍⎼⎺⎻␍⎺┬┼-└␊┼┤ > .␍␋┴␋␍␊⎼ π

This is happening in many other files, including other web interface files, lighttpd config files, FTL log files.

You can check the errors in your local debug log using this command:

less /var/log/pihole/pihole_debug.log

I'm not sure what caused this corruption, but looks like you will need to replace your SD card.

Ah ok awesome I will do that instead. I reinstalled pihole multiple times on the SD card but never thought that the SD card would be corrupted. Thank you!

Are you running this on a Raspberry Pi?
If so, read below:

I am but I'm not getting network drops. I will check but is there anything that will state if I actually am having under voltage? Running sudo zgrep -i voltage /var/log/syslog* gives the error of there is no such file or directory so I think I will just need to reinstall it and see what happens once I get the new SD card.

You could try below instead to see if any is logged:

sudo journalctl --full --no-pager --dmesg --grep Under-voltage

Results for the other two commands is wiped on reboot/power down.

No entries I assume means that there is no under voltage and the power delivery to it is fine? I assume it's just a bad SD card in that case right that I should replace?

Yes it appears so.
Also when you want to power down the Pi, do it via a proper shutdown.
Dont pull the power cable while the OS is still running or it can also create file corruption.
EDIT: Or at least try to :wink:

Yeah whenever I need to shut it down (for the most part unless I am out and my parents restart it) I do a shutdown remotely via cmd or a reboot via cmd through ssh which I've been told is ok. I used to do it through the web app but since I can't access it I have to go through cmd else it would be through the web app instead. I'll try to keep that in place but this Pi is 12 years old and the SD card is the same age so I've ordered one off Amazon and will reinstall everything and then see how it goes.

Yeah it really depends on what the Pi is doing at the moment of a power surge or humans misbehaving :wink:
Most of the times it will survive also bc of the journaling happening in the FS.
One of my SD cards is I believe 8 years old now (pre Raspi) and still running strong for Pi-hole.
EDIT: Ow I realise its much older.
I had this SD card before the first Pi's came out :smiley:
But its running for Pi-hole now for at least 6 years.

Ah interesting, yeah I think the pihole dropping constantly was the reason that they would restart it and it wouldn't power off properly but hopefully with the new SD card, it won't ever go down and as a result it won't need to be powered off incorrectly and should be running properly which is nice.

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