Cron thermallogger.sh PHP notice

Found something amiss in NEMS? Confirm first that you are running the latest version, and then post your bug report here.
Locked
nix-7
Junior Member
Posts: 4
Joined: Fri Mar 08, 2019 5:44 am

Cron thermallogger.sh PHP notice

Post by nix-7 »

I have my system set to forward all mail to my own private account, and I'm receiving the following (irrelevant headers stripped);
======
Received: from root by nems with local
From: Cron Daemon <[email protected]>
To: [email protected]
Subject: Cron <root@nems> /usr/local/share/nems/nems-scripts/thermallogger.sh cron
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>



PHP Notice: A non well formed numeric value encountered in /usr/local/share/nems/nems-scripts/thermallogger.sh on line 10
======


These are every 15 minutes, per cron schedule.

The most basic of diagnostics I can do is (if this is any help);

# sed -n 10p /usr/local/share/nems/nems-scripts/thermallogger.sh
$temp = (file_get_contents('/sys/class/thermal/thermal_zone0/temp')/1000);
# cat /sys/class/thermal/thermal_zone0/temp
46160
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: Cron thermallogger.sh PHP notice

Post by Robbie Ferguson »

Thanks! Ah, the good 'ol upgrade to PHP 7.3 ... it likes to notify about everything :)

The cause is that the thermal value is loaded as a string (not an integer) and then math is applied to it (so I'm doing math on a string, technically). I'll patch this for you tonight (will make it load the thermal value as a float rather than a string). So you should see those emails stop after your nighly update (or you can force it with a sudo nems-update).

Thanks again for pointing this out.

Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
nix-7
Junior Member
Posts: 4
Joined: Fri Mar 08, 2019 5:44 am

RE: Cron thermallogger.sh PHP notice

Post by nix-7 »

Thank you very much for your hard work on this project.
I've gone to run the nems-update and had an issue:

user@nems:~ $ sudo nems-update
[sudo] password for user:

NEMS Update

Updating NEMS Core Components
- nems-migrator
Commit: 27105e034a2a7f749462fec4bd92edf4d13fee24
Already up to date.
No changes.
- nems-www...
Commit: ba1847e89c467f4581f6d647e597d07ff6f78b6d
Already up to date.
No changes.
- nems-admin...
Commit: ff64b4717bd7fe8b445b241f16307dc4989eeef4
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
From https://github.com/Cat5TV/nems-admin
ff64b47..379aead master -> origin/master
Updating ff64b47..379aead Fast-forward notes/vm/Virtual Appliance | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 notes/vm/Virtual Appliance
New Commit: ff64b4717bd7fe8b445b241f16307dc4989eeef4
- nconf...
Commit: 1dd9fdcd460bfb3f61be9742be3c65a670a804c2
Already up to date.
No changes.
- nems-tools...
Commit: b739ce28ec2b33239dcc92874af0625d25070a63
Already up to date.
No changes.
- nems-scripts...
Commit: afd7fdd8786f75f6d82050bab6c869cc44cde950
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/Cat5TV/nems-scripts
afd7fdd..cbe88d5 master -> origin/master
Updating afd7fdd..cbe88d5 Fast-forward thermallogger.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New Commit: afd7fdd8786f75f6d82050bab6c869cc44cde950

Running updates and fixes... Please wait for apt tasks to complete...
Done.
Get:1 http://archive.raspberrypi.org/debian buster InRelease [25.2 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.1 MB]
Ign:4 http://giteduberger.fr rpimonitor/ InRelease
Hit:5 http://giteduberger.fr rpimonitor/ Release
Fetched 13.1 MB in 12s (1,093 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
122 packages can be upgraded. Run 'apt list --upgradable' to see them.
/usr/local/share/nems/nems-scripts/fixes.sh: line 42: /usr/bin/mysql: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 44: /usr/bin/mysql: Input/output error
grep: /etc/php/7.3/phpdbg/php.ini: Input/output error
/bin/sed: couldn't open temporary file /etc/php/7.3/phpdbg/sedKzBogk: Input/output error
/bin/sed: couldn't open temporary file /etc/php/7.3/phpdbg/sed0Be6Bb: Input/output error
grep: /etc/php/7.2/phpdbg/php.ini: Input/output error
/bin/sed: couldn't open temporary file /etc/php/7.2/phpdbg/seddnTnZb: Input/output error
/bin/sed: couldn't open temporary file /etc/php/7.2/phpdbg/sedAhK9ra: Input/output error
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
/usr/local/share/nems/nems-scripts/fixes.sh: line 314: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 317: chown: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 328: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 339: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 340: cp: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 341: chown: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 345: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 346: cp: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 349: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 350: cp: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 354: cd: /var/www/adagios: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 355: /usr/bin/find: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 356: /usr/local/bin/pip: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 357: /usr/local/bin/pip: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 358: /usr/bin/python: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 359: /bin/systemctl: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 363: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 364: /root/nems/nems-admin/build/010-tty: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 368: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 369: /root/nems/nems-admin/build/012-tty: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 373: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 374: cp: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 382: awk: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 414: ln: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 420: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 423: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 424: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 429: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 430: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 434: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 435: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 440: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 441: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 445: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 446: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 450: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 451: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 456: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 461: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 462: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 466: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 467: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 476: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 477: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 481: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 482: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 486: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 487: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 491: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 492: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 496: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 500: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 503: /var/log/nems/nems-tools/warninglight: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 506: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 507: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 511: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 512: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/fixes.sh: line 517: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 528: crontab: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 532: rm: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 538: /usr/bin/apt: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 542: cat: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 542: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 542: cut: command not found
/usr/local/share/nems/nems-scripts/fixes.sh: line 544: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 569: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 571: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 573: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 575: /usr/local/share/nems/nems-scripts/zram.sh: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 578: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/fixes.sh: line 578: [: -eq: unary operator expected
/usr/local/share/nems/nems-scripts/fixes.sh: line 582: rm: command not found

Done.

/usr/local/bin/nems-update: line 244: rm: command not found
user@nems:~ $ sudo nems-update
-bash: /usr/bin/sudo: Input/output error
user@nems:~ $
nix-7
Junior Member
Posts: 4
Joined: Fri Mar 08, 2019 5:44 am

RE: Cron thermallogger.sh PHP notice

Post by nix-7 »

Hmmm, I'm unsure what happened there.
System became unresponsive.
Power cycled, didn't come back up.
Took out SD card, fsck ext4 partition.
Replaced, and booted up. All looks OK now.
And confirmed no longer getting originalPHP notice emails.

Thanks again for checking, and fixing so quickly.
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: Cron thermallogger.sh PHP notice

Post by Robbie Ferguson »

Yeah - that almost looked like a drive failure or maybe an out-of-space issue or something. Did you use the same card? Did you determine what happened there?

None of the patches I issued today would even go near causing the errors you reported - that really looks like a filesystem problem.

Cheers,
Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
nix-7
Junior Member
Posts: 4
Joined: Fri Mar 08, 2019 5:44 am

RE: Cron thermallogger.sh PHP notice

Post by nix-7 »

Yea, not a space issue, and the sd card appears fine and is still working OK.
I did have to run an fsck on the partition, which did fix errors.

I didn't mean to infer your update caused my issue as such, I thought it worth reporting the output on the ever so slight possibility that it was related. I'm comfortable with it being pure coincidence.

If I have another issue, I'll bin the card and use another.
I'll put it down to cosmic rays for now.

Feel free to close this one, as the actual bug has been fixed.
Thanks again.
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: Cron thermallogger.sh PHP notice

Post by Robbie Ferguson »

Okay cool - thanks.
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Locked