500 - Internal Server Error - pihole seems to be working

Please follow the below template, it will help us to help you!

Expected Behaviour:

When I go to pi.hole/admin I am expecting to see the admin page. This wasn't working even before I upgraded to the latest version.

It does seem that pihole is blocking adds though.

Actual Behaviour:

I am getting 500 - Internal Server Error

Debug Token:

7tu10inpc3

Other steps I took:

  • pihole -r -nothing was solved
  • pihole uninstall and then reinstall it back
  • tried this in multiple browsers
1 Like

is anybody having any ideas?
If anyone is still interested this is the new debug token: ptkkilfn2x

Appreciate your help.

As a user, I have no access to your debug log.
Normally, the websever that comes with pihole is lighttpd

You could try sudo service lighttpd stop && sudo service lighttpd start

To check if there is something wrong with your lighttpd configuration, enter:
lighttpd -t -f /etc/lighttpd/lighttpd.conf. The result should be Syntax OK

Hope this helps

pi@raspberrypi:~ $ pihole -d
This process collects information from your Pi-hole, and optionally uploads it to a unique and random directory on tricorder.pi-hole.net.

The intent of this script is to allow users to self-diagnose their installations.  This is accomplished by running tests against our software and providing the user with links to FAQ articles when a problem is detected.  Since we are a small team and Pi-hole has been growing steadily, it is our hope that this will help us spend more time on development.

NOTE: All log files auto-delete after 48 hours and ONLY the Pi-hole developers can access your data via the given token. We have taken these extra steps to secure your data and will work to further reduce any personal information gathered.

*** [ INITIALIZING ]
[i] 2018-09-21:21:33:24 debug log has been initialized.

*** [ INITIALIZING ] Sourcing setup variables
[i] Sourcing /etc/pihole/setupVars.conf...

*** [ DIAGNOSING ]: Core version
[i] Core: v4.0 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Branch: master
[i] Commit: v4.0-0-gddbdb51

*** [ DIAGNOSING ]: Web version
[i] Web: v4.0 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Branch: master
[i] Commit: v4.0-0-gaf8c926c

*** [ DIAGNOSING ]: FTL version
[✓] FTL: v4.0

*** [ DIAGNOSING ]: dnsmasq version
[i] 2.76

*** [ DIAGNOSING ]: lighttpd version
[i] 1.4.45

*** [ DIAGNOSING ]: php version
[i] 7.0.30

*** [ DIAGNOSING ]: Operating system
[✓] Raspbian GNU/Linux 9 (stretch)

*** [ DIAGNOSING ]: SELinux
[i] SELinux not detected

*** [ DIAGNOSING ]: Processor
[✓] armv7l

*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the eth0 interface:
   192.168.0.100/24 matches the IP found in /etc/pihole/setupVars.conf

[✓] IPv6 address(es) bound to the eth0 interface:
   fe80::1d8d:54dd:e36c:7f1f does not match the IP found in /etc/pihole/setupVars.conf (https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127)

   ^ Please note that you may have more than one IP address listed.
   As long as one of them is green, and it matches what is in /etc/pihole/setupVars.conf, there is no need for concern.

   The link to the FAQ is for an issue that sometimes occurs when the IPv6 address changes, which is why we check for it.

[i] Default IPv4 gateway: 192.168.0.1
192.168.0.1
   * Pinging 192.168.0.1
192.168.0.1...
[✓] Gateway responded.

*** [ DIAGNOSING ]: Ports in use
*:1880 node-red (IPv4)
*:5900 vncserver- (IPv6)
*:5900 vncserver- (IPv4)
*:22 sshd (IPv4)
*:22 sshd (IPv6)
*:80 lighttpd (IPv4)
*:80 lighttpd (IPv6)
*:445 smbd (IPv6)
*:139 smbd (IPv6)
*:445 smbd (IPv4)
*:139 smbd (IPv4)
*:53 pihole-FTL (IPv4)
*:53 pihole-FTL (IPv6)
127.0.0.1:4711 pihole-FTL (IPv4)
[::1]:4711 pihole-FTL (IPv6)
[::1]:6010 sshd (IPv6)
127.0.0.1:6010 sshd (IPv4)

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] biznettvigator.com is 0.0.0.0 via localhost (127.0.0.1)
[✓] biznettvigator.com is 0.0.0.0 via Pi-hole (192.168.0.100)
[✓] doubleclick.com is 172.217.25.174 via a remote, public DNS server (8.8.8.8)

