PADD icon indicating copy to clipboard operation
PADD copied to clipboard

PADD displays error message about "invalid number"

Open sa0azs opened this issue 4 years ago • 8 comments

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

sa0azs avatar Nov 14 '21 14:11 sa0azs

Did you configured a different locale (not English, UK)?

DL6ER avatar Nov 14 '21 14:11 DL6ER

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

pheiduck avatar Nov 14 '21 23:11 pheiduck

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?

sa0azs avatar Nov 16 '21 18:11 sa0azs

Still present on latest Pi-hole updates…

pheiduck avatar Dec 22 '21 21:12 pheiduck

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

pheiduck avatar Dec 30 '21 16:12 pheiduck

PADD doesn't use Python, it's all bash.

dschaper avatar Dec 30 '21 16:12 dschaper

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

pheiduck avatar Dec 30 '21 16:12 pheiduck

A similar bug was reported here. https://github.com/jpmck/PADD/issues/5

pheiduck avatar Dec 31 '21 14:12 pheiduck

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.

github-actions[bot] avatar Dec 12 '22 08:12 github-actions[bot]