HTTP 500, requires reboot every 6 hours

Yesterday I did a fresh reinstall of latest Rasbian and Pi Hole on my RP2. I just added a new blocklist and accidently navigated to another page in the admin gui and I got a HTTP 500 error. I then tried to SSH to it but it fails. I restarted the pi by plugging and unplugging it but its still the same result. However I do think it is working because my PC dns server is still the RP2 and it works.

Can I somehow ge SSH working again so that I can read the logs?

Edit: Replugging power, it now seems to work again.
This morning I did it around 9 o clock. But now at 13, it seems to be broken again. Here are my logs.

May 10 09:28:09 raspberrypi systemd[1]: Started Getty on tty1.
May 10 09:28:09 raspberrypi systemd[1]: Reached target Login Prompts.
May 10 09:28:09 raspberrypi pihole-FTL[414]: Not running
May 10 09:28:09 raspberrypi sshd[412]: Error loading host key "/etc/ssh/ssh_host_rsa_key": invalid format
May 10 09:28:09 raspberrypi sshd[412]: Error loading host key "/etc/ssh/ssh_host_ecdsa_key": invalid format
May 10 09:28:09 raspberrypi sshd[412]: Error loading host key "/etc/ssh/ssh_host_ed25519_key": invalid format
May 10 09:28:09 raspberrypi sshd[441]: Error loading host key "/etc/ssh/ssh_host_rsa_key": invalid format
May 10 09:28:09 raspberrypi sshd[441]: Error loading host key "/etc/ssh/ssh_host_ecdsa_key": invalid format
May 10 09:28:09 raspberrypi sshd[441]: Error loading host key "/etc/ssh/ssh_host_ed25519_key": invalid format
May 10 09:28:09 raspberrypi systemd[1]: Started OpenBSD Secure Shell server.
May 10 09:28:09 raspberrypi systemd[1]: Created slice User Slice of UID 999.
May 10 09:28:09 raspberrypi systemd[1]: Starting User Runtime Directory /run/user/999...
May 10 09:28:09 raspberrypi systemd[1]: Started User Runtime Directory /run/user/999.
May 10 09:28:09 raspberrypi systemd[1]: Starting User Manager for UID 999...
May 10 09:28:10 raspberrypi systemd[1]: Started Lighttpd Daemon.
May 10 09:28:10 raspberrypi systemd[445]: gpgconf: running /usr/bin/gpg-agent failed (exitcode=2): General error
May 10 09:28:10 raspberrypi systemd[445]: gpgconf: fatal error (exit status 1)
May 10 09:28:10 raspberrypi systemd[445]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
May 10 09:28:10 raspberrypi systemd[445]: Reached target Paths.
May 10 09:28:10 raspberrypi systemd[445]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
May 10 09:28:10 raspberrypi systemd[445]: Listening on GnuPG network certificate management daemon.
May 10 09:28:10 raspberrypi systemd[445]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
May 10 09:28:10 raspberrypi systemd[445]: Reached target Timers.
May 10 09:28:10 raspberrypi systemd[445]: Listening on GnuPG cryptographic agent and passphrase cache.
May 10 09:28:10 raspberrypi systemd[445]: Reached target Sockets.
May 10 09:28:10 raspberrypi systemd[445]: Reached target Basic System.
May 10 09:28:10 raspberrypi systemd[445]: Reached target Default.
May 10 09:28:10 raspberrypi systemd[1]: Started User Manager for UID 999.
May 10 09:28:10 raspberrypi systemd[445]: Startup finished in 409ms.
May 10 09:28:10 raspberrypi systemd[1]: Started Session c1 of user pihole.
May 10 09:28:11 raspberrypi pihole-FTL[414]: FTL started!
May 10 09:28:11 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.
May 10 09:28:18 raspberrypi dhcpcd[410]: eth0: no IPv6 Routers available
May 10 09:28:29 raspberrypi systemd[1]: systemd-fsckd.service: Succeeded.
May 10 13:03:21 raspberrypi systemd-timesyncd[244]: Synchronized to time server for the first time 185.35.202.197:123 (2.debian.pool.ntp.org).
May 10 13:03:21 raspberrypi systemd[1]: Starting Clean php session files...
May 10 13:03:23 raspberrypi systemd[1]: phpsessionclean.service: Succeeded.
May 10 13:03:23 raspberrypi systemd[1]: Started Clean php session files.
May 10 13:03:38 raspberrypi systemd[1]: Created slice User Slice of UID 1000.
May 10 13:03:38 raspberrypi systemd[1]: Starting User Runtime Directory /run/user/1000...
May 10 13:03:38 raspberrypi systemd[1]: Started User Runtime Directory /run/user/1000.
May 10 13:03:38 raspberrypi systemd[1]: Starting User Manager for UID 1000...
May 10 13:03:38 raspberrypi systemd[545]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
May 10 13:03:38 raspberrypi systemd[545]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
May 10 13:03:38 raspberrypi systemd[545]: Reached target Paths.
May 10 13:03:38 raspberrypi systemd[545]: Listening on GnuPG network certificate management daemon.
May 10 13:03:38 raspberrypi systemd[545]: Listening on GnuPG cryptographic agent and passphrase cache.
May 10 13:03:38 raspberrypi systemd[545]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
May 10 13:03:38 raspberrypi systemd[545]: Reached target Sockets.
May 10 13:03:38 raspberrypi systemd[545]: Reached target Timers.
May 10 13:03:38 raspberrypi systemd[545]: Reached target Basic System.
May 10 13:03:38 raspberrypi systemd[545]: Reached target Default.
May 10 13:03:38 raspberrypi systemd[545]: Startup finished in 305ms.
May 10 13:03:38 raspberrypi systemd[1]: Started User Manager for UID 1000.
May 10 13:03:38 raspberrypi systemd[1]: Started Session 4 of user pi.
May 10 13:04:15 raspberrypi systemd[1]: dev-serial1.device: Job dev-serial1.device/start timed out.
May 10 13:04:15 raspberrypi systemd[1]: Timed out waiting for device /dev/serial1.
May 10 13:04:15 raspberrypi systemd[1]: Dependency failed for Configure Bluetooth Modems connected by UART.
May 10 13:04:15 raspberrypi systemd[1]: hciuart.service: Job hciuart.service/start failed with result 'dependency'.
May 10 13:04:15 raspberrypi systemd[1]: dev-serial1.device: Job dev-serial1.device/start failed with result 'timeout'.
May 10 13:04:15 raspberrypi systemd[1]: Reached target Multi-User System.
May 10 13:04:15 raspberrypi systemd[1]: Reached target Graphical Interface.
May 10 13:04:15 raspberrypi systemd[1]: Starting Update UTMP about System Runlevel Changes...
May 10 13:04:16 raspberrypi systemd[1]: systemd-update-utmp-runlevel.service: Succeeded.
May 10 13:04:16 raspberrypi systemd[1]: Started Update UTMP about System Runlevel Changes.
May 10 13:04:16 raspberrypi systemd[1]: Startup finished in 5.810s (kernel) + 1min 31.776s (userspace) = 1min 37.587s.