*** [ DIAGNOSING ]: Pi-hole processes
[✗] dnsmasq daemon is inactive
[✓] lighttpd daemon is active
[✓] pihole-FTL daemon is active

*** [ DIAGNOSING ]: Setup variables
    PIHOLE_INTERFACE=eth0
    IPV4_ADDRESS=192.168.0.100/24
    IPV6_ADDRESS=
    PIHOLE_DNS_1=8.8.8.8
    PIHOLE_DNS_2=8.8.4.4
    QUERY_LOGGING=true
    INSTALL_WEB_SERVER=true
    INSTALL_WEB_INTERFACE=true
    LIGHTTPD_ENABLED=true

*** [ 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: 369
Date: Fri, 21 Sep 2018 13:33:46 GMT
Server: lighttpd/1.4.45

[✗] Web interface 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: 369
Date: Fri, 21 Sep 2018 13:33:46 GMT
Server: lighttpd/1.4.45


*** [ DIAGNOSING ]: Gravity list
-rw-r--r-- 1 root root 2989563 Sep 21 16:47 /etc/pihole/gravity.list
   -----head of gravity.list------
   0.0.0.0
   0.r.msn.com
   0.start.bz
   000.0x1f4b0.com

   -----tail of gravity.list------
   zzz.clickbank.net
   zzzezeroe.fr
   zzzpooeaz-france.com
   zzzrtrcm2.com

*** [ DIAGNOSING ]: contents of /etc/pihole

-rw-r--r-- 1 root root 381 Sep 18 19:46 /etc/pihole/adlists.list
   https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
   https://mirror1.malwaredomains.com/files/justdomains
   http://sysctl.org/cameleon/hosts
   https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
   https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
   https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
   https://hosts-file.net/ad_servers.txt

-rw-r--r-- 1 root root 48 Sep 21 16:47 /etc/pihole/local.list
   192.168.0.100 raspberrypi
   192.168.0.100 pi.hole

-rw-r--r-- 1 root root 234 Sep 18 19:46 /etc/pihole/logrotate
   /var/log/pihole.log {
        su root root
        daily
        copytruncate
        rotate 5
        compress
        delaycompress
        notifempty
        nomail
   }
   /var/log/pihole-FTL.log {
        su root root
        weekly
        copytruncate
        rotate 3
        compress
        delaycompress
        notifempty
        nomail
   }

*** [ DIAGNOSING ]: contents of /etc/dnsmasq.d

-rw-r--r-- 1 root root 1508 Sep 18 19:47 /etc/dnsmasq.d/01-pihole.conf
   addn-hosts=/etc/pihole/gravity.list
   addn-hosts=/etc/pihole/black.list
   addn-hosts=/etc/pihole/local.list
   localise-queries
   no-resolv
   cache-size=10000
   log-queries=extra
   log-facility=/var/log/pihole.log
   local-ttl=2
   log-async
   server=8.8.8.8
   server=8.8.4.4
   interface=eth0

*** [ DIAGNOSING ]: contents of /etc/lighttpd

-rw-r--r-- 1 root root 3027 Sep 18 19:46 /etc/lighttpd/lighttpd.conf
   server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_auth",
        "mod_expire",
        "mod_compress",
        "mod_redirect",
        "mod_setenv",
        "mod_rewrite"
   )
   server.document-root        = "/var/www/html"
   server.error-handler-404    = "pihole/index.php"
   server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
   server.errorlog             = "/var/log/lighttpd/error.log"
   server.pid-file             = "/var/run/lighttpd.pid"
   server.username             = "www-data"
   server.groupname            = "www-data"
   server.port                 = 80
   accesslog.filename          = "/var/log/lighttpd/access.log"
   accesslog.format            = "%{%s}t|%V|%r|%s|%b"
   index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
   url.access-deny             = ( "~", ".inc", ".md", ".yml", ".ini" )
   static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
   compress.cache-dir          = "/var/cache/lighttpd/compress/"
   compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
   include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
   include_shell "/usr/share/lighttpd/create-mime.assign.pl"
   include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"
' 2>/dev/null"
   $HTTP["url"] =~ "^/admin/" {

       setenv.add-response-header = (
           "X-Pi-hole" => "The Pi-hole Web interface is working!",
           "X-Frame-Options" => "DENY"
       )
       $HTTP["url"] =~ ".ttf$" {

           setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
       }
   }
   $HTTP["url"] =~ "^/admin/\.(.*)" {
        url.access-deny = ("")
   }
   include_shell "cat external.conf 2>/dev/null"

*** [ DIAGNOSING ]: contents of /etc/cron.d

