PADD displays error message about "invalid number"
Freshly installed Pi-Hole and PADD on a Raspberry PI 2B and on a Zero W, both with new installs of Raspberry PiOS Bullseye.
Describe the bug Shown during startup and blinking on screen while running, are the following error messages:
/home/pi/padd.sh: line 900: printf: 0,3: invalid number /home/pi/padd.sh: line 244: printf: 42,236: invalid number /home/pi/padd.sh: line 873: printf: 9,1: invalid number /home/pi/padd.sh: line 900: printf: 0,91: invalid number
Did you configured a different locale (not English, UK)?
Got this too: (locale is DE only)
Only happend on Raspberry Pi OS 11 (10 has not this issue
Log Trace:
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8683: invalid number
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8357: invalid number
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8289: invalid number
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8221: invalid number
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8237: invalid number
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8169: invalid number
/opt/pihole/chronometer.sh: line 315: printf: 1,4: invalid number
/opt/pihole/chronometer.sh: line 322: printf: 55,844: invalid number
/opt/pihole/chronometer.sh: line 398: printf: 30,8254: invalid number
Did you configured a different locale (not English, UK)?
Choosen locale is sv-SE, but en-GB (the default) is also installed.
PADD worked fine with RaspberryPiOS Buster and the same locale settings on both PI:s, so I wonder if there is something changed in Bullseye that causes this?
Still present on latest Pi-hole updates…
I think its because of python 3: here: https://github.com/pi-hole/pi-hole/blob/1b809e4e8ea442cd2a3cc54206429fabd58cce05/advanced/Scripts/chronometer.sh#L315
It should be
[[ "$cpu_mhz" -le "999" ]] && cpu_freq="$cpu_mhz MHz" || cpu_freq="$(printf ("%.1f" $(calcFunc "$cpu_mhz"/1000))) GHz"
Or
[[ "$cpu_mhz" -le "999" ]] && cpu_freq="$cpu_mhz MHz" || cpu_freq="$(printf ("%.1f") $(calcFunc "$cpu_mhz"/1000)) GHz"
the same goes to 322 and 398
PADD doesn't use Python, it's all bash.
Did you configured a different locale (not English, UK)?
okay change the locale to "en_GB.UTF-8" does the trick.
export LC_ALL="en_GB.UTF-8"
Language doesn't matter on a server XD
A similar bug was reported here. https://github.com/jpmck/PADD/issues/5
This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.