Upgrade to Bullseye fails on Pi-hole reinstall Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Niaz
Posts: 25
Joined: Mon Jan 11, 2021 8:28 pm

Upgrade to Bullseye fails on Pi-hole reinstall

Post by Niaz »

Hi,

I'm trying the upgrade to Bullseye on my Raspberry Pi Zero W.
I was going by https://dietpi.com/blog/?p=811, got as far as 2.2.4 Software migrations, put the command:

Code: Select all

dietpi-software reinstall 31 38 40 47 48 56 83 84 85 88 89 93 114 118 130 143
When it got to Pi-hole it failed on

Code: Select all

DietPi-Software | ./install.sh --disable-install-webserver
The whole output in shell:

Code: Select all

DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing Pi-hole: block adverts for any device on your network

[  OK  ] DietPi-Software | Checking URL: https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh
[ INFO ] DietPi-Software | APT install for: php7.4-xml php7.4-sqlite3 php7.4-intl, please wait...
[  OK  ] DietPi-Software | APT install for: php7.4-xml php7.4-sqlite3 php7.4-intl
[  OK  ] DietPi-Software | curl -sSfL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh -o install.sh
[  OK  ] DietPi-Software | chmod +x install.sh
[ INFO ] DietPi-Software | ./install.sh --disable-install-webserver, please wait...

  [✓] Root user check

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

  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.4.25

  [✓] Checking apt-get for upgraded packages... up to date!

  [i] Checking for / installing Required dependencies for OS Check...
  [✓] Checking for grep
  [✓] Checking for dnsutils

  [i] PIHOLE_SKIP_OS_CHECK env variable set to true - installer will continue
  [i] Checking for / installing Required dependencies for this install script...
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for whiptail
  [✓] Checking for ca-certificates

  [i] SELinux not detected
  [i] Update option selected
  [✓] Check for existing repository in /etc/.pihole
  [i] Update repo in /etc/.pihole...HEAD is now at b5e0f14 Merge pull request #4405 from pi-hole/development
  [✓] Update repo in /etc/.pihole

  [✓] Check for existing repository in /var/www/html/admin
  [i] Update repo in /var/www/html/admin...HEAD is now at ee50954 Merge pull request #1935 from pi-hole/devel
  [✓] Update repo in /var/www/html/admin

  [i] Checking for / installing Required dependencies for Pi-hole software...
  [✓] Checking for cron
  [✓] Checking for curl
  [✓] Checking for iputils-ping
  [✓] Checking for lsof
  [✓] Checking for psmisc
  [✓] Checking for sudo
  [✓] Checking for unzip
  [✓] Checking for idn2
  [✓] Checking for sqlite3
  [✓] Checking for libcap2-bin
  [✓] Checking for dns-root-data
  [✓] Checking for libcap2
  [✓] Checking for lighttpd
  [✓] Checking for php7.4-common
  [i] Checking for php7.4-cgi (will be installed)
  [✓] Checking for php7.4-sqlite3
  [✓] Checking for php7.4-xml
  [✓] Checking for php7.4-intl
  [✓] Checking for php7.4-json
  [i] Processing apt-get install(s) for: php7.4-cgi, please wait...

Selecting previously unselected package php7.4-cgi.
(Reading database ... 86101 files and directories currently installed.)
Preparing to unpack .../php7.4-cgi_7.4.25-1+deb11u1_armhf.deb ...
Unpacking php7.4-cgi (7.4.25-1+deb11u1) ...
Setting up php7.4-cgi (7.4.25-1+deb11u1) ...
update-alternatives: using /usr/bin/php-cgi7.4 to provide /usr/bin/php-cgi (php-cgi) in auto mode
update-alternatives: using /usr/lib/cgi-bin/php7.4 to provide /usr/lib/cgi-bin/php (php-cgi-bin) in auto mode

Creating config file /etc/php/7.4/cgi/php.ini with new version
Processing triggers for php7.4-cgi (7.4.25-1+deb11u1) ...

  [✓] Enabling lighttpd service to start on reboot...
  [✓] Checking for user 'pihole'

  [i] FTL Checks...

  [✓] Detected ARMv6 processor (with hard-float support)
  [i] Checking for existing FTL binary...
  [i] Latest FTL Binary already installed (v5.11). Confirming Checksum...
  [i] Checksum correct. No need to download!
  [✓] Installing scripts from /etc/.pihole

  [i] Installing configs from /etc/.pihole...
  [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
  [✓] Installed /etc/dnsmasq.d/01-pihole.conf
  [✓] Installed /etc/dnsmasq.d/06-rfc6761.conf

  [i] Installing blocking page...
  [✓] Creating directory for blocking page, and copying files
  [i] Backing up index.lighttpd.html
      No default index.lighttpd.html file found... not backing up

  [✓] Installing sudoer file

  [✓] Installing latest Cron script

  [i] Installing latest logrotate script...
        [i] Existing logrotate file found. No changes made.
  [i] Backing up /etc/dnsmasq.conf to /etc/dnsmasq.conf.old
  [i] man not installed
  [i] Testing if systemd-resolved is enabled
  [i] Systemd-resolved is not enabled
[FAILED] DietPi-Software | ./install.sh --disable-install-webserver
It seems to fail on Restarting lighttpd service...

I guess it because Pi-hole changes /etc/lighttpd/lighttpd.conf ?

What to do?

BugReport | Reference code: 6ed542ea-5eaa-4e60-b516-eb13f3a3cf1e
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Joulinar »

the installation is started with option --disable-install-webserver. Means PiHole is not doing anything on the web server configuration.

At least on first look I don't see a clear error message what is failing in the PiHole installer. Was there any blue error message once it failed?

Could you check if web server is running

Code: Select all

systemctl status lighttpd.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Niaz
Posts: 25
Joined: Mon Jan 11, 2021 8:28 pm

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Niaz »

It's not running.

Code: Select all

systemctl status lighttpd.service
● lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-11-17 15:29:39 CET; 386ms ago
    Process: 26857 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)

Nov 17 15:29:38 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Nov 17 15:29:39 DietPi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Nov 17 15:29:39 DietPi systemd[1]: Stopped Lighttpd Daemon.
Nov 17 15:29:39 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 17 15:29:39 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 17 15:29:39 DietPi systemd[1]: Failed to start Lighttpd Daemon.
I'm not sure what you mean by blue error message.
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Joulinar »

pls share following

Code: Select all

/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
usually if an error during software installation failed, a blue error message box appears.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Niaz
Posts: 25
Joined: Mon Jan 11, 2021 8:28 pm

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Niaz »

Ah, now I maybe understand what by blue you mean. Gray box on blue background? The one that let you sent Bugreport, Retry last command etc?

It's output is same as what I posted in first post.

Now I f**ked up and accidentally pressed something on the window, when I thought I'm working in another. The installation is somehow continuing.

Ended up with:

Code: Select all

DietPi-Software
─────────────────────────────────────────────────────
 Step: Install completed

[  OK  ] DietPi-Survey | Sending survey data
[ SUB1 ] DietPi-Services > restart 
[  OK  ] DietPi-Services | restart : redis-server
[  OK  ] DietPi-Services | restart : mariadb
[  OK  ] DietPi-Services | restart : php7.4-fpm
[FAILED] DietPi-Services | restart : lighttpd
[  OK  ] DietPi-Services | restart : cron
[  OK  ] DietPi-Services | ncc maintenance:mode --off
Running your code returns:

Code: Select all

/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
Duplicate config variable in conditional 0 global: server.error-handler-404
2021-11-17 15:47:18: configfile.c.1970) source: /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf line: 33 pos: 1 parser failed somehow near here: (EOL)
2021-11-17 15:47:18: configfile.c.1970) source: find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include "%p"\n' 2>/dev/null line: 8 pos: 8 parser failed somehow near here: (EOL)
2021-11-17 15:47:18: configfile.c.1970) source: /etc/lighttpd/lighttpd.conf line: 75 pos: 1 parser failed somehow near here: (EOL)
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Joulinar »

ok let's see were the duplicate configuration is coming from. Try following.

Code: Select all

grep -r 'server.error-handler-404' /etc/lighttpd/
hopefully it's going to display something.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Niaz
Posts: 25
Joined: Mon Jan 11, 2021 8:28 pm

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Niaz »

Code: Select all

grep -r 'server.error-handler-404' /etc/lighttpd/
/etc/lighttpd/lighttpd.conf.piholemade:server.error-handler-404    = "/pihole/index.php"
/etc/lighttpd/lighttpd.conf.orig:server.error-handler-404    = "/pihole/index.php"
/etc/lighttpd/lighttpd.conf:server.error-handler-404    = "/pihole/index.php"
/etc/lighttpd/conf-available/99-dietpi-pihole.conf:server.error-handler-404 = "/html/pihole/index.php"
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Joulinar »

ah yeah it's an older installation I guess. In meantime 404 error handling has been removed from our config on new install. Let's try following

Code: Select all

sed -i '/^[[:blank:]]*server.error-handler-404/d' /etc/lighttpd/lighttpd.conf
hopefully web server is starting now

Code: Select all

systemctl restart lighttpd.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Niaz
Posts: 25
Joined: Mon Jan 11, 2021 8:28 pm

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Niaz »

Yep. It's about year and half old I would say.

Didn't help:

Code: Select all

root@DietPi:~# sed -i '/^[[:blank:]]*server.error-handler-404/d' /etc/lighttpd/lighttpd.conf
root@DietPi:~# systemctl restart lighttpd.service
Job for lighttpd.service failed because the control process exited with error code.
See "systemctl status lighttpd.service" and "journalctl -xe" for details.
root@DietPi:~# systemctl status lighttpd.service
● lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-11-17 16:20:38 CET; 3s ago
    Process: 3008 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)

Nov 17 16:20:38 DietPi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Nov 17 16:20:38 DietPi systemd[1]: Stopped Lighttpd Daemon.
Nov 17 16:20:38 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 17 16:20:38 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 17 16:20:38 DietPi systemd[1]: Failed to start Lighttpd Daemon.
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Upgrade to Bullseye fails on Pi-hole reinstall

Post by Joulinar »

can you perform the config check again

Code: Select all

/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply