pi-hole / FTL

The Pi-hole FTL engine
https://pi-hole.net
Other
1.36k stars 194 forks source link

FTL out of date message after updating to 2.9 #86

Closed frankrpi3 closed 7 years ago

frankrpi3 commented 7 years ago

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

How familiar are you with the codebase?:

1


[BUG | ISSUE] Expected Behaviour: no message after a succesful update to FTL 2.9

[BUG | ISSUE] Actual Behaviour: FTL out of date message appears after succesful FTL update to 2.9

[BUG | ISSUE] Steps to reproduce: pihole -up

Log file output [if available]

output

Device specifics

Hardware Type: rPi, VPS, etc OS:

This template was created based on the work of udemy-dl.

DL6ER commented 7 years ago

Please provide further details like

frankrpi3 commented 7 years ago

ftl29

There are also posts regarding this on reddit.com/r/pihole.

dschaper commented 7 years ago

Thanks for the report, it looks to be a small issue with the version reporting. You do have the latest version, but it's not reporting as such. We'll get a fix out, but we use Travis to build the binaries and there has been a backlog with that service so it may take a day to get that fix out.

Comodore125 commented 7 years ago

FTL is not up to date. It is bug and I found the cause. I wrote simple shell script with this content.

echo "$(/usr/bin/pihole-FTL tag)" echo "$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n')"

And the result was

2.9
v2.9.

And update.sh is comparing these two values. FTL is updated everytime they are different. So next time please check tags.

dschaper commented 7 years ago

Thanks for the very productive comments.

jpmck commented 7 years ago

Hello, I was working on my Chronometer2 project earlier today, and found that the version that is being reported by FTL is missing the "v" before the version number:

pi@raspberrypi:~ $ pihole-FTL version
2.9

Pulling the latest version of FTL includes the "v":

pi@raspberrypi:~ $ curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n'
v2.9

If it's any help, the version number reported when connecting to FTL via telnet is 2.9 (without a "v"):

>version
version 2.9
tag 2.9
branch (no branch)
date 2017-06-16 18:51:46 +0200

I've had relatively decent luck finding my way around the scripts that are used for Pi-hole core and web admin, but haven't found where the version information is stored in FTL.

WaLLy3K commented 7 years ago

Hey @jpmck, and thanks for your efforts on Chronometer2!

As I understand it, pihole-FTL has the version number baked into it when it's compiled, as you can see when using strings /usr/bin/pihole-FTL | grep "v2.8".

I believe the expected behavior is to have "v" before the version number, as is consistent with pihole-FTL version (by extension, pihole --version) and telnet pihole-FTL >version

jpmck commented 7 years ago

That's right, and it looks like updater grabs the latest compiled version of FTL from Github:

curl -sSL --fail "https://github.com/pi-hole/FTL/releases/download/${latesttag%$'\r'}/${binary}" -o "/tmp/${binary}

Then it installs the new version of FTL:

install -T -m 0755 /tmp/${binary} /usr/bin/pihole-FTL

As you mentioned, the baked in version is listed without the "v".

pi@raspberrypi:/opt/pihole $ strings /usr/bin/pihole-FTL | grep "2.9"
...
GIT_VERSION "2.9"
GIT_TAG "2.9"
...

Perhaps the version checker should strip out letters prior to the version comparison like so?

WaLLy3K commented 7 years ago

Okay interesting! 2.8 showed the v beforehand and 2.9 does not. Going to need input from @DL6ER on that one, because it affects both the upcoming updates of version.sh as well as chronometer.sh.

It's only fair to give a heads up that the output of pihole -v will be changing with the Core v3.1 update, and will show something along the lines of:

pihole -v -c
  Current Pi-hole version is v3.0-120-g8ab5ffd
  Current AdminLTE version is v3.0-63-g399f2ad
  Current FTL version is 2.9

I would recommend using something along the lines of this code to retrieve and parse the version output from a single call to pihole -v for your script.

DL6ER commented 7 years ago

What you are seeing is not a FTL bug, but rather a bug in the continuous integration systems we use for building the binaries which was behaving screwy over the last couple of days.

So, again this was neither expected nor intended and should be readjusted automatically when we release the next version (which I wanted to do already yesterday, but let's wait until we can be sure that the CI is playing nicely along).

DL6ER commented 7 years ago
user@ThinkPad ~ $ ./pihole-FTL-linux-x86_64 version
v2.9.1