Author Topic: Undefined index: NOAA2018.TXT in NOAA-reports-test.php  (Read 710 times)

0 Members and 1 Guest are viewing this topic.

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« on: May 23, 2018, 11:39:42 AM »
Hi,

I decided to try to cleanup errors in my server error_log. Some of the more obvious I was able to handle myself, but I am left with the following and could use some help...

Code: [Select]
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018.TXT in ......../NOAA-reports-test.php on line 196
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-05.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-06.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-07.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-08.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-09.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-10.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-11.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2018-12.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2003-01.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2003-02.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2003-03.TXT in ......../NOAA-reports-test.php on line 207
[23-May-2018 10:20:17 America/Detroit] PHP Notice:  Undefined index: NOAA2003-04.TXT in ......../NOAA-reports-test.php on line 207

These files/reports DO NOT EXIST. The 2018 files listed are for months that have not yet occurred, and the 2003 are for months before my weather station became operational.

The problem is that the errors for these files repeat continuously, inflating the log file.

Note; My Saratoga Template based site is configured for WD, however I prefer WL NOAA reports, so I am using the standalone version "NOAA-reports-test.php".

I could also use some help with this error...

Code: [Select]
[23-May-2018 10:20:28 America/Detroit] PHP Warning:  A non-numeric value encountered in ......../atom-top-warning.php on line 875
Thanks,
Dennis
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #1 on: May 24, 2018, 12:45:46 AM »
The standalone NOAA-reports-test.php script is configured only to work with WeatherLink, Cumulus or VWS, not for Weather-Display (which uses a different naming structure and HTML files, not .txt files).

Are you uploading (via WeatherLink) the NOAAMO.TXT, NOAAYR.TXT, NOAAPRMO.TXT, NOAAPRYR.TXT files to your site?  They are what is used by the WL configured script and populate the ./NOAA-reports/ directory with NOAAyyyy.TXT and NOAAyyyy-mm.TXT files as the month and year rolls over.

I'll take a look at your site for the atom-top-warning.php error...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #2 on: May 24, 2018, 01:00:47 AM »
Do check out your ./WL/NOAA-reports/ directory on the webserver and remove any files that don't match NOAA*.TXT names.  I've seen instances where some rogue files disturbed the script.

For the atom-top-warning.php error, change line 874
Code: [Select]
  $total_time = '';
to
Code: [Select]
  $total_time = 0;

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #3 on: May 25, 2018, 05:31:09 PM »
Thanks Ken,

I did find a rouge file in my reports folder, unfortunately deleting it did not resolve the errpr being posted.

