Support for Debian 11 [Stats not working]

Hi folks,

Since Debian 11 is now stable I did upgrade some of my servers including my pihole server.
Everything seems to work just fine except the stats. Pihole runs with "standard" settings meaning the lighttpd server is used and I don't use nginx on this server.

Since only the stats are not working I did not rollback my backup of the server.
Logs uploaded. Thanks for your help.

Expected Behaviour:

Stats Daemon to run on Debian 11 which is now the new stable release of Debian.
uname -a:
Linux nhmucfdns01 5.10.0-6-amd64 #1 SMP Debian 5.10.28-1 (2021-04-09) x86_64 GNU/Linux

→ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Actual Behaviour:

Everything works except the statistics page (port 4711)
sudo echo ">stats" | nc localhost 4711 reports noting

Also when accessing the Pi-Hole diagnosis page:
image

Debug Token:

LcYIpw9q

Bullseye is not yet officially supported by Pi-hole, since it was just recently released

1 Like

There were several changes to Pi-hole in regard to Bullseye. The will be included in the next version of Pi-hole.

1 Like

Did you change the location of the admin interface?

FastCGI-stderr:#0 /var/www/nhmucfdns01.nethavn.net/admin/scripts/pi-hole/php/gravity.php(13): SQLite3_connect()
   2021-08-20 01:56:59: mod_fastcgi.c.487) FastCGI-stderr:#1 /var/www/nhmucfdns01.nethavn.net/admin/index.php(73): gravity_last_update()
   2021-08-20 01:56:59: mod_fastcgi.c.487) FastCGI-stderr:#2 {main}
   2021-08-20 01:56:59: mod_fastcgi.c.487) FastCGI-stderr:  thrown in /var/www/nhmucfdns01.nethavn.net/admin/scripts/pi-hole/php/database.php on line 6

Hi yubiuser,

Thanks for the headsup with bullseye and the next pi-hole release.
I'm aware that this configuration isn't supported, the debug output told me.

But since everything except the stats page works I thought I open the thread to see if the cause is really the "new" OS or something else.

To answer your question about the location of the admin interface:
image
I did not alter the location directly, I only pointed the html folder to the folder below it.

I however can change that of course.

@Aebian you could join our currently running beta testing if the next Pi-hole release to see if this fixes the issue you're seeing. Check out

Thanks for the post. I checked it and the issue on the web is still present.
Logs --> el2wTSEV

What is the most common log-file I should check out to see any issue?
The lighttpd.log shows this at the end:

2021-08-20 08:54:09: mod_fastcgi.c.487) FastCGI-stderr:PHP message: PHP Fatal error:  Uncaught Error: Undefined constant "SQLITE3_OPEN_READONLY" in /var/www/nhmucfdns01.nethavn.net/admin/scripts/pi-hole/php/database.php:61
2021-08-20 08:54:09: mod_fastcgi.c.487) FastCGI-stderr:Stack trace:
2021-08-20 08:54:09: mod_fastcgi.c.487) FastCGI-stderr:#0 /var/www/nhmucfdns01.nethavn.net/admin/scripts/pi-hole/php/gravity.php(13): SQLite3_connect()
2021-08-20 08:54:09: mod_fastcgi.c.487) FastCGI-stderr:#1 /var/www/nhmucfdns01.nethavn.net/admin/index.php(73): gravity_last_update()

So it makes me wonder if bullseye or the php8.0 install is missing something for sqllite?
I have sqllite3 installed on the system, is there anything else I might be missing here?

Apart from that everything else works fine, dns resolving, blocking, all work.
However the connection to the sqlite seems indeed broken, as the blacklist, whitelist and the group management are empty. The latter even throws the ajax datatable error 7, so there must be indeed something between php and sqllite wrong.

If something between ftl and sqllite would be wrong the blacklists wouldn't kick-in, but they do, so it is only the php part.

Undefined constant sounds like the PHP module is missing or inactive. Please try:

apt install php8.0-sqlite3
phpenmod sqlite3
systemctl restart lighttpd
1 Like

Thanks, all I had to do was sudo apt install php8.0-sqlite3

Just curious:
Did you try that for for the beta branch or for the current release?

I actually have still the beta release installed. And did run the install command afterwards.
However I can go back to stable using my servers backup to see if that works there as well.

Let me know if interested, then I'll just revert the server back to the backup at 1am before I switched to beta.

But since all was working there as well except the sqllite things on the web I suppose it will work there as well.

