500 error when accessing web interface

The issue I am facing:
Accessing the web interface has stopped working (It worked when I first set things up).

Lighttpd error logs are showing this:

2020-11-11 08:34:26: (http-header-glue.c.1250) read(): Connection reset by peer 9 10
2020-11-11 08:34:26: (gw_backend.c.2149) response not received, request sent: 488 on socket: unix:/var/run/lighttpd/php.socket-0 for /admin/index.php?, closing connection

So I assume it's something to do with that

Details about my system:

pi@pihole:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
*** [ DIAGNOSING ]: Pi-hole processes
[✓] lighttpd daemon is active
[✓] pihole-FTL daemon is active
*** [ DIAGNOSING ]: Dashboard and block page
[✗] Block page X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 500 Internal Server Error
Content-Type: text/html
Content-Length: 365
Date: Wed, 11 Nov 2020 13:34:26 GMT
Server: lighttpd/1.4.53

[✓] Web interface X-Header: X-Pi-hole: The Pi-hole Web interface is working!

What I have changed since installing Pi-hole:
I hadn't touched it in quite a while (months) before noticing the web UI doesn't work. I ran a pihole -r and completely reset things to no avail.

Please upload a debug log and post just the token generated by

pihole -d

allowing to upload when prompted, or do it through the Web interface:

Tools > Generate Debug Log

l2xy189kc8

You are running two additional DNS resolvers, dnscrypt and unbound, yet your configuration is not referring the latter at all.

In addition, you've configured Google's public DNS servers alongside, which would mean that your upstream DNS queries may go to each of them.

You should revisit your configuration for Pi-hole's upstream DNS servers and decide on which upstream servers you really want to use.

There is no indication in your debug log as to why your blocking page would fail.
However, your lighttpd has been stopped and started quite a few times:

*** [ DIAGNOSING ]: contents of /var/log/lighttpd

-rw-r--r-- 1 www-data www-data 10193 Nov 11 08:34 /var/log/lighttpd/error.log
   2020-11-11 00:00:30: (server.c.1759) logfiles cycled UID = 0 PID = 5163 
   2020-11-11 06:26:16: (http-header-glue.c.1250) read(): Connection reset by peer 6 10 
   2020-11-11 06:26:16: (gw_backend.c.2149) response not received, request sent: 515 on socket: unix:/var/run/lighttpd/php.socket-0 for /pihole/index.php?, closing connection 
   2020-11-11 06:27:12: (server.c.958) [note] graceful shutdown started 
   2020-11-11 06:27:12: (server.c.2059) server stopped by UID = 0 PID = 6939 
   2020-11-11 06:27:12: (server.c.1464) server started (lighttpd/1.4.53) 
   2020-11-11 06:28:35: (server.c.2059) server stopped by UID = 0 PID = 1 
   2020-11-11 06:28:36: (server.c.1464) server started (lighttpd/1.4.53) 
   2020-11-11 06:40:14: (server.c.2059) server stopped by UID = 0 PID = 1

Did that happen by itself, or did you stop and restart it manually?

Let's try to verifiy your lighttpd configuration.
Executed on your Pi-hole machine, what’s the output of:

lighttpd -t -f /etc/lighttpd/lighttpd.conf

Also take a look if restarting lighttpd provides some additional insights:

sudo service lighttpd restart

In case that fails, please provide the output for:

sudo systemctl status --full --no-pager lighttpd.service

Fully removed dnscrypt and unbound (could it be that they aren't applied in the configs since the pihole -r with a full reinstall?). Either way, I'll set them back up after this all gets figured out.

The lighttpd restarts were me, was trying to debug based on similar issues I've found in these forums.

pi@pihole:/opt $ lighttpd -t -f /etc/lighttpd/lighttpd.conf
Syntax OK

No output for sudo service lighttpd restart

pi@pihole:/opt $ sudo systemctl status --full --no-pager lighttpd.service
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-11-12 08:33:15 EST; 25s ago
  Process: 20090 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 20097 (lighttpd)
    Tasks: 6 (limit: 2063)
   CGroup: /system.slice/lighttpd.service
           ├─20097 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
           ├─20104 /usr/bin/php-cgi
           ├─20105 /usr/bin/php-cgi
           ├─20106 /usr/bin/php-cgi
           ├─20107 /usr/bin/php-cgi
           └─20108 /usr/bin/php-cgi

Nov 12 08:33:14 pihole systemd[1]: Starting Lighttpd Daemon...
Nov 12 08:33:15 pihole systemd[1]: Started Lighttpd Daemon.

I also tested replacing /var/www/html/admin/index.php with a test file, which allowed the page to load and rendered correctly:

<html><body><?php echo "hello world"; ?></body></html>

Please verify if you can access Pi-hole's UI when you restore the original file.

Restoring the original index.php file results in a 500 internal server error

Any other thoughts here? Or do I need to just start from scratch with the raspberry pi installation?

A post was split to a new topic: Lighttpd errors

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