Lighttpd returns 503 error on pi-hole container since Sat 21 Jan

I'm using the pihole container with only the following customization to have DNS CACHE set to zero:

sed -i -e "s:CACHE_SIZE=[0-9]\+:CACHE_SIZE=0:g" /etc/.pihole/automated\ install/basic-install.sh

I query the api URL every 10 seconds:
http://{host}:{host_port}/admin/api.php?summary&auth={host_token}

Expected Behaviour:

Being able to retrieve data or use the Web GUI

Actual Behaviour:

Since the last saturday (Jan 21) after updating container image lighttpd stops working after few minutes. Killing the lighttpd process within the container and forcing a restart makes it work again for some minutes.

It does not crash but returns HTTP 503 error.

/var/log/lighttpd/error-pihole.log:

2023-01-24 21:29:59: gw_backend.c.238) establishing connection failed: socket: unix:/run/lighttpd/pihole-php-fastcgi.socket-0: Connection refused
2023-01-24 21:29:59: gw_backend.c.970) all handlers for /admin/api.php?summary&auth= XXXXXX on .php are down.
2023-01-24 21:30:01: gw_backend.c.315) gw-server re-enabled: unix:/run/lighttpd/pihole-php-fastcgi.socket-0  0 /run/lighttpd/pihole-php-fastcgi.socket
2023-01-24 21:31:00: gw_backend.c.238) establishing connection failed: socket: unix:/run/lighttpd/pihole-php-fastcgi.socket-0: Connection refused
2023-01-24 21:31:00: gw_backend.c.970) all handlers for /admin/api.php?summary&auth=XXXXXX on .php are down.

I've updated yesterday the pihole/pihole image to pihole/pihole:2023.01.9 and the problem persists.

Debug Token:

https://tricorder.pi-hole.net/HTH9Jfnz/

That's quite the inventive customisation - I swear the lengths people go to in order to avoid reading the documentation :wink:

Specifically:


We are looking into an issue with the php handlers at the moment over on core. Could you perhaps try editing the file /etc/lighttpd/conf-enabled/15-pihole-admin.conf to have the value min_procs=1 (instead of min_procs=0) and see if that makes a difference?

1 Like

Hi PromoFaux, I'm almost sure that CUSTOM_CACHE_SIZE wasn't available as option when I first started using pihole container 2 years ago (I can't say I'm sure about it BTW), since I remember that I was using CACHE_SIZE=0 in setupVars.conf on my non-containerized Pi-hole installation and I was wondering how to do the same on the container. I usually read the docs, so I'm guessing it wasn't available at that time (or maybe it was one of the few times I didn't read the docs and tried directly to set an env var CACHE_SIZE in docker and it didn't work) and then I've never checked again since I've found my own solution (BTW, I will move to the official image with the CUSTOM_CACHE_SIZE env var which is what I need and I'll update my giannicostanzi/pihole-nocache page on Docker Hub saying it is no longer necessary to run my custom image in order to force CACHE_SIZE to zero :wink: ).

I've made your change, I'll update tomorrow if it crashes (I have telegram notifications if it stops answering to api calls, let's see how long it will last since 22:38 Jan 24)

root@pihole-nocache:/# sed -i -e 's:min-procs" => 0:min-procs" => 1:g'  /etc/lighttpd/conf-enabled/15-pihole-admin.conf
root@pihole-nocache:/# grep min-procs /etc/lighttpd/conf-enabled/15-pihole-admin.conf
                "min-procs" => 1,
root@pihole-nocache:/# ps aux | grep lighttpd.conf
www-data 10122  0.0  0.0   5004  4224 ?        S    21:54   0:00 lighttpd -D -f /etc/lighttpd/lighttpd.conf
root     11328  0.0  0.0   3240   708 pts/1    S+   22:38   0:00 grep lighttpd.conf
root@pihole-nocache:/# kill 10122
root@pihole-nocache:/# ps aux | grep lighttpd.conf
www-data 11345  0.0  0.0   4564  3476 ?        S    22:38   0:00 lighttpd -D -f /etc/lighttpd/lighttpd.conf
root     11354  0.0  0.0   3240   712 pts/1    S+   22:38   0:00 grep lighttpd.conf

No crashes in about 12 hours after your suggested change. Let’s see if it keeps working fine next days.

Great stuff. A couple of other people are reporting similar, so we should be able to get it out as a permanent fix in the coming days

1 Like

Lighttpd is still fine. Should I try restoring min-props to 0 to see if the problem comes back? I'll wait before moving to the official image since now I've included the lighttpd tuning in my own dockerfile.

FROM pihole/pihole:latest
#RUN sed -i -e "s:CACHE_SIZE=[0-9]\+:CACHE_SIZE=0:g" /etc/.pihole/automated\ install/basic-install.sh
RUN sed -i -e 's:min-procs" => 0:min-procs" => 1:g'  /etc/lighttpd/conf-enabled/15-pihole-admin.conf 

I think at this stage we are certain that was the problem. The latest official image has the change baked in

Edit: Correcting awful grammar

1 Like

Great news, thank you for the support, I’ll move to the official images as soon as I can :relaxed::raised_hands:t2: