Author Topic: metar conditions error  (Read 573 times)

0 Members and 1 Guest are viewing this topic.

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
metar conditions error
« on: March 26, 2018, 04:23:57 AM »
Notice: Undefined variable: metarGMT in /home/hj2ke8lfpx43/public_html/get-metar-conditions-inc.php on line 172

Warning: reset() expects parameter 1 to be array, null given in /home/hj2ke8lfpx43/public_html/get-metar-conditions-inc.php on line 651

Warning: Invalid argument supplied for foreach() in /home/hj2ke8lfpx43/public_html/get-metar-conditions-inc.php on line 656

Getting this error not sure why..
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 950
    • LexMAWeather
Re: metar conditions error
« Reply #1 on: March 26, 2018, 07:52:14 AM »
Regarding the $metarGMT error, it is indeed undefined at that point. Sometime in the past I modified my own code from:

Code: [Select]
        $t = array(
          "unable to load $icao data RC=$RC",
          5,
          'day_partly_cloudy.gif',
          "unable to load $icao data RC=$RC",
          array() ,
          $metarGMT
        );

to:

Code: [Select]
$t = array(
          "unable to load $icao data RC=$RC",
          5,
          'day_partly_cloudy.gif',
          "unable to load $icao data RC=$RC",
          array(),
          0);
//          $metarGMT);

... so I must have run into this before.

I'll have a look at the others...
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 950
    • LexMAWeather
Re: metar conditions error
« Reply #2 on: March 26, 2018, 08:31:11 AM »
Note: I'm now seeing this:

Code: [Select]
Notice: Undefined index: OCV in /home/hj2ke8lfpx43/public_html/get-metar-conditions-inc.php on line 1214

Notice: Undefined index: OCV in /home/hj2ke8lfpx43/public_html/get-metar-conditions-inc.php on line 1225

This is because the METAR is miscoded (should be "OVC"). Would probably make sense to harden the code to check for legitimate cloud conditions, i.e.

Code: [Select]
if (isset($cloudCode[$pieces[1]]))
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: metar conditions error
« Reply #3 on: May 02, 2018, 05:24:14 PM »
HI Ken

I started to see this too in the error logs.  I changed the code to what you suggested, but still get this:

Quote
[Wed May 02 22:21:51.643235 2018] [php7:emerg] [pid 29691:tid 139703248316160] [client 81.104.71.6:56390] PHP Parse error:  syntax error, unexpected ')' in /htdocs/weather/get-metar-conditions-inc.php on line 181
[Wed May 02 22:21:58.710739 2018] [php7:emerg] [pid 29777:tid 139703248316160] [client 186.244.121.22:54096] PHP Parse error:  syntax error, unexpected ')' in /htdocs/weather/get-metar-conditions-inc.php on line 181
[Wed May 02 22:22:00.033040 2018] [php7:emerg] [pid 30934:tid 139703248316160] [client 186.244.121.22:54101] PHP Parse error:  syntax error, unexpected ')' in /htdocs/weather/get-metar-conditions-inc.php on line 181
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6377
    • Valentine Nebraska's Real-Time Weather
Re: metar conditions error
« Reply #4 on: May 02, 2018, 06:35:10 PM »
I've been having way too many issues with METAR data, it hangs my site also. Even getting forecast has become an adventure.  :evil:

I'm no longer relying on METAR data for anything, completely removed page and just ordered solar sensor for VP2 from scaled for conditions icon.
Randy

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: metar conditions error
« Reply #5 on: May 03, 2018, 04:54:21 AM »
I've been having way too many issues with METAR data, it hangs my site also. Even getting forecast has become an adventure.  :evil:

I'm no longer relying on METAR data for anything, completely removed page and just ordered solar sensor for VP2 from scaled for conditions icon.

seems to be working again today. must have been a network error or outage.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


 

anything