pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.43k stars 1.13k forks source link

Container fails to run after updating to newer versions #1165

Closed FLYwithPEACE closed 2 years ago

FLYwithPEACE commented 2 years ago

This is a: Run Issue

Details

Unable to get newer versions of pi-hole to work in Docker. Container fails to start. Latest working version is [2022.02.1].

Related Issues

How to reproduce the issue

  1. Environment data

    • Operating System: TrueNAS Scale 22.02.0/Debian 11
    • Hardware: Dell PowerEdge R720
    • Kernel Architecture: x86/64
    • Docker Install Info and version:
    • Software source: Docker version 20.10.12, build e91ed57
    • Supplimentary Software: Portainer 2.14.2
    • Hardware architecture: x86
  2. docker-compose.yml contents, docker run shell command, or paste a screenshot of any UI based configuration of containers here

    
    version: "3"

services: pihole: container_name: pihole image: pihole/pihole:latest

ports:
  - "53:53/tcp"
  - "53:53/udp"
  - "8080:80/tcp"
environment:
  TZ: 'America/New_York'
  WEBPASSWORD: '[insert password]'
volumes:
  - pihole_data:/etc      
restart: unless-stopped

volumes: pihole_data: external: true

3. any additional info to help reproduce

**Logs from [2022.04] and after:**

::: Pre existing WEBPASSWORD found DNSMasq binding to default interface: eth0 Added ENV to php: "TZ" => "America/New_York", "PIHOLE_DOCKER_TAG" => "2022.04.1", "PHP_ERROR_LOG" => "/var/log/lighttpd/error.log", "ServerIP" => "0.0.0.0", "CORS_HOSTS" => "", "VIRTUAL_HOST" => "0.0.0.0", Using IPv4 and IPv6 ::: Preexisting ad list /etc/pihole/adlists.list detected ((exiting setup_blocklists early)) https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts ::: Testing lighttpd config: Syntax OK ::: All config checks passed, cleared for startup ... ::: Enabling Query Logging [i] Enabling logging...

[✓] Logging has been enabled! ::: Docker start setup complete Checking if custom gravity.db is set in /etc/pihole/pihole-FTL.conf Pi-hole version is v5.9 (Latest: v5.11.4) AdminLTE version is v5.11 (Latest: v5.13) FTL version is v5.14 (Latest: v5.16.1) Container tag is: 2022.04.1 [cont-init.d] 20-start.sh: exited 0. [cont-init.d] done. [services.d] starting services Starting lighttpd Starting crond Starting pihole-FTL (no-daemon) as pihole [services.d] done. /usr/bin/php-cgi: No such file or directory Stopping lighttpd lighttpd: no process found Starting lighttpd /usr/bin/php-cgi: No such file or directory Stopping lighttpd lighttpd: no process found

Appended for clarity.

**Logs from [2022.07] and after:**

[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] 05-changer-uid-gid.sh: executing... [cont-init.d] 05-changer-uid-gid.sh: exited 0. [cont-init.d] 20-start.sh: executing...

[✓] Root user check

    .;;,.
    .ccccc:,.
     :cccclll:.      ..,,
      :ccccclll.   ;ooodc
       'ccll:;ll .oooodc
         .;cll.;;looo:.
             .. ','.
            .',,,,,,'.
          .',,,,,,,,,,.
        .',,,,,,,,,,,,....
      ....''',,,,,,,'.......
    .........  ....  .........
    ..........      ..........
    ..........      ..........
    .........  ....  .........
      ........,,,,,,,'......
        ....',,,,,,,,,,,,.
           .',,,,,,,,,'.
            .',,,,,,'.
              ..'''.

[i] Update local cache of available packages... [✓] Update local cache of available packages

[i] Checking apt-get for upgraded packages... [✗] Checking apt-get for upgraded packages Kernel update detected. If the install fails, please reboot and try again [i] Checking for / installing Required dependencies for OS Check... [i] Checking for grep... [✓] Checking for grep [i] Checking for dnsutils... [✓] Checking for dnsutils

[✓] Supported OS detected [i] Checking for / installing Required dependencies for this install script... [i] Checking for git... [✓] Checking for git [i] Checking for iproute2... [✓] Checking for iproute2 [i] Checking for whiptail... [i] Checking for whiptail (will be installed) [i] Checking for ca-certificates... [✓] Checking for ca-certificates [i] Processing apt-get install(s) for: whiptail, please wait...

debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libslang2:amd64. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 11535 files and directories currently installed.) Preparing to unpack .../libslang2_2.3.2-2_amd64.deb ... Unpacking libslang2:amd64 (2.3.2-2) ... Selecting previously unselected package libnewt0.52:amd64. Preparing to unpack .../libnewt0.52_0.52.20-8_amd64.deb ... Unpacking libnewt0.52:amd64 (0.52.20-8) ... Selecting previously unselected package libpopt0:amd64. Preparing to unpack .../libpopt0_1.16-12_amd64.deb ... Unpacking libpopt0:amd64 (1.16-12) ... Selecting previously unselected package whiptail. Preparing to unpack .../whiptail_0.52.20-8_amd64.deb ... Unpacking whiptail (0.52.20-8) ... Setting up libslang2:amd64 (2.3.2-2) ... Setting up libpopt0:amd64 (1.16-12) ... Setting up libnewt0.52:amd64 (0.52.20-8) ... Setting up whiptail (0.52.20-8) ... Processing triggers for libc-bin (2.31-13+deb11u3) ...

[i] SELinux not detected --title Existing Install Detected! --menu \n\nWe have detected an existing install.\n\nPlease choose from the following options: \n(You will be updated to the latest version.) 20 70 2 Update This will retain existing settings. Reconfigure Resets Pi-hole and allows re-selecting settings. --msgbox --backtitle Welcome --title Pi-hole automated installer \n\nThis installer will transform your device into a network-wide ad blocker! 20 70 --msgbox --backtitle Plea --title Free and open source \n\nThe Pi-hole is free, but powered by your donations: https://pi-hole.net/donate/ 20 70 --defaultno --backtitle Initiating network interface --title Static IP Needed --yesno \n\nThe Pi-hole is a SERVER so it needs a STATIC IP ADDRESS to function properly.

IMPORTANT: If you have not already done so, you must ensure that this device has a static IP. Either through DHCP reservation, or by manually assigning one. Depending on your operating system, there are many ways to achieve this.

Choose yes to indicate that you have understood this message, and wish to continue 20 70

[i] IPv4 address: 172.30.0.2/16 [i] Unable to find IPv6 ULA/GUA address [i] IPv6 address: Cancel was selected, exiting installer [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. [s6-finish] sending all processes the KILL signal and exiting.


## These common fixes didn't work for my issue
<!-- IMPORTANT! Help me help you! Ordered with most common fixes first. -->
- [x] I have tried removing/destroying my container, and re-creating a new container
- [ ] I have tried fresh volume data by backing up and moving/removing the old volume data
- [ ] I have tried running the stock `docker run` example(s) in the readme (removing any customizations I added)
- [ ] I have tried a newer or older version of Docker Pi-hole (depending what version the issue started in for me)
- [ ] I have tried running without my volume data mounts to eliminate volumes as the cause

If the above debugging / fixes revealed any new information note it here.
Add any other debugging steps you've taken or theories on root cause that may help.

**Current work-around is to backup data using older version and restore it after update with a new volume**
rdwebdesign commented 2 years ago

Can you please execute one test?

Start a container using a different name (example: "piholetest") and without volumes.

Suggested file:

version: "3"

services:
  pihole:
    container_name: piholetest
    image: pihole/pihole:latest

    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8080:80/tcp"
    environment:
      TZ: 'America/New_York'
      WEBPASSWORD: '[insert password]'
    restart: unless-stopped
FLYwithPEACE commented 2 years ago

I have tested without the old volume and it works. It seems that the old volume is not compatible with the new versions.

PromoFaux commented 2 years ago
volumes:
      - pihole_data:/etc 

You've mounted the whole of /etc ?? You're going to have a bad time here.

Also:

 [✓] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [i] Update local cache of available packages...
  [✓] Update local cache of available packages
.....

There is nothing in the standard startup script of the container that would cause the installer to run. But I suspect this is to do with you mounting the entirety of /etc

Start again, using the example compose file in the Readme, and only mount what is necessary. Closing as this is a misconfiguration