Testing upgrade from V5 to V6 / problems / repeatable

I ensured my Bullseye Pi OS was up to date with apt. I cloned my V5 SD card running Bullseye, Pi-hole V5 and Unbound. I ran pihole -up. The script ran and left me with the following:

  • Unbound working as before on port 5335
  • dhcpcd listening on port 68
  • FTL listening UDP/TCP on port 53 DNS
  • FTL listening port 443 for the web front end
  • FTL NOT running on port 80 or 8080
  • There was no prompt to disable Lighttpd or PHP
  • Lighttpd was still running on port 80.

Since the web server was running on just port 443 I tried https and that worked. Tested navigation in an old Safari, it was quick, no sluggishness. I stopped and disabled lighttpd and restarted FTL and could now access over http.

  • No upstream DNS servers were configured - the reference to 127.0.0.1#5335 was gone
  • The DHCP server was disabled in the interface
  • Local DNS records were gone

V5 immediately before the upgrade
https://tricorder.pi-hole.net/2BGeI17m/

The upgrade process
https://tricorder.pi-hole.net/IVfhH1L7/

V6 immediately after the upgrade
https://tricorder.pi-hole.net/FGJFv8Hn/

I have the V5 image saved so can repeat the upgrade as often as needed. Is there anything you would like to set up to test, or any data you would like to collect before, during or straight after?

I have a suspicion that perhaps the parsing of the string 127.0.0.1#5335 is causing it to be lost - I can test this by changing the upsteam server to one in the list in one of the tests.

I am using unbound as upstream as well (if on 127.0.1.1#5335), and my v6 upgrade succeeded without a glitch (including the lighttpd (dis)continuation choice).

I just came across a user's debug log this noon that suggests the same has happened when they upgraded their Pi-hole to v6.

Unfortunately, that user deleted the topic about 5 minutes before I was able to provide my answer, but maybe you are still able to access it here.

I'd be interested in finding out whether my proposed fixes would have worked:

pihole-FTL --config dns.upstreams '["9.9.9.9","149.112.112.112"]'
pihole-FTL --config webserver.port '"8081o,443os,[::]:8081o,[::]:443os"'

If you haven't fixed your test installation yet, could you perhaps try to run them?

If they would be successful, that could be a quick band aid for users with a similar upgrade issue, while we try to pinpoint why this happens.

Unfortunately not.

I have fixed both in order to peruse the interface. But I can reimage and start over. I'll test these now and report back shortly.

Sounds like parsing isn't the right direction then โ€“ something about my system (and presumably others) is causing parts of the process to be skipped, such as carrying forward or migrating certain things and offering interactive choices. I included the upgrade process in full. I don't know what the choice looks like, but as you can see it just went through all the to the end and said it was done.

Debug log before
https://tricorder.pi-hole.net/bPvNt0KP/

The DNS line works, dig started working from a client on the network.

sudo pihole-FTL --config dns.upstreams '["9.9.9.9","149.112.112.112"]'

The ports line didn't initially work, extra " marks ended up in the toml escaped. Removing those fixed it.

sudo pihole-FTL --config webserver.port '8081o,443os,[::]:8081o,[::]:443os'

Debug log after
https://tricorder.pi-hole.net/x9KKkk4q/

The ports are now bound and http works

[โœ“] tcp:0.0.0.0:8081 is in use by pihole-FTL
[โœ“] tcp:0.0.0.0:443 is in use by pihole-FTL
[โœ“] tcp:[::]:8081 is in use by pihole-FTL
[โœ“] tcp:[::]:443 is in use by pihole-FTL

1 Like

I did another test with this image, where in V5, before upgrading

  • removed all the adlists (58) except the original Steven Black default one at the top of the list
  • removed all domains (99), a mix of exact and regex white and blacklist entries
  • removed all clients (2) which had been present in an unrestricted group
  • removed the unrestricted group, leaving just the Default group
  • updated Gravity
  • rebooted

Then did the upgrade. No change in previously reported results.

I was testing upgrading from the same OS, etc but a simplified setup more akin to how Pi-hole V5 was after a new install, in case quantities of lists or some obscure regex rules were being parsed in some edge case way.


Another test, disabling the DHCP server and deleting the leases in V5 before upgrading, followed by a reboot.

Then did the upgrade. No change in previously reported results.

I was testing if the DHCP server being enabled or disabled made any difference to it being disabled after the upgrade. Made no difference, became disabled either way.

I did just check your Tricorder logs and it seems the migration step wasn't executed for you, and, hence, your v6.0 started with default (empty) configuration in pihole.toml - that's why your upstream server is gone and also why you got a new randomly generated web password, etc.

The only thing I can see right now that would skip migration is if /etc/pihole/pihole.toml would exists before the update. But this shouldn't be the case, right?

Maybe a sudo bash -x pihole -up in your image could shine some light on this.

1 Like

That's correct, there is no /etc/pihole/pihole.toml before the update. I've just double-checked to be 100% sure.

I did actually try sudo bash -x pihole -up yesterday, but it got as far as an exec sudo bash /x/x/something.sh script for the main install and stopped showing extra info from there. I think (not totally sure from memory) it was before the ASCII logo is displayed.

Sorry I can't recall the path or name of the script, but I think I need to get a +x into that command too, in order to capture diagnostics for the whole update. Any ideas where I do that? I did have a look around at the time to hunt down where the exec line was coming from but couldn't find it.

the code currently in development flips this logic to only skip migration if setupvars.conf does not exist.

And to run an update with -x I just did bash -x /etc/.pihole/automated\ install/basic-install.sh --unattended (Or something similar)

1 Like
-rw-r--r--   1 root   root         747 Feb 17 12:21 setupVars.conf
-rw-r--r--   1 root   root         533 Sep 15  2022 setupVars.conf.update.bak

Is that the exact command needed? I can try it now if so and capture everything.

Edit: Looking at it I thnk that was the script that was called by exec I mentioned above, but it was exec sudo that script so I assume sudo is needed at this stage?

If I run the script with sudo it fails as below. I had this error cropping up yesterday when testing.

...
+ curl -sSL --fail https://github.com/pi-hole/ftl/releases/latest/download/pihole-FTL-aarch64-linux-gnu -o pihole-FTL-aarch64-linux-gnu
curl: (22) The requested URL returned error: 404 
+ popd
+ printf '%b  %b %s\n' '\r' '[โœ—]' 'Downloading and Installing FTL'
  [โœ—] Downloading and Installing FTL
+ printf '  %b Error: URL %s/%s not found%b\n' '' https://github.com/pi-hole/ftl/releases/latest/download pihole-FTL-aarch64-linux-gnu ''
   Error: URL https://github.com/pi-hole/ftl/releases/latest/download/pihole-FTL-aarch64-linux-gnu not found
+ return 1
+ return 1
+ printf '  %b FTL Engine not installed\n' '[โœ—]'
  [โœ—] FTL Engine not installed
+ exit 1

If I run it without sudo then it goes all the way through but then only gets as far as the exec statement and stops showing the extra info, same as doing a bash +x pihole -up. The script continues without the extra info showing and this completes the upgrade to V6 but misses out the migration as previously.

...
+ printf '  %b %s\n' '[i]' 'Root user check'
  [i] Root user check
+ printf '  %b %bScript called with non-root privileges%b\n' '[i]' '' ''
  [i] Script called with non-root privileges
+ printf '      The Pi-hole requires elevated privileges to install and run\n'
      The Pi-hole requires elevated privileges to install and run
+ printf '      Please check the installer for any concerns regarding this requirement\n'
      Please check the installer for any concerns regarding this requirement
+ printf '      Make sure to download this script from a trusted source\n\n'
      Make sure to download this script from a trusted source

+ printf '  %b Sudo utility check' '[i]'
  [i] Sudo utility check+ is_command sudo
+ local check_command=sudo
+ command -v sudo
+ printf '%b  %b Sudo utility check\n' '\r' '[โœ“]'
  [โœ“] Sudo utility check
+ [[ /etc/.pihole/automated install/basic-install.sh == \b\a\s\h ]]
+ exec sudo bash '/etc/.pihole/automated install/basic-install.sh' --unattended

  [โœ“] Root user check

... carries on without the extra info

@chrislph - this should all now be fixed in the development branch...

pretty sure the -x output is not needed as we got to the bottom of it in these two PRs

You should be able to test this with in the same way that @MichaIng did in his comment at the bottom of PR 5968 (though might need some sudo in here to edit the file)

sed -i '\|basic-install.sh --reconfigure|c\curl -sSfO https://raw.githubusercontent.com/pi-hole/pi-hole/refs/heads/development/automated%20install/basic-install.sh; bash basic-install.sh --reconfigure --unattended || \\' /opt/pihole/update.sh
pihole -up
3 Likes

I'm a bit lost - does this mean the V5 to V6 migration being skipped is fixed if I do that tweak before the upgrade? Or does it mean that running a diagnostic install, to try and inspect that problem, is fixed in with this tweak?

Sorry, yeah the skipped migration issue should be fixed.

If it's successful for you here, then we should get it out as a hotfix release

3 Likes

That's ace, I'm just reimaging the card and will try that tweak as soon as it's done and report.

2 Likes

That all worked brilliantly. Same V5 image as before. Did apt update beforehand, got a couple of updates since yesterday.

  • Got the box asking if I want to disable Lighttpd (I said yes)
  • FTL listening on port 80 and 443
  • The web password from V5 was honoured and remained in place
  • Upstream for Unbound was present and working
  • DHCP server was enabled, all the same ranges and settings as in V5
  • Local DNS records all present and correct
  • Both Groups present and correct
  • There was no prompt asking to remove PHP (I thought I read there should be, maybe not)

V5 immediately before
https://tricorder.pi-hole.net/9Dinihgh/

Updating the script and the update itself
https://tricorder.pi-hole.net/2MlvI5GO/

V6 immediately after
https://tricorder.pi-hole.net/9pqcTiCw/

@PromoFaux @MichaIng

3 Likes

v6.0.4 now tagged...

I have a droplet in a v5 state now, too. so I can easily test things again

1 Like

This is expected - I don't think we ever added it into the installer.

2 Likes

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