Im not sure. something is going on with the host keys. Also there is some cleanup job that starts around 13:03. I suspect that is what is crashing it.

Edit: Now it happend again and I was already ssh:ed in. Now I get input/output error, even on the ls command. Could my sd card med bad?

If its a Raspi, the most likely suspect is an inadequate power supply or faulty cables:

Hmm, my PSU is 3 Amps which should be more than enough for a stock RP2. I have also tried two different cables. Still the same result I'm afraid. I don't seem to have any errors about voltages in the syslog.

3 amps says nothing about stability.
The power adapter can be good for charging but not stable enough for a Raspi.
Your not the first and many many have gone before you with strange behaviour of the Pi resulting from a poor power supply or cabling.
Plus also consider power hungry devices connected to the Pi's USB ports!

EDIT: Check below command once you get that 500 error (if still able to SSH or login via consol):

vcgencmd get_throttled

Hmm thats true. I admut I first used a Samsung charger with 1A which indeed had voltage issues. I then switched to a Oneplus 6 charger which I just assumed was of higher quality.

I don't use any accessories at all.

I can try that tomorrow. :slightly_smiling_face:

Ow ps, data on the SD card could have been corrupted already from a previous under-voltage or power cut.
For that, you would have to insert the SD card into another Linux box and run fsck on the SD card partitions to check and possibly fix.

Hmm ok, its worth a shot.

I will reinstall today and then just let it idle for 24h without Pi hole or anything else just to make sure

1 Like

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