Author Topic: api.weather.com non-functional  (Read 519 times)

0 Members and 1 Guest are viewing this topic.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 885
    • LexMAWeather
api.weather.com non-functional
« on: December 19, 2019, 08:24:44 AM »
Getting nothing but timeouts, 500, and 502 HTML errors from api.weather.gov this morning  :-(

I've let them know but I have to imagine they know already.

So if your forecast script (v5.xx) isn't working, that's probably why.

Offline Cutty Sark Sailor

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3303
    • Frankfort Weather - TwinHollies WeatherCenter
Re: api.weather.com non-functional
« Reply #1 on: December 19, 2019, 09:38:54 AM »
Yeah, forecasts ain't computing'... that part gets very slow sometimes anyway.. least through my connections.,.. wasted a lot of time before figured it out a few weeks ago...
...  I sent Ken an email eariler the Saratoga Dashboard / Adforecast2, maybe split load, and load dashboard and other, before calling the forecast... but haven't heard from him... I think he's losing my emais... heh...  :twisted: one spam watcher sporadically flags one of my urls, apparently the various sites on that server send >25 emails over a couple of hours at night , I suppose, whatever BS...  idiota. Have no intention of changing it, however. Let 'em retrain thair algorithms.
« Last Edit: December 19, 2019, 09:51:57 AM by Cutty Sark Sailor »
 

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 885
    • LexMAWeather
Re: api.weather.com non-functional
« Reply #2 on: December 19, 2019, 10:28:00 AM »
Back up and running again.

For reasons such as this, I removed all external fetches from my home page quite a while ago and gave that work to cron jobs (sticking the results in cache files).  That way the page load doesn't suffer because of conditions out of my control.


Offline ilovehd

  • Member
  • *
  • Posts: 8
    • Hersey, MI Weather
Re: api.weather.com non-functional
« Reply #3 on: December 19, 2019, 09:06:40 PM »
Jasiu -

I was thinking of doing the same thing for the exact reasons that happened today.  Can you share how you have yours setup?

I already have my alerts setup as a cron job.

I checked my fetch times - What I don't understand is where it is getting the https://api.weather.gov/points/43.8728,-85.4089/forecast URL from - the first line in my settings.php for $SITE['NWSforecasts'] is:
"MIZ039|Hersey|https://forecast.weather.gov/MapClick.php?lat=43.8728&lon=-85.4089#.XfwoXGRKjI",

So it fails over - which also takes some time...

This script will check the load times and the ability to save cache files for the included support scripts with your template package.

  Included Settings.php time=0.003 secs.

Using lang=en as default for testing


--checking NWS Forecast URL --
Using first entry in Settings.php $SITE['NWSforecasts'] for test.
URL: https://api.weather.gov/points/43.8728,-85.4089/forecast
Cache: ./cache/forecast-MIZ039-test-json.txt
 curl fetching 'https://api.weather.gov/points/43.8728,-85.4089/forecast'
 curl Error: Operation timed out after 3676 milliseconds with 0 bytes received
 note: fetched 'https://api.weather.gov/gridpoints/GRR/46,89/forecast' after redirect was followed.
 HTTP stats:  RC=301 dest=23.11.216.18 port=443 (from sce=74.208.57.165)
      Times: dns=0.000 conn=0.000 pxfer=0.000 get=3.456 total=3.456 secs
 headers returned:

 
RC=, bytes=4
------------
Headers returned:



------------

Skipped cache write test to ./cache/forecast-MIZ039-test-json.txt file.
Test was NOT successful.
--end NWS Forecast URL check --

--checking NWS Warning Zone ATOM/CAP Feed --
Using Settings.php $SITE['noaazone'] entry for test.
URL: https://alerts.weather.gov/cap/wwaatmget.php?x=MIZ039
Cache: ./cache/atom-advisory-MIZ039.txt
 curl fetching 'https://alerts.weather.gov/cap/wwaatmget.php?x=MIZ039'
 HTTP stats:  RC=200 dest=23.11.216.18 port=443 (from sce=74.208.57.165)
      Times: dns=0.004 conn=0.016 pxfer=0.045 get=0.269 total=0.314 secs
RC=200, bytes=2050
Wrote 2050 bytes to ./cache/atom-advisory-MIZ039.txt successfully.
Test was SUCCESSFUL.
--end NWS Warning Zone ATOM/CAP Feed check --

--checking UV Forecast from temis.nl --
Using Settings.php $SITE['UVscript'] entry for test.
URL: http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-85.4105&lat=43.8225
Cache: ./cache/uv-forecast.txt
 curl fetching 'http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-85.4105&lat=43.8225'
 HTTP stats:  RC=200 dest=145.23.254.72 port=80 (from sce=74.208.57.165)
      Times: dns=0.004 conn=0.107 pxfer=0.107 get=1.053 total=1.160 secs
RC=200, bytes=6381
Wrote 6381 bytes to ./cache/uv-forecast.txt successfully.
Test was SUCCESSFUL.
--end UV Forecast from temis.nl check --


Total time taken = 0.003 secs.
Elapsed 5 seconds.

PHP Version 7.3.12
Memory post_max_size 64M bytes.
Memory usage 972080 bytes.
Memory peak usage 1144296 bytes.

Thanks!

« Last Edit: December 19, 2019, 09:11:38 PM by ilovehd »

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 885
    • LexMAWeather
Re: api.weather.com non-functional
« Reply #4 on: December 20, 2019, 09:39:16 AM »
Jasiu -

I was thinking of doing the same thing for the exact reasons that happened today.  Can you share how you have yours setup?

I have a wrapper called cronforecast.php which is what I have the cron job invoke. I've made some non-trivial mods to Ken's forecast script, so my script won't work verbatim with a generic template site. It would take quite some time to write up something to guide someone through the process... So I'll put that on my todo list.  :grin:

Quote
I checked my fetch times - What I don't understand is where it is getting the https://api.weather.gov/points/43.8728,-85.4089/forecast URL from - the first line in my settings.php for $SITE['NWSforecasts'] is:
"MIZ039|Hersey|https://forecast.weather.gov/MapClick.php?lat=43.8728&lon=-85.4089#.XfwoXGRKjI",

So it fails over - which also takes some time...

Ken's code massages the old MapClick style URL that works with forecast.weather.gov into a format that works with api.weather.gov. That allows us to go between the old and new code without having to change the setting.

 

anything