-rw-r--r-- 1 root root 1495 Sep 18 19:46 /etc/cron.d/pihole
   28 3   * * 7   root    PATH="$PATH:/usr/local/bin/" pihole updateGravity
   00 00   * * *   root    PATH="$PATH:/usr/local/bin/" pihole flush once quiet
   @reboot root /usr/sbin/logrotate /etc/pihole/logrotate
   */10 *  * * *   root    PATH="$PATH:/usr/local/bin/" pihole updatechecker local
   4 12  * * *   root    PATH="$PATH:/usr/local/bin/" pihole updatechecker remote
   @reboot root    PATH="$PATH:/usr/local/bin/" pihole updatechecker remote reboot

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

-rw-r--r-- 1 www-data www-data 42098 Sep 21 21:33 /var/log/lighttpd/error.log
   2018-09-17 06:25:50: (server.c.1534) logfiles cycled UID = 0 PID = 10153
   2018-09-17 17:41:09: (server.c.1828) server stopped by UID = 0 PID = 1
   2018-09-17 17:41:39: (log.c.217) server started
   2018-09-17 17:41:39: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
   2018-09-17 21:19:17: (server.c.1828) server stopped by UID = 0 PID = 1
   2018-09-17 21:19:41: (log.c.217) server started
   2018-09-17 21:19:41: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
   2018-09-17 21:40:45: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-17 21:40:45: (mod_fastcgi.c.3175) response not received, request sent: 874 on socket: unix:/var/run/lighttpd/php.socket-0 for /pihole/index.php?, closing connection
   2018-09-17 21:40:45: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-17 21:40:45: (mod_fastcgi.c.3175) response not received, request sent: 978 on socket: unix:/var/run/lighttpd/php.socket-0 for /pihole/index.php?, closing connection
   2018-09-18 06:19:45: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 06:19:45: (mod_fastcgi.c.3175) response not received, request sent: 1269 on socket: unix:/var/run/lighttpd/php.socket-0 for /pihole/index.php?, closing connection
   2018-09-18 06:19:51: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 06:19:51: (mod_fastcgi.c.3175) response not received, request sent: 1283 on socket: unix:/var/run/lighttpd/php.socket-0 for /pihole/index.php?, closing connection
   2018-09-18 18:40:03: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 18:40:03: (mod_fastcgi.c.3175) response not received, request sent: 938 on socket: unix:/var/run/lighttpd/php.socket-0 for /admin/api.php?overTimeDataClients&getClientNames, closing connection
   2018-09-18 18:40:03: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 18:40:03: (mod_fastcgi.c.3175) response not received, request sent: 906 on socket: unix:/var/run/lighttpd/php.socket-0 for /admin/api.php?overTimeData10mins, closing connection
   2018-09-18 18:41:05: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 18:41:05: (mod_fastcgi.c.3175) response not received, request sent: 906 on socket: unix:/var/run/lighttpd/php.socket-0 for /admin/api.php?overTimeData10mins, closing connection
   2018-09-18 18:41:05: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 18:41:05: (mod_fastcgi.c.3175) response not received, request sent: 938 on socket: unix:/var/run/lighttpd/php.socket-0 for /admin/api.php?overTimeDataClients&getClientNames, closing connection
   2018-09-18 18:44:00: (mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0
   2018-09-18 18:44:00: (mod_fastcgi.c.3175) response not received, request sent: 884 on socket: unix:/var/run/lighttpd/php.socket-0 for /admin/api.php?summary, closing connection

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

-rw-r--r-- 1 pihole pihole 431 Sep 21 16:47 /var/log/pihole-FTL.log
   -----head of pihole-FTL.log------
   [2018-09-21 14:10:13.134] Notice: Increasing overTime struct size from 400 to 500
   [2018-09-21 16:47:45.469] FATAL: Trying to free NULL pointer in free_whitelist_domains() (regex.c:72)
   [2018-09-21 16:47:45.469] INFO: No whitelist file found
   [2018-09-21 16:47:45.470] Compiled 0 Regex filters and -1 whitelisted domains in 0.2 msec (0 errors)
   [2018-09-21 16:47:47.772] /etc/pihole/gravity.list: parsed 130343 domains (took 580.0 ms)

   -----tail of pihole-FTL.log------
   [2018-09-21 14:10:13.134] Notice: Increasing overTime struct size from 400 to 500
   [2018-09-21 16:47:45.469] FATAL: Trying to free NULL pointer in free_whitelist_domains() (regex.c:72)
   [2018-09-21 16:47:45.469] INFO: No whitelist file found
   [2018-09-21 16:47:45.470] Compiled 0 Regex filters and -1 whitelisted domains in 0.2 msec (0 errors)
   [2018-09-21 16:47:47.772] /etc/pihole/gravity.list: parsed 130343 domains (took 580.0 ms)

*** [ DIAGNOSING ]: Locale
    LANG=en_GB.UTF-8

*** [ DIAGNOSING ]: Pi-hole log
-rw-r--r-- 1 pihole pihole 1702726 Sep 21 21:33 /var/log/pihole.log
   -----head of pihole.log------
   Sep 21 00:00:04 dnsmasq[946]: 18314 127.0.0.1/45833 query[A] per1.speedtest.telstra.net from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18314 127.0.0.1/45833 forwarded per1.speedtest.telstra.net to 8.8.4.4
   Sep 21 00:00:04 dnsmasq[946]: 18315 127.0.0.1/45833 query[AAAA] per1.speedtest.telstra.net from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18315 127.0.0.1/45833 forwarded per1.speedtest.telstra.net to 8.8.4.4
   Sep 21 00:00:04 dnsmasq[946]: 18314 127.0.0.1/45833 reply per1.speedtest.telstra.net is 203.43.60.161
   Sep 21 00:00:04 dnsmasq[946]: 18315 127.0.0.1/45833 reply per1.speedtest.telstra.net is 2001:8000:107:41::2
   Sep 21 00:00:04 dnsmasq[946]: 18316 127.0.0.1/34439 query[A] per1.speedtest.telstra.net from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18316 127.0.0.1/34439 cached per1.speedtest.telstra.net is 203.43.60.161
   Sep 21 00:00:04 dnsmasq[946]: 18317 127.0.0.1/34439 query[AAAA] per1.speedtest.telstra.net from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18317 127.0.0.1/34439 cached per1.speedtest.telstra.net is 2001:8000:107:41::2
   Sep 21 00:00:04 dnsmasq[946]: 18318 127.0.0.1/46189 query[A] per1.speedtest.telstra.net from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18318 127.0.0.1/46189 cached per1.speedtest.telstra.net is 203.43.60.161
   Sep 21 00:00:04 dnsmasq[946]: 18319 127.0.0.1/46189 query[AAAA] per1.speedtest.telstra.net from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18319 127.0.0.1/46189 cached per1.speedtest.telstra.net is 2001:8000:107:41::2
   Sep 21 00:00:04 dnsmasq[946]: 18320 127.0.0.1/47054 query[A] speedtest.per.optusnet.com.au from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18320 127.0.0.1/47054 cached speedtest.per.optusnet.com.au is 198.142.236.97
   Sep 21 00:00:04 dnsmasq[946]: 18321 127.0.0.1/47054 query[AAAA] speedtest.per.optusnet.com.au from 127.0.0.1
   Sep 21 00:00:04 dnsmasq[946]: 18321 127.0.0.1/47054 forwarded speedtest.per.optusnet.com.au to 8.8.4.4
   Sep 21 00:00:04 dnsmasq[946]: 18321 127.0.0.1/47054 reply speedtest.per.optusnet.com.au is NODATA-IPv6
   Sep 21 00:00:04 dnsmasq[946]: 18322 127.0.0.1/45851 query[A] speedtest.per.optusnet.com.au from 127.0.0.1


********************************************
********************************************
[✓] ** FINISHED DEBUGGING! **

    * The debug log can be uploaded to tricorder.pi-hole.net for sharing with developers only.
    * For more information, see: https://pi-hole.net/2016/11/07/crack-our-medical-tricorder-win-a-raspberry-pi-3/
    * If available, we'll use openssl to upload the log, otherwise it will fall back to netcat.

[?] Would you like to upload the log? [y/N]

Tried your command and I get:

pi@raspberrypi:~ $ lighttpd -t -f /etc/lighttpd/lighttpd.conf
Syntax OK

You are running lighttpd, but there are a number of errors in your debug log that show lighttpd cannot connect to the PHP process.

How do I debug this? I kind of see that there are some errors in there, but how do I go further?

This is not my area of expertise, so I'll defer to either another user or one of the devs to help you with this.

Thanks very much for your help, @jfb

Does anybody else have another suggestion I could try?

I would start by looking at the error that is show:

(mod_fastcgi.c.2424) unexpected end-of-file (perhaps the fastcgi process died): pid: 773 socket: unix:/var/run/lighttpd/php.socket-0

That shows that it's and issue connecting to PHP. Searching for the error reveals a lot of sites which may help, including:

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