Category5.TV Community Forum

Full Version: Cron PHP notice
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 <[email protected]> /usr/local/share/nems/nems-scripts/ 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/ 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/
$temp = (file_get_contents('/sys/class/thermal/thermal_zone0/temp')/1000);
# cat /sys/class/thermal/thermal_zone0/temp
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.

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

[email protected]:~ $ 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.
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.
afd7fdd..cbe88d5 master -> origin/master
Updating afd7fdd..cbe88d5 Fast-forward | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New Commit: afd7fdd8786f75f6d82050bab6c869cc44cde950

Running updates and fixes... Please wait for apt tasks to complete...
Get:1 buster InRelease [25.2 kB]
Get:2 buster InRelease [15.0 kB]
Get:3 buster/main armhf Packages [13.1 MB]
Ign:4 rpimonitor/ InRelease
Hit:5 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/ line 42: /usr/bin/mysql: Input/output error
/usr/local/share/nems/nems-scripts/ 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/ line 314: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/ line 317: chown: command not found
/usr/local/share/nems/nems-scripts/ line 328: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 339: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 340: cp: command not found
/usr/local/share/nems/nems-scripts/ line 341: chown: command not found
/usr/local/share/nems/nems-scripts/ line 345: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 346: cp: command not found
/usr/local/share/nems/nems-scripts/ line 349: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 350: cp: command not found
/usr/local/share/nems/nems-scripts/ line 354: cd: /var/www/adagios: Input/output error
/usr/local/share/nems/nems-scripts/ line 355: /usr/bin/find: Input/output error
/usr/local/share/nems/nems-scripts/ line 356: /usr/local/bin/pip: Input/output error
/usr/local/share/nems/nems-scripts/ line 357: /usr/local/bin/pip: Input/output error
/usr/local/share/nems/nems-scripts/ line 358: /usr/bin/python: Input/output error
/usr/local/share/nems/nems-scripts/ line 359: /bin/systemctl: Input/output error
/usr/local/share/nems/nems-scripts/ line 363: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 364: /root/nems/nems-admin/build/010-tty: Input/output error
/usr/local/share/nems/nems-scripts/ line 368: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 369: /root/nems/nems-admin/build/012-tty: Input/output error
/usr/local/share/nems/nems-scripts/ line 373: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 374: cp: command not found
/usr/local/share/nems/nems-scripts/ line 382: awk: command not found
/usr/local/share/nems/nems-scripts/ line 414: ln: command not found
/usr/local/share/nems/nems-scripts/ line 420: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 423: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 424: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 429: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 430: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 434: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 435: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 440: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 441: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/ line 445: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 446: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 450: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 451: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 456: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 461: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 462: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 466: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 467: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 476: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 477: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 481: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 482: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 486: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 487: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 491: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 492: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 496: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 500: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 503: /var/log/nems/nems-tools/warninglight: Read-only file system
/usr/local/share/nems/nems-scripts/ line 506: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 507: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 511: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 512: /tmp/cron.tmp: Read-only file system
/usr/local/share/nems/nems-scripts/ line 517: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 528: crontab: command not found
/usr/local/share/nems/nems-scripts/ line 532: rm: command not found
/usr/local/share/nems/nems-scripts/ line 538: /usr/bin/apt: Input/output error
/usr/local/share/nems/nems-scripts/ line 542: cat: command not found
/usr/local/share/nems/nems-scripts/ line 542: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 542: cut: command not found
/usr/local/share/nems/nems-scripts/ line 544: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/ line 569: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 571: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/ line 573: /bin/sed: Input/output error
/usr/local/share/nems/nems-scripts/ line 575: /usr/local/share/nems/nems-scripts/ Input/output error
/usr/local/share/nems/nems-scripts/ line 578: /bin/grep: Input/output error
/usr/local/share/nems/nems-scripts/ line 578: [: -eq: unary operator expected
/usr/local/share/nems/nems-scripts/ line 582: rm: command not found


/usr/local/bin/nems-update: line 244: rm: command not found
[email protected]:~ $ sudo nems-update
-bash: /usr/bin/sudo: Input/output error
[email protected]:~ $
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.
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.

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.
Okay cool - thanks.