You'd miss out on the tweaks for Bullseye mentioned by yubiuser that were applied to the beta if you reverted to the release master, so I'd probably stick with the working solution then.

Just remember that you'd have to do so manually once the next Pi-hole release is due. i.e. you can't just use pihole -up (seems the release is almost good to go, we are just waiting for dnsmasq to release as well).

Yeah true.
I'll stick to the current setup then (beta) and switch back to stable once the release is final.
Thanks for your help

figured i would post here that anyone wanting to move to the beta for pihole on dietpi based on debian 11 will need to do this
see this comment Support for Debian 11 [Stats not working] - #19 by MichaIng

old post for history sake:
apt-get -y install apt-transport-https lsb-release ca-certificates curl

curl -sSL -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

apt-get update

apt-get -y install php8.0-fpm php8.0-apcu php8.0-mysql php8.0-xml php8.0-zip php8.0-mbstring php8.0-gd php8.0-curl php8.0-redis php8.0-intl php8.0-bcmath php8.0-gmp php8.0-sqlite3 php8.0-imagick imagemagick

then you can swap to the beta branch. then you will have to run

PIHOLE_SKIP_OS_CHECK=true sudo -E pihole -r

select repair and let it do it's thing.

@MichaIng can you comment on this?

Looks like some things got mixed up here:

  • apt-transport-https is and was never required since Stretch, as it is integral part of APT nowadays. This is just a transitional dummy package and hence can be skipped: https://packages.debian.org/bullseye/apt-transport-https
  • lsb-release is not required when you know that you are on Bullseye. Use bullseye instead of $(lsb_release -sc) to create or adjust APT sources explicitly. The letter is only useful for generic documentations/guides, which do not target a specific distro or distro version.
  • ca-certificates and curl are pre-installed on every distro I know, including DietPi. Without the first, you wouldn't even be able to use apt-get, at least when APT sources use HTTPS (default on DietPi).

But the most important part is the PHP repo and using PHP8.0: Not sure where the info comes from that this would be required, as I would strongly recommend to use PHP7.4 shipped by Debian Bullseye natively, as long as you do not know precisely about the impact of installing PHP8.0 via Ondrej's repository, how to migrate and update PHP configurations and webserver/CLI configs/commands, deal with APT package conflicts etc. The OP had PHP8.0 installed manually, which has nothing to do with Bullseye. But, indeed on an upgraded Debian, it is required to remove PHP7.3 manually, so that the Pi-hole installer pulls PHP7.4 on a repair.

Additionally, until next Pi-hole release, the Lighttpd deflate module needs to be installed, else the installer exits abruptly when attempting to restart the Lighttpd service.

So to anyone who lands here to get current stable Pi-hole running on Debian Bullseye (or DietPi Bullseye), skip all of the above and instead and instead do, if it is an upgraded Debian with existing Pi-hole:

apt purge --autoremove '*php7.3*'
apt install lighttpd-mod-deflate
PIHOLE_SKIP_OS_CHECK=true sudo -E pihole -r

or if it is a fresh OS without Pi-hole/PHP installed:

apt install lighttpd-mod-deflate
curl -sSfL 'https://install.pi-hole.net' | PIHOLE_SKIP_OS_CHECK=true sudo -E bash

After next Pi-hole release, the compress directives are removed from its Lighttpd config and deflate compression is done via drop-in configuration from /etc/lighttpd/conf-enabled/, which is installed with the module If you use the blocking page actively (neither default, nor would I recommend it), this may be the preferred situation to speed up assets transfer to new clients a little. Else, you may apt purge --autoremove lighttpd-mod-deflate again, as for a single user low traffic web interface, where assets are stored in browser cache on first access, there is not much point to have transfer compression.

If you are on DietPi, dietpi-software can be used to (re)install Pi-hole without the above workaround on Bullseye already, including of course the fact that it is not the official install method, hence support relies more on us than on Pi-hole support team.

4 Likes

this was prob my issue, it was one i upgraded to bullseye and not a fresh install. although i could swear part of the upgrade steps was to purge it. it was still showing 7.3 for me when trying to get pihole webui to work again. the backend stuff was still working and is why i didnt notice it until the next day when i noticed my pinned tab had 404'd.

Thanks for all the help, fellas. I managed to bork my previous Ubuntu Pihole, so i decided to take this opportunity to reroll with Debian 11 (bullseye). Fresh VM, freshie Pi-hole install... just skipped the initial OS check and things went mostly smooth.
image

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