Error 500: Internal Server Error
Error: Cannot open script file /var/www/html/admin/login.lp
Occurring randomly less frequently than once a day.
Core
Version is v5.18.3-534-g250fbd21 (Latest: null)
Branch is development
Hash is 250fbd21 (Latest: 250fbd21)
Web
Version is v5.21-995-g7cf66a51 (Latest: null)
Branch is development
Hash is 7cf66a51 (Latest: 7cf66a51)
FTL
Version is vDev-3dd756d (Latest: null)
Branch is development
Hash is 3dd756da (Latest: 3dd756da)
sudo service pihole-FTL restart fixes it for a day or so
token (after pihole-FTL restart) NUs48DtI
ls -al /etc/pihole
total 255460
drwxr-xr-x 6 pihole pihole 4096 Oct 29 07:43 .
drwxr-xr-x 99 root root 4096 Oct 29 05:00 ..
-rw-rw---- 1 pihole pihole 65 Mar 29 2024 adlists.list
-rw-r----- 1 pihole pihole 44 Oct 29 07:43 cli_pw
drwxr-xr-x 2 pihole pihole 4096 Oct 27 14:20 config_backups
-rw-rw---- 1 pihole pihole 201 Jun 27 10:28 custom.list.bck
-rw-rw---- 1 pihole pihole 133 Mar 18 2024 custom.list.gsb
-rw-rw---- 1 pihole pihole 647 Oct 29 07:46 dhcp.leases
-rw-rw---- 1 pihole pihole 6029 Oct 19 23:21 dnsmasq.conf
-rw-rw---- 1 pihole pihole 651 Oct 27 14:20 dns-servers.conf
-rw-rw---- 1 pihole pihole 12 Sep 2 23:16 ftlbranch
-rw-rw---- 1 pihole pihole 48582656 Oct 28 10:03 gravity.db
-rw-rw---- 1 pihole pihole 50626560 May 25 23:41 gravity.db.gsb
-rw-rw---- 1 pihole pihole 48582656 Oct 27 07:19 gravity_old.db
drwxr-xr-x 2 pihole pihole 4096 Jun 27 11:00 hosts
-rw-rw---- 1 pihole pihole 408 Oct 27 14:20 install.log
-rw-rw---- 1 pihole pihole 3921873 Oct 27 14:20 list.11.gitlab.com.domains
-rw-rw---- 1 pihole pihole 81 Oct 27 14:20 list.11.gitlab.com.domains.sha1
-rw-rw---- 1 pihole pihole 10972543 Oct 27 14:20 list.13.www.github.developerdan.com.domains
-rw-rw---- 1 pihole pihole 98 Oct 27 14:20 list.13.www.github.developerdan.com.domains.sha1
-rw-rw---- 1 pihole pihole 2448254 Oct 27 14:20 list.1.raw.githubusercontent.com.domains
-rw-rw---- 1 pihole pihole 95 Oct 27 14:20 list.1.raw.githubusercontent.com.domains.sha1
-rw-rw---- 1 pihole pihole 65 Jun 23 03:54 local.list
-rw-r--r-- 1 root root 358 Aug 28 22:41 logrotate
-rw-rw---- 1 pihole pihole 3194880 Oct 27 14:20 macvendor.db
drwxr-xr-x 2 pihole pihole 4096 Mar 18 2024 migration_backup
drwxr-xr-x 2 pihole pihole 4096 Sep 13 09:58 migration_backup_v6
-rw-rw---- 1 pihole pihole 146 May 10 22:25 pihole-FTL.conf.bck
-rw-r----- 1 pihole pihole 92520448 Oct 29 07:43 pihole-FTL.db
-rw-r----- 1 pihole pihole 32768 Oct 29 07:56 pihole-FTL.db-shm
-rw-r----- 1 pihole pihole 531512 Oct 29 07:56 pihole-FTL.db-wal
-rw-rw---- 1 pihole pihole 51659 Oct 27 14:20 pihole.toml
-rw-rw---- 1 pihole pihole 560 Jun 27 08:31 setupVars.conf.old
-rw-rw---- 1 pihole pihole 737 Jun 27 11:00 tls_ca.crt
-rw-rw---- 1 pihole pihole 713 Jun 27 11:00 tls.crt
-rw-rw---- 1 pihole pihole 1001 Jun 27 11:00 tls.pem
-rw-rw---- 1 pihole pihole 366 Oct 28 12:58 versions
I have another pihole install which never errors. The 2 piholes have none overlapping DHCP scopes. This offending pihole has a pi.alert install accessing the API.
after update
Core
Version is v5.18.3-537-g112b9617 (Latest: null)
Branch is development
Hash is 112b9617 (Latest: 112b9617)
Web
Version is v5.21-1003-g8020179d (Latest: null)
Branch is development
Hash is 8020179d (Latest: 8020179d)
FTL
Version is vDev-3dd756d (Latest: null)
Branch is development
Hash is 3dd756da (Latest: 3dd756da)
Can you check if the file is really there? Anything special to this directory?
(I am thinking about something like on a USB drive, on a network share, ..., etc.)
The best I can say right now is that you may have a somehow broken filesystem if this isn't the case. Can you please run a filesystem check?
Yes it is still there.
I have 2 piholes. Pihole2 does not error. Pihole4 has the intermittent error. Both are running on local flash drives in Raspberry Pis with up to date RpiOs. Pihole4 has a local install of Pi.Alert that queries the API every 5 minutes (I think).
Pihole4 has not errored for 2 days. Today I have configured pihole4's install of pi.alert to query pihole2 to see if the error is related to API access.
The filesystem permissions are identical on both systems.
journalctl shows multiple kernel: netlink: 8 bytes leftover after parsing attributes in process civetweb-worker. on whichever pi is being queried by pi.alert whatever that means.
There are no low voltage events.
$ file /var/www/html/admin/login.lp
/var/www/html/admin/login.lp: HTML document, ASCII text
Core
Version is v5.18.3-537-g112b9617 (Latest: null)
Branch is development
Hash is 112b9617 (Latest: 112b9617)
Web
Version is v5.21-1012-gc689fdc7 (Latest: null)
Branch is development
Hash is c689fdc7 (Latest: c689fdc7)
FTL
Version is vDev-a5641e3 (Latest: null)
Branch is development
Hash is a5641e37 (Latest: a5641e37)
I'm still not sure why you are seeing the "Cannot open script ..." message, but I found 2 issues:
Pi.alert is trying to access the web interface, but it is failing to authenticate.
There are many log entries like:
[...] Authentication required, redirecting to /admin/login
Pi.alert tries to authenticate using HTTP headers, but apparently is failing.
Are you using the password to authenticate?
Are you using the IP on the URL? or hostname/domain?
The URL used to access the API is using a negative value for max_devices, but this value cannot be negative:
(...) WARNING: Cannot parse unsigned integer parameter max_devices in query string "max_devices=-1&max_addresses=2": Specified integer negative, this is not allowed
This is the Pi.alert code (line 1079) requesting the invalid value:
I have set the max_devices to 30 - 6 more than the number of devices on my network. Is there a value to capture all clients.
I have now reverted pi.alert to query localhost on pihole4 to see if the server error returns.
It means nothing, it's a mere warning that we have sent a too large netlink packet to the kernel. It won't have any consequences. This harmless warning will be fixed by:
There are several errors in the Tricorder log related to an no file descriptors being available on your system. This is an OS-level error indicating that you have too many files open at the same time. I see issues related to the database, for connecting with other processes (e.g. ip) and it would be quite likely that this is also the cause of your 500 errors - when FTL cannot open the file for reading, an error 500 is the natural consequence.
Please check the number of allowed open files at the same time ( ulimit -n ) on your system.
Also, please run sudo lsof | grep pihole and provide the output