Files in "NOAA-reports" folder...
Code: [Select]
NOAA2003.TXT
NOAA2003-05.TXT
NOAA2003-06.TXT
NOAA2003-07.TXT
NOAA2003-08.TXT
NOAA2003-09.TXT
NOAA2003-10.TXT
NOAA2003-11.TXT
NOAA2003-12.TXT
NOAA2004.TXT
NOAA2004-01.TXT
NOAA2004-02.TXT
NOAA2004-03.TXT
NOAA2004-04.TXT
NOAA2004-05.TXT
NOAA2004-06.TXT
NOAA2004-07.TXT
NOAA2004-08.TXT
NOAA2004-09.TXT
NOAA2004-10.TXT
NOAA2004-11.TXT
NOAA2004-12.TXT
NOAA2005.TXT
NOAA2005-01.TXT
NOAA2005-02.TXT
NOAA2005-03.TXT
NOAA2005-04.TXT
NOAA2005-05.TXT
NOAA2005-06.TXT
NOAA2005-07.TXT
NOAA2005-08.TXT
NOAA2005-09.TXT
NOAA2005-10.TXT
NOAA2005-11.TXT
NOAA2005-12.TXT
NOAA2006.TXT
NOAA2006-01.TXT
NOAA2006-02.TXT
NOAA2006-03.TXT
NOAA2006-04.TXT
NOAA2006-05.TXT
NOAA2006-06.TXT
NOAA2006-07.TXT
NOAA2006-08.TXT
NOAA2006-09.TXT
NOAA2006-10.TXT
NOAA2006-11.TXT
NOAA2006-12.TXT
NOAA2007.TXT
NOAA2007-01.TXT
NOAA2007-02.TXT
NOAA2007-03.TXT
NOAA2007-04.TXT
NOAA2007-05.TXT
NOAA2007-06.TXT
NOAA2007-07.TXT
NOAA2007-08.TXT
NOAA2007-09.TXT
NOAA2007-10.TXT
NOAA2007-11.TXT
NOAA2007-12.TXT
NOAA2008.TXT
NOAA2008-01.TXT
NOAA2008-02.TXT
NOAA2008-03.TXT
NOAA2008-04.TXT
NOAA2008-05.TXT
NOAA2008-06.TXT
NOAA2008-07.TXT
NOAA2008-08.TXT
NOAA2008-09.TXT
NOAA2008-10.TXT
NOAA2008-11.TXT
NOAA2008-12.TXT
NOAA2009.TXT
NOAA2009-01.TXT
NOAA2009-02.TXT
NOAA2009-03.TXT
NOAA2009-04.TXT
NOAA2009-05.TXT
NOAA2009-06.TXT
NOAA2009-07.TXT
NOAA2009-08.TXT
NOAA2009-09.TXT
NOAA2009-10.TXT
NOAA2009-11.TXT
NOAA2009-12.TXT
NOAA2010.TXT
NOAA2010-01.TXT
NOAA2010-02.TXT
NOAA2010-03.TXT
NOAA2010-04.TXT
NOAA2010-05.TXT
NOAA2010-06.TXT
NOAA2010-07.TXT
NOAA2010-08.TXT
NOAA2010-09.TXT
NOAA2010-10.TXT
NOAA2010-11.TXT
NOAA2010-12.TXT
NOAA2011.TXT
NOAA2011-01.TXT
NOAA2011-02.TXT
NOAA2011-03.TXT
NOAA2011-04.TXT
NOAA2011-05.TXT
NOAA2011-06.TXT
NOAA2011-07.TXT
NOAA2011-08.TXT
NOAA2011-09.TXT
NOAA2011-10.TXT
NOAA2011-11.TXT
NOAA2011-12.TXT
NOAA2012.TXT
NOAA2012-01.TXT
NOAA2012-02.TXT
NOAA2012-03.TXT
NOAA2012-04.TXT
NOAA2012-05.TXT
NOAA2012-06.TXT
NOAA2012-07.TXT
NOAA2012-08.TXT
NOAA2012-09.TXT
NOAA2012-10.TXT
NOAA2012-11.TXT
NOAA2012-12.TXT
NOAA2013.TXT
NOAA2013-01.TXT
NOAA2013-02.TXT
NOAA2013-03.TXT
NOAA2013-04.TXT
NOAA2013-05.TXT
NOAA2013-06.TXT
NOAA2013-07.TXT
NOAA2013-08.TXT
NOAA2013-09.TXT
NOAA2013-10.TXT
NOAA2013-11.TXT
NOAA2013-12.TXT
NOAA2014.TXT
NOAA2014-01.TXT
NOAA2014-02.TXT
NOAA2014-03.TXT
NOAA2014-04.TXT
NOAA2014-05.TXT
NOAA2014-06.TXT
NOAA2014-07.TXT
NOAA2014-08.TXT
NOAA2014-09.TXT
NOAA2014-10.TXT
NOAA2014-11.TXT
NOAA2014-12.TXT
NOAA2015.TXT
NOAA2015-01.TXT
NOAA2015-02.TXT
NOAA2015-03.TXT
NOAA2015-04.TXT
NOAA2015-05.TXT
NOAA2015-06.TXT
NOAA2015-07.TXT
NOAA2015-08.TXT
NOAA2015-09.TXT
NOAA2015-10.TXT
NOAA2015-11.TXT
NOAA2015-12.TXT
NOAA2016.TXT
NOAA2016-01.TXT
NOAA2016-02.TXT
NOAA2016-03.TXT
NOAA2016-04.TXT
NOAA2016-05.TXT
NOAA2016-06.TXT
NOAA2016-07.TXT
NOAA2016-08.TXT
NOAA2016-09.TXT
NOAA2016-10.TXT
NOAA2016-11.TXT
NOAA2016-12.TXT
NOAA2017.TXT
NOAA2017-01.TXT
NOAA2017-02.TXT
NOAA2017-03.TXT
NOAA2017-04.TXT
NOAA2017-05.TXT
NOAA2017-06.TXT
NOAA2017-07.TXT
NOAA2017-08.TXT
NOAA2017-09.TXT
NOAA2017-10.TXT
NOAA2017-11.TXT
NOAA2017-12.TXT
NOAA2018-01.TXT
NOAA2018-02.TXT
NOAA2018-03.TXT
NOAA2018-04.TXT
NOAAMO.TXT
NOAAPRMO.TXT
NOAAPRYR.TXT
NOAAYR.TXT

It's interesting that the errors are only for files/months of years of reporting, that don't have files created. Either because the station wasn't established yet, or because the months haven't occurred yet.

Your fix for the atom-top-warning.php did work.

Thanks again.
Dennis
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #4 on: May 25, 2018, 05:40:24 PM »
Hi Dennis,
I don't see errors on http://www.sandpointweather.com/wxnoaaclimatereports-WL.php which calls NOAA-reports-test.php

Are the errors in the error_log?  What are they now showing?

Glad the atom-top-warning fix worked ok :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #5 on: May 25, 2018, 06:51:04 PM »
Ken,

Yes, the errors are posted in the error_log, just like I posted in my first post.

As a dummy I also find it interesting that the errors are posted even if only my home page is opened.

Added: Then the thirteen errors repeat.

Dennis
« Last Edit: May 25, 2018, 07:04:34 PM by spweather »
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #6 on: May 25, 2018, 07:58:01 PM »
Hmmm... Try changing NOAA-reports-test.php line 196 from
Code: [Select]
if ($filesfound[$t] || $yy == $now_year) { to
Code: [Select]
if (isset($filesfound[$t]) || $yy == $now_year) {
and line 207 from
Code: [Select]
if ($filesfound[$testfile]) {to
Code: [Select]
if (isset($filesfound[$testfile])) { and that should quiet those Notice: errata.

As to why they appear in the error_log when your home page is loaded, I don't know.. shouldn't happen unless you're including the script via one of the foundation scripts (top.php, header.php, menubar.php or footer.php) in order to get it to cycle the files automatically when the month/year rolls over.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: Undefined index: NOAA2018.TXT in NOAA-reports-test.php
« Reply #7 on: May 26, 2018, 06:06:49 PM »
Hey Ken,

Your mod's worked great, thanks so much.

Those errors were repeating quickly making it hard to find more important errors mixed in the log.

Dennis
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor