Web interface not working

Hi

I've been running pi-hole for ages, with openvpn and no-ip - all works brilliantly thank you. However a couple of weeks ago I noticed that the web-interface was not working. This seemed to be due to lighttpd not running. Restarting it and rebooting didn't help.

Today I did pihole -up and the Core and Web-interface upgraded fine but the FTL didn't. On re-trying, the FTL install did this

[✓] Update local cache of available packages
[i] Existing PHP installation detected : PHP version 7.3.19-1~deb10u1
[i] Performing unattended setup, no whiptail dialogs will be displayed

[✓] Checking apt-get for upgraded packages... up to date!

[i] Installer Dependency checks...
[✓] Checking for dhcpcd5
[✓] Checking for git
[✓] Checking for iproute2
[✓] Checking for whiptail
[✓] Checking for dnsutils

[✓] Supported OS detected
[i] SELinux not detected
[i] Performing reconfiguration, skipping download of local repos
[✓] Resetting repository within /etc/.pihole...
[i] Resetting repository within /var/www/html/admin [✓] Resetting repository within /var/www/html/admin...
[i] Main Dependency checks...
[✓] Checking for cron
[✓] Checking for curl
[✓] Checking for iputils-ping
[✓] Checking for lsof
[✓] Checking for netcat
[✓] Checking for psmisc
[✓] Checking for sudo
[✓] Checking for unzip
[✓] Checking for wget
[✓] Checking for idn2
[✓] Checking for sqlite3
[✓] Checking for libcap2-bin
[✓] Checking for dns-root-data
[✓] Checking for libcap2
[✓] Checking for lighttpd
[✓] Checking for php7.3-common
[✓] Checking for php7.3-cgi
[✓] Checking for php7.3-sqlite3
[✓] Checking for php7.3-xml
[✓] Checking for php7.3-json
[✓] Checking for php7.3-intl

[i] Enabling lighttpd service to start on reboot... Unable to complete update, please contact Pi-hole Support

I've also run pihole -d and the token is https://tricorder.pi-hole.net/mngbxnxirg

Results of
systemctl status --full --no-pager pihole-FTL.service

● pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Sun 2020-11-29 08:01:32 GMT; 57min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 2063)
CGroup: /system.slice/pihole-FTL.service

Nov 29 08:01:27 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Nov 29 08:01:28 raspberrypi pihole-FTL[561]: Not running
Nov 29 08:01:28 raspberrypi su[583]: (to pihole) root on none
Nov 29 08:01:28 raspberrypi su[583]: pam_unix(su:session): session opened for user pihole by (uid=0)
Nov 29 08:01:32 raspberrypi pihole-FTL[561]: FTL started!
Nov 29 08:01:32 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.

Results of
systemctl status --full --no-pager lighttpd.service
● lighttpd.service
Loaded: error (Reason: Unit lighttpd.service failed to load properly: Invalid argument.)
Active: inactive (dead)

Nov 29 08:30:19 raspberrypi systemd[1]: [407B blob data]
Nov 29 08:30:20 raspberrypi systemd[1]: [407B blob data]
Nov 29 08:30:20 raspberrypi systemd[1]: [407B blob data]
Nov 29 08:32:54 raspberrypi systemd[1]: [407B blob data]
Nov 29 08:32:55 raspberrypi systemd[1]: [407B blob data]
Nov 29 08:32:55 raspberrypi systemd[1]: [407B blob data]

Any help gratefully received.

1 Like

Any advice please anyone? I need to alter the white list and being unable to access the web interface is making it difficult.
thanks

1 Like

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
1 Like

Thanks. I've run that and it says 'Syntax OK'

1 Like

In that case, try if you can restart the webserver:

sudo service lighttpd restart

If that fails, please provide the output for:

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

Thanks, this is what happened:

Failed to restart lighttpd.service: Unit lighttpd.service failed to load properly: Invalid argument.
See system logs and 'systemctl status lighttpd.service' for details.

● lighttpd.service
Loaded: error (Reason: Unit lighttpd.service failed to load properly: Invalid argument.)
Active: inactive (dead)

Nov 29 08:32:55 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:36:02 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:36:03 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:36:03 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:38:10 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:38:11 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:38:11 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:38:44 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:38:45 raspberrypi systemd[1]: [407B blob data]
Nov 29 21:38:46 raspberrypi systemd[1]: [407B blob data]

Hi - sorry but I'm still stuck with this. Grateful for any other advice or troubleshooting to do to get it working. I'd prefer to fix it rather than re-install and re-configure pihole, openvpn and noip.
many thanks

You could try the following to find the offending argument:

sudo systemd-analyze verify lighttpd.service

or take a look at the unit file:

cat /lib/systemd/system/lighttpd.service

Thanks Bucking_Horn, I am learning new commands all the time.
This is what I have come up with:

/lib/systemd/system/lighttpd.service:1: String is not UTF-8 clean, ignoring assignment: EY NOT NULL, wb13n0vjvt INTEGER NOT NULL )\�tableftlftlCREATE TABLE ftl ( id INTEGER PRIMARY KEY NOT NULL, value BLOB NOT NULL )d9▒▒indexidx_queries_timestampsqueriesCREATE INDEX idx_queries_timestamps ON queries (timestamp)P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)
PuTTYUnit lighttpd.service failed to load properly: Invalid argument.

Then , rather strangely, it puts in PuTTY into the next prompt when I do this on my PC using KiTTY. It doesn't do this when I use my phone.

pi@raspberrypi:~ $ cat /lib/systemd/system/lighttpd.service
EY NOT NULL, value INTEGER NOT NULL )\▒tableftlftlCREATE TABLE ftl ( id INTEGER PRIMARY KEY NOT NULL, value BLOB NOT NULL )d9indexidx_queries_timestampsqueriesCREATE INDEX idx_queries_timestamps ON queries (timestamp)P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)▒tablequeripi@raspberrypi:~ $ PuTTY

Again, it has added PuTTY to the next prompt. Don't know if this is significant.

But back to the main issue - I'm sorry, I can't interpret either response to work out what to do next. Again, appreciate any guidance, thanks.

That unit file has been corrupted, it's just containing gibberish now.

You may get lucky by replacing it with the normal content (click for details).

-rw-r--r-- 1 root root 335 Sep 18 13:13 /lib/systemd/system/lighttpd.service

[Unit]
Description=Lighttpd Daemon
After=network-online.target

[Service]
Type=simple
PIDFile=/run/lighttpd.pid
ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
ExecReload=/bin/kill -USR1 $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target

But files don't change their content by themselves, there has to be a reason why that file has been corrupted.

Two common causes would be an insufficient power supply or a defective sd card that's nearing its end of life.

There's also a chance this happened during a sudden power loss or by just pulling the plug on your Pi-hole machine.

You should check your logs for recent occurences of under-voltages:

zgrep -ni “voltage” /var/log/syslog*

If that produces any hits, you should consider a different PSU and/or better power cables for your RPi.

Whatever compromised that file may have done the same to other files as well.
If you have reason to believe so (e.g. if fixing that file doesn't fix Pi-hole for you), you should consider to at least reformat that sd card, or to replace it by a new one.

Thanks Bucking_Horn, really helpful. I've replaced the contents of lighttpd.service file with that text, checked permissions, and it seems to have survived a couple of re-boots so OK so far. And I've checked the under voltage log, but nothing there. I'll copy to a fresh SD card when I've got this repaired.

However, I still can't get lighttpd.service to load. The status message is:
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-12-07 16:48:14 GMT; 48s ago
Process: 752 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)

Dec 07 16:48:14 raspberrypi systemd[1]: lighttpd.service: Service RestartSec=100ms expired, scheduling restart.
Dec 07 16:48:14 raspberrypi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Dec 07 16:48:14 raspberrypi systemd[1]: Stopped Lighttpd Daemon.
Dec 07 16:48:14 raspberrypi systemd[1]: lighttpd.service: Start request repeated too quickly.
Dec 07 16:48:14 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Dec 07 16:48:14 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.

Am I getting to a point where I should purge lighttpd and re-install? I've checked the lighttpd.conf file and it looks ok to my untutored eye. Don't know if there is anything else I can check or tweak?

Sorry that this isn't turning out to be simple.

Just to add: the results of
sudo systemd-analyze verify lighttpd.service
are nothing, so clean I suppose.

Check the journals for errors and post relevant bits:

journalctl --no-pager --full -u lighttpd

Thanks, I did a reboot to get a clean start on the log. The results are posted here - but I've only included the first couple of restarts to avoid repetition....

-- Logs begin at Mon 2020-12-07 18:07:48 GMT, end at Mon 2020-12-07 18:09:07 GMT. --
Dec 07 18:08:11 raspberrypi systemd[1]: Starting Lighttpd Daemon...
Dec 07 18:08:12 raspberrypi lighttpd[568]: 2020-12-07 18:08:11: (plugin.c.230) dlopen() failed for: /usr/lib/lighttpd/mod_indexfile.so /usr/lib/lighttpd/mod_indexfile.so: invalid ELF header
Dec 07 18:08:12 raspberrypi lighttpd[568]: 2020-12-07 18:08:11: (server.c.1177) loading plugins finally failed
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Control process exited, code=exited, status=255/EXCEPTION
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Dec 07 18:08:12 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Service RestartSec=100ms expired, scheduling restart.
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 1.
Dec 07 18:08:12 raspberrypi systemd[1]: Stopped Lighttpd Daemon.
Dec 07 18:08:12 raspberrypi systemd[1]: Starting Lighttpd Daemon...
Dec 07 18:08:12 raspberrypi lighttpd[623]: 2020-12-07 18:08:12: (plugin.c.230) dlopen() failed for: /usr/lib/lighttpd/mod_indexfile.so /usr/lib/lighttpd/mod_indexfile.so: invalid ELF header
Dec 07 18:08:12 raspberrypi lighttpd[623]: 2020-12-07 18:08:12: (server.c.1177) loading plugins finally failed
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Control process exited, code=exited, status=255/EXCEPTION
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Dec 07 18:08:12 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Dec 07 18:08:12 raspberrypi systemd[1]: lighttpd.service: Service RestartSec=100ms expired, scheduling restart.

You have more issues with files corrupted.
This could go on for ever trying to fix individual files.

EDIT:

pi@ph5:~ $ dpkg -S /usr/lib/lighttpd/mod_indexfile.so
lighttpd: /usr/lib/lighttpd/mod_indexfile.so

Thanks both, it works. Purging lighttpd went cleanly enough (warnings for a couple of directories /etc/lighttpd and /var/www/html). Then pihole -r has re-installed it and it works normally - no reconfiguration needed. I'll transfer everything to another SD card asap assuming corruption. Everything else seems to work. Your help is really appreciated.

2 Likes

I would start with a fresh install as you dont know what other files have been corrupted.
You can use the teleporter to export/import most all settings:

http://pi.hole/admin/settings.php?tab=teleporter

1 Like

OK thanks, that's very useful. I'll need to look at how to transfer openvpn too but I think that shouldn't be too difficult. No-ip client transfer is trivial.

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