arevindh / pihole-speedtest

Pihole Speedtest Mod
https://arevindh.github.io/pihole-speedtest/
MIT License
216 stars 22 forks source link

Speedtest mod breaks Pi-Hole updates #139

Closed j-broo closed 1 year ago

j-broo commented 1 year ago

The mod seems to edit the versions, with the result that the updater does not recognise the web version. Example from my setup:

Pi-hole v5.15.5 FTL v5.21 Web Interface vDev (HEAD, v5.18.4)

Results of "pihole -up":

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
fatal: HEAD does not point to a branch

  Error: Remote revision could not be obtained, please contact Pi-hole Support
  Additional debugging output:
HEAD detached at v5.18.4
nothing to commit, working tree clean

To fix it, and allow an upgrade, i have to repair with "pihole -r", then install the mod again. Until the next update, that is.

ipitio commented 1 year ago

Did you uninstall the mod first?

j-broo commented 1 year ago

Uninstalling via the checbox in speedtest settings did not seem to work. It said scheduled to uninstall but did nothing. I eventually uninstalled using your pipe to bash script.

Here are the versions now after uninstall and pihole -r. Uninstall alone did not fix it.

Pi-hole [v5.15.5]
FTL [v5.21]
Web Interface [v5.18.4]

Installed mod again via pipe to bash script. Same issue.

I noticed while it was installing there was a message like "You are in 'detached HEAD' state. You can look around, make experimental changes.... "

Is the mod pulling from the right release repo?

ipitio commented 1 year ago

Hmm, is there anything in the log file?

j-broo commented 1 year ago

Which log would that be? Happy to share.

ipitio commented 1 year ago

/var/log/pimod.log

When updating/uninstalling with the buttons, the progress is written to that file.

You can also view an update/uninstall in progress with sudo tmux attach-session -t pimod.

It's basically the output of that command that's saved to the log.

j-broo commented 1 year ago

Got it.

Thanks for using Speedtest Mod!
Script by @ipitio

Sun 19 Mar 2023 11:04:37 PM SAST - Verifying Dependencies...
Reading package lists...
Building dependency tree...
Reading state information...
jq is already the newest version (1.5+dfsg-2+b1).
php7.3-sqlite3 is already the newest version (7.3.31-1~deb10u3).
sqlite3 is already the newest version (3.27.2-3+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Sun 19 Mar 2023 11:04:50 PM SAST - Downloading Latest Speedtest Mod...
Cloning into 'new_admin'...
Note: checking out 'v5.18.4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 6afa4d90 Merge pull request #75 from arevindh/v5.18.4-dev
Cloning into 'new_pihole'...
Note: checking out 'v5.15.5'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 52329796 removed CPUQuota=20%
Sun 19 Mar 2023 11:06:26 PM SAST - Restoring Pi-hole...
Cloning into 'org_pihole'...
Cloning into 'org_admin'...
Sun 19 Mar 2023 11:07:54 PM SAST - Uninstalling Current Speedtest Mod...
Sun 19 Mar 2023 11:07:54 PM SAST - Uninstall Complete
Sun 19 Mar 2023 11:07:54 PM SAST - Installing Speedtest Mod...
Sun 19 Mar 2023 11:08:13 PM SAST - Install Complete
ipitio commented 1 year ago

Yeah those HEAD messages are expected because the mod had commits pushed after pihole's last release, and those additional commits aren't under a release.

Could you try uninstalling the mod again with the button, and check if it's working by seeing if the log updated

j-broo commented 1 year ago

Ok, uninstalling via UI worked now, but no new entries in pimod.log since last install. Nothing. Pihole web version still remains "broken".

ipitio commented 1 year ago

You're sure the dates are the same? The log is supposed to be overwritten every time.

What happens if you now run pihole restartdns

j-broo commented 1 year ago

Yes, triple checked. Last log entry even after uninstall completed was the 11:08 timestamp from above.

Repeated bash install and uninstall from UI to be sure - uninstall is not written to log. Last entry is install completed.

Pihole restartdns still leaves the web version "broken".

ipitio commented 1 year ago

Ok the uninstall doesn't write to the log file on my end too, that's strange! I can't replicate the broken UI though :(

While I don't think there's any significant differences between arevindh's branch and mine, does the issue persist with the script here: https://github.com/ipitio/pihole-speedtest/raw/ipitio/mod.sh

j-broo commented 1 year ago

Uninstalled mod. Repaired pihole. Installed mod with pipe to bash using above URL, now got this:

Pi-hole [v5.15.5](https://github.com/pi-hole/pi-hole/releases/v5.15.5)
FTL [v5.21](https://github.com/pi-hole/FTL/releases/v5.21)
Web Interface [6afa4d90](https://github.com/arevindh/AdminLTE/releases/6afa4d90)

And log:

Thanks for using Speedtest Mod!
Script by @ipitio

Mon 20 Mar 2023 12:27:18 AM SAST - Verifying Dependencies...
Reading package lists...
Building dependency tree...
Reading state information...
Package 'speedtest-cli' is not installed, so not removed
jq is already the newest version (1.5+dfsg-2+b1).
php7.3-sqlite3 is already the newest version (7.3.31-1~deb10u3).
sqlite3 is already the newest version (3.27.2-3+deb10u2).
speedtest is already the newest version (1.2.0.84-1.ea6b6773cf).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Mon 20 Mar 2023 12:27:32 AM SAST - Downloading Latest Speedtest Mod...
Cloning into 'new_admin'...
Cloning into 'new_pihole'...
Mon 20 Mar 2023 12:29:06 AM SAST - Restoring Pi-hole...
Cloning into 'org_pihole'...
Cloning into 'org_admin'...
Mon 20 Mar 2023 12:30:33 AM SAST - Uninstalling Current Speedtest Mod...
Mon 20 Mar 2023 12:30:34 AM SAST - Uninstall Complete
Mon 20 Mar 2023 12:30:34 AM SAST - Installing Speedtest Mod...
Mon 20 Mar 2023 12:30:55 AM SAST - Install Complete
ipitio commented 1 year ago

And it's still broken?

j-broo commented 1 year ago

Yes indeed. Those versions should not be tampered with or it looks like they break the pihole updater. Here's the result now:

pi@J-Pi:~ $ sudo pihole -up
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.31-1~deb10u3
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
fatal: No tags can describe '6afa4d9063f4d82a33fc2ff248b0d2012797a24a'.
Try --always, or create some tags.
fatal: No tags can describe '6afa4d9063f4d82a33fc2ff248b0d2012797a24a'.
Try --always, or create some tags.

  Error: Local revision could not be obtained, please contact Pi-hole Support
  Additional debugging output:
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
ipitio commented 1 year ago

I'm not sure why the UI is broken for you, maybe arevindh might have an idea?

Those modified versions you see are the modded files from my/arevindh's repos, and for now they aren't tagged as per arevindh (I should look into that --always)

j-broo commented 1 year ago

Perhaps this will help:

root@J-Pi:/etc/pihole# cat versions
CORE_BRANCH=master
WEB_BRANCH=master
FTL_BRANCH=master
CORE_VERSION=v5.15.5
WEB_VERSION=6afa4d90
FTL_VERSION=v5.21
GITHUB_CORE_VERSION=v5.15.5
GITHUB_WEB_VERSION=v5.18.4
GITHUB_FTL_VERSION=v5.21
CORE_HASH=d86b325d
GITHUB_CORE_HASH=d86b325d
WEB_HASH=6afa4d90
GITHUB_WEB_HASH=b29a423b
FTL_HASH=f380afda
GITHUB_FTL_HASH=f380afda

Correcting the version above does not fix it either.