Pihole Portainer/Docker 5.8.1 startup error?

Hi

I've just tried to update to the pihole/pihole:latest (5.5.1) and hit an error.
I use Portainer, which typically handles the new pull and swap over of configs....
The switch today failed, and I'm getting this error:

pihole /start.sh: line 57: /root/ph_install.sh: no such file or directory

I've rolled back to the prior image (Pi-hole v5.3.1 / Web Interface 5.5 / FTL v5.8.1) and everything restarted fine.

I only bind mount /etc/dnsmasq.d and /etc/pihole - nothing in /root
There is no reference to /root/ph_install.sh in the prior version of /start.sh

I was considering a temporary file bind mount to 'fake' /root/ph_install.sh to see if that cures it but haven't done it yet.

Expected Behaviour:

Container should start :slight_smile:

Actual Behaviour:

Container fails with error above

Debug Token:

Cannot generate as it won't start.

Per point 2 on the updating/reconfiguring section of the Readme:

  1. Throw away your container: docker rm -f pihole
  • Warning When removing your pihole container you may be stuck without DNS until step 3; ?docker pull before docker rm -f to avoid DNS interruption OR always have a fallback DNS server configured in DHCP to avoid this problem altogether.
  • If you care about your data (logs/customizations), make sure you have it volume-mapped or it will be deleted in this step.

Not doing so will put your container into a weird limbo state.

Personally, I would never let an automatic process update Pi-hole, or any other system integral to my network, but that's just me :slight_smile:

I make a habit, when updating of running docker-compose pull && docker-compose down && docker-compose up -d && docker-compose logs -f pihole

I don't have a compose file for it (yet) as it's in Portainer - which does (I believe) the equivalent.
I will try a couple of things shortly and see if I can pin it down.

You may want to prune on a regular basis also. This will remove older images and other docker objects.

I do do this :slight_smile:

@ptruman:

This is what has changed in the image that is causing an issue for you:

If the container was being fully destroyed and recreated, then the issue would not show. I have just spun up a fresh container to make sure I'm not talking out of turn!

I've never used portainer, but from a little googling it seems to have a recreate option?

I was using recreate, as it has an option to pull the latest image, and it rotates the old one and holds it.

I have deleted my container, and I still get:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] 01-resolver-resolv: applying... ,
[fix-attrs.d] 01-resolver-resolv: exited 0.,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 20-start.sh: executing... ,
/start.sh: line 57: /root/ph_install.sh: No such file or directory,
[cont-init.d] 20-start.sh: exited 1.,
[cont-finish.d] executing container finish scripts...,
[cont-finish.d] done.,
[s6-finish] waiting for services.,
[s6-finish] sending all processes the TERM signal.

docker rm -f pihole returns
Error: No such container: pihole

I've moved my config to a stack/compose file and tried it (within portainer), and it's still breaking with the same error.

Right, sorted it...
Portainer recreate persists all EXISTING environment variables, which pihole sets.
Mine was still at "5" rather than "5.3" etc.

I removed the following variables (from within portainer) and restarted:

  - PIHOLE_INSTALL=/root/ph_install.sh
  - PHP_ENV_CONFIG=/etc/lighttpd/conf-enabled/15-fastcgi-php.conf
  - PHP_ERROR_LOG=/var/log/lighttpd/error.log
  - S6_LOGGING=0
  - S6_KEEP_ENV=1
  - S6_BEHAVIOUR_IF_STAGE2_FAILS=2

And it's started now. VERSION now shows as v5.8.1
PIHOLE_INSTALL now shows as /etc/.pihole/automated install/basic-install.sh

(portainer will recreate that if a recreate/pull is done, so at least worth documenting here for any other portainer users that a few variables may need clobbering before the recreate is issued) :slight_smile:

7 Likes

Ah-hah. Yeah, OK that makes sense, but I also don't really understand why it is holding onto them. No matter, thanks for figuring it out and letting us know what it was!

No worries - I thought it was likely "me" as no-one else was reporting similar. When you mentioned the github changed I saw the VERSION piece and it clicked then.

Portainer is just being a smidge too clever :slight_smile: It's recreate holds everything that is set, including BY the container (running config). I've taken those VARs out of the compose file now and set it as a Portainer stack, so I can still recreate the container (on it's own) OR restart the stack, which should pull the whole lot.

I'm moving my DNS to a stack anyway as I've got a custom DNS front end Container which does some mobile/roaming security AND runs a DNSCrypt connection, feeds into the pihole container, and then piHole is pointed back to the DNSCrypt connection. (sounds messy, but it works). :slight_smile:

1 Like

Thanks for this, just done the update myself and encountered the same problem but removing those variables did fix it.

1 Like

Huzzah - that's why I posted it - if it does nothing else bar save head scratching for someone :slight_smile:

1 Like

Oh my god this saved my brain. I’m not using portainer, but running in Docker on a Synology NAS.

Deleted these 6 environment variables and am now running again.

Very frustrating for what’s supposed to be slap and go container clears and image downloads.

1 Like

Hey Wingspanner, I'm running Pihole in the same environment like you. Can you tell me what you exactly did? I removed the 6 environment variables in the settings like in the post from ptruman. The container then is no longer restarting all the time, what is good. It looks like that Pihole is also running but the web interface is now not reachable anymore. Any idea about that?

1 Like

Sorry to hear that friend. I just checked once I saw your reply and I do have it running well now and the web interface also works.

Here are my settings as viewed from the desktop mode Docker GUI from my phone.



Exact same issue here with Portainer on a Synology.
Recreate or Duplicate didn't work.
Could be indeed linked to env variable as Synology has a known bug that doesn't allow edition of deployed container. (You think you edited the variable, it says ok, but if you reopen the details, you see nothing has changed)

Anyway, I created a new Container from scratch and it started perfectly.

Thx for your help mate!
Really don't know where my fault was, but WebIF works again now.
Created a new Container from the start with the necessary variables und without the 6, and now it works. Looks like that it´s not working if the container started once with that 6 variables.

1 Like

Thanks ptruman - I also run PiHole managed with Portainer and my most recent update failed to restart. Removing the environmental variables as outlined in your post and recreating the container fixed it.

1 Like

Same issue but still doesn’t restart after deleted the 6 vars. Why. Did. I. Update. stupid. Stupid. Stupid.

Update: was able to recreate using my last working version 5.2.1 and now working again. Def won’t be updating any time soon!

1 Like

Thank you! this saved me.

1 Like

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