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

PADD displays error message about "invalid number" #178

Closed
sa0azs opened this issue Nov 14, 2021 · 9 comments
Closed

PADD displays error message about "invalid number" #178

sa0azs opened this issue Nov 14, 2021 · 9 comments
Labels

Comments

@sa0azs
Copy link

sa0azs commented Nov 14, 2021

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

@DL6ER
Copy link
Member

DL6ER commented Nov 14, 2021

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

@pheiduck
Copy link

pheiduck commented Nov 14, 2021

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

@sa0azs
Copy link
Author

sa0azs commented Nov 16, 2021

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?

@pheiduck
Copy link

Still present on latest Pi-hole updates…

@pheiduck
Copy link

pheiduck commented Dec 30, 2021

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

@dschaper
Copy link
Member

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

@pheiduck
Copy link

pheiduck commented Dec 30, 2021

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
Copy link

pheiduck commented Dec 31, 2021

A similar bug was reported here. #5

@github-actions
Copy link

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 github-actions bot added the Stale label Dec 12, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants