Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pi-hole update treats github unavailability as FTL update available #5189

Open
clwgh opened this issue Feb 27, 2023 · 4 comments · May be fixed by #5190
Open

Pi-hole update treats github unavailability as FTL update available #5189

clwgh opened this issue Feb 27, 2023 · 4 comments · May be fixed by #5190
Labels
Bug: Confirmed Verified as a bug to be resolved WIP Work in progress.

Comments

@clwgh
Copy link
Member

clwgh commented Feb 27, 2023

Versions

$ pihole -v
Pi-hole version is v5.15.5 (Latest: v5.15.5)
AdminLTE version is v5.18.4 (Latest: v5.18.4)
FTL version is v5.21 (Latest: v5.21)

Platform

  • OS and version: Ubuntu 22.04.2 LTS
  • Platform: VM on VMware Fusion 12

Expected behavior

When github is unavailable due to being blocked or network down, running a Pi-hole update should report current versions and fail to check for new versions gracefully.

[i] Checking for updates...
[i] Pi-hole Core: up to date
[i] Web Interface: up to date
[i] FTL: up to date

Actual behavior / bug

When github is unavailable due to being blocked or network down, running a Pi-hole update causes it to report that an update is available for the FTL component and launch into the update routine, which then fails due to said unavailability.

[i] Checking for updates...
fatal: unable to access 'https://github.com/pi-hole/pi-hole.git/': Couldn't connect to server
[i] Pi-hole Core: up to date
fatal: unable to access 'https://github.com/pi-hole/AdminLTE.git/': Couldn't connect to server
[i] Web Interface: up to date
[i] FTL: update available
[i] FTL out of date, it will be updated by the installer.
[✓] Root user check
[...]
Unable to complete update, please contact Pi-hole Support

Steps to reproduce

Steps to reproduce the behavior:

  1. Render github.com unavailable by either blocking in Pi-hole (if Pi-hole is using itself for DNS) or taking the network connection offline
  2. Run pihole -up
  3. Observe the error above
  4. Compare with expected behaviour when github.com is available

Debug Token

Screenshots

n/a

Additional context

Test Ubuntu VM created for discussion in https://discourse.pi-hole.net/t/error-when-updating-pihole/61177/42

github.com being blocked was the cause of the user's problem, but in testing I observed this behaviour which appears to be a bug.

@pralor-bot
Copy link

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/error-when-updating-pihole/61177/43

@rdwebdesign
Copy link
Member

The problem is here:

if ! FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never -i Location: | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then
# There was an issue while retrieving the latest version
printf " %b Failed to retrieve latest FTL release metadata" "${CROSS}"
return 3
fi

@dschaper
Copy link
Member

dschaper commented Feb 27, 2023

Edit: Nah, doesn't seem to work. Needs a POSIX pipefail type solution.


            if ! FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never -i Location: | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then

becomes

            if ! FTLlatesttag=$( { curl -sI https://github.com/pi-hole/FTL/releases/latest || return 1; } | grep --color=never -i Location: | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then

@dschaper
Copy link
Member

curl -s https://api.github.com/repos/pi-hole/FTL/releases/latest | jq .tag_name

curl -s https://api.github.com/repos/pi-hole/FTL/releases/latest | jq .tag_name
"v5.21"

@rdwebdesign rdwebdesign linked a pull request Feb 28, 2023 that will close this issue
1 task
@yubiuser yubiuser added the Bug: Confirmed Verified as a bug to be resolved label Feb 28, 2023
@yubiuser yubiuser linked a pull request Feb 28, 2023 that will close this issue
1 task
@yubiuser yubiuser added the WIP Work in progress. label Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Confirmed Verified as a bug to be resolved WIP Work in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants