Page 1 of 1

Server Error log filled with repetitive errors

Posted: Wed 11 Dec 2019 1:28 pm
by vpokroglo
My server error log contains repetitive errors in CU-defs.php on line 81\n (82\)
Any thoughts where is the problem, because i am lost?


here are some rows of error.log:

Code: Select all

[Tue Dec 10 02:56:39.951973 2019] [lsapi:notice] [pid 1605:tid 140621892826880] [client 66.249.79.76:57815] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 81\n
[Tue Dec 10 02:56:39.952047 2019] [lsapi:notice] [pid 1605:tid 140621892826880] [client 66.249.79.76:57815] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 81\n
[Tue Dec 10 02:56:39.952066 2019] [lsapi:notice] [pid 1605:tid 140621892826880] [client 66.249.79.76:57815] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82\n
[Tue Dec 10 02:56:39.952081 2019] [lsapi:notice] [pid 1605:tid 140621892826880] [client 66.249.79.76:57815] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82\n
[Tue Dec 10 02:59:44.994377 2019] [lsapi:notice] [pid 1605:tid 140622077466368] [client 157.55.39.9:14749] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 81\n
[Tue Dec 10 02:59:44.994430 2019] [lsapi:notice] [pid 1605:tid 140622077466368] [client 157.55.39.9:14749] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 81\n
[Tue Dec 10 02:59:44.994452 2019] [lsapi:notice] [pid 1605:tid 140622077466368] [client 157.55.39.9:14749] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82\n
[Tue Dec 10 02:59:44.994468 2019] [lsapi:notice] [pid 1605:tid 140622077466368] [client 157.55.39.9:14749] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82\n
[Tue Dec 10 03:18:41.264531 2019] [lsapi:notice] [pid 23147:tid 140621708187392] [client 35.224.83.12:62351] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 81\n
[Tue Dec 10 03:18:41.264579 2019] [lsapi:notice] [pid 23147:tid 140621708187392] [client 35.224.83.12:62351] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 81\n
[Tue Dec 10 03:18:41.264598 2019] [lsapi:notice] [pid 23147:tid 140621708187392] [client 35.224.83.12:62351] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82\n
[Tue Dec 10 03:18:41.264615 2019] [lsapi:notice] [pid 23147:tid 140621708187392] [client 35.224.83.12:62351] [host okroglovreme.com] Backend log: PHP Notice:  A non well formed numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82\n

Re: Server Error log filled with repetitive errors

Posted: Wed 11 Dec 2019 4:20 pm
by saratogaWX
Those two lines

Code: Select all

if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=$WX['dew']-$WX['RecentDewPoint m=60'];} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=$WX['press']-$WX['RecentPressure m=60'];} // conditional value
likely have some non-numeric data in the $WX variables.

Looking at https://okroglovreme.com/CUtags.php?sce=dump shows

Code: Select all

$WX['RecentDewPoint m=60'] = '-11,8';
 $WX['RecentPressure m=60'] = '1012,5';
and

Code: Select all

$WX['dew'] = '-12,4';
$WX['press'] = '1011,7';
The non-numeric notice is caused by the decimal-comma notation for the data. PHP is expecting to process decimal-period formatted numbers.

It's a cheap hack, but you can try changing the lines to

Code: Select all

if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=str_replace(',','.',$WX['dew'])-str_replace(',','.',$WX['RecentDewPoint m=60']);} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=str_replace(',','.',$WX['press'])-str_replace(',','.',$WX['RecentPressure m=60']);} // conditional value

Re: Server Error log filled with repetitive errors

Posted: Wed 11 Dec 2019 4:31 pm
by mcrossley
When running Cumulus MX, all numeric web tags also take the parameter "rc=y" to make them output dot decimals - so <#RecentDewPoint m=60 rc=y>

Re: Server Error log filled with repetitive errors

Posted: Thu 12 Dec 2019 8:16 pm
by vpokroglo
I have edited those two rows in CUtags.txt file:

Code: Select all

!RecentDewPoint m=60|<#RecentDewPoint m=60>:|:
!RecentPressure m=60|<#RecentPressure m=60>:|:
to:

Code: Select all

!RecentDewPoint m=60|<#RecentDewPoint m=60 rc=y>:|:
!RecentPressure m=60|<#RecentPressure m=60 rc=y>:|:
... but processed output is always number with decimal comma not period and wxtrends.php does not recognizes it.

Re: Server Error log filled with repetitive errors

Posted: Thu 12 Dec 2019 8:36 pm
by vpokroglo
saratogaWX wrote:
Wed 11 Dec 2019 4:20 pm
Those two lines

Code: Select all

if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=$WX['dew']-$WX['RecentDewPoint m=60'];} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=$WX['press']-$WX['RecentPressure m=60'];} // conditional value
likely have some non-numeric data in the $WX variables.

Looking at https://okroglovreme.com/CUtags.php?sce=dump shows

Code: Select all

$WX['RecentDewPoint m=60'] = '-11,8';
 $WX['RecentPressure m=60'] = '1012,5';
and

Code: Select all

$WX['dew'] = '-12,4';
$WX['press'] = '1011,7';
The non-numeric notice is caused by the decimal-comma notation for the data. PHP is expecting to process decimal-period formatted numbers.

It's a cheap hack, but you can try changing the lines to

Code: Select all

if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=str_replace(',','.',$WX['dew'])-str_replace(',','.',$WX['RecentDewPoint m=60']);} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=str_replace(',','.',$WX['press'])-str_replace(',','.',$WX['RecentPressure m=60']);} // conditional value
Trying Ken's solution now. All is looking good for now, will see tomorrows server log...

edit: 13.12.2019 - This solution is working, no more errors-warnings in server log!