Author Topic: advforecast2.php  (Read 7200 times)

0 Members and 1 Guest are viewing this topic.

Offline tshattuck

  • Forecaster
  • *****
  • Posts: 337
    • Your Local Weather - Clay, NY
advforecast2.php
« on: July 14, 2017, 03:46:08 PM »
Hello:
The NWS Forecasts stopped working this afternoon on my website which utilizes the Saratoga-Weather.org php templates. I have been using advforecast.php v.5.02, and all the forecast info on my website went blank. I switched back to v. 4.02 to test and everything is working again. I am not comfortable using the old version and I am assuming the NWS changed something on their end.  :eek:

What do I need to do to address this issue?

Any assistance is appreciated

http://yourlocalweather-clay-ny.com/

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #1 on: July 14, 2017, 03:54:17 PM »
Hmmm... 'stopped working' is kinda vague.  What did it show (V5.02) on the page? Did you do a view-source of the non-working page?  If so, what did the HTML comments have to say about it .. a normal fetch looks like
Quote
<!-- advforecast2.php (JSON) - V5.02 - 22-May-2017 on PHP 5.6.11-->
<!-- RAW NWS URL: http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2 -->
<!-- zone=CAZ513 -->
<!-- corrected NWS API URL='https://api.weather.gov/points/37.2639,-122.022/forecast' -->
<!-- curl fetching 'https://api.weather.gov/points/37.2639,-122.022/forecast' -->
<!-- HTTP stats:  RC=200 dest=23.197.96.136 port=443 (from sce=192.168.1.104)
      Times: dns=0.000 conn=0.015 pxfer=0.046 get=0.016 total=0.062 secs -->
<!-- loaded https://api.weather.gov/points/37.2639,-122.022/forecast - 9394 bytes -->
<!-- wrote cache file ./forecast-CAZ513-0-json.txt -->
<!-- meta info re: point='37.2639,-122.022' zone='CAZ513' metacache= './forecast-CAZ513-0-json-meta.txt' -->
<!-- metaZoneURL='https://api.weather.gov/zones/forecast/CAZ513' -->
<!-- loaded meta info from ./forecast-CAZ513-0-json-meta.txt -->
<!-- META
Array
(
    [zoneName] => Santa Clara Valley Including San Jose
    [city] => Saratoga
    [state] => CA
    [point] => 37.2639,-122.022
    [forecastOfficeURL] => https://api.weather.gov/offices/MTR
    [forecastZoneURL] => https://api.weather.gov/zones/forecast/CAZ513
    [forecastZone] => CAZ513
    [forecastHourlyURL] => https://api.weather.gov/points/37.2639,-122.022/forecast/hourly
    [forecastGridDataURL] => https://api.weather.gov/gridpoints/MTR/97,101
    [observationStationsURL] => https://api.weather.gov/points/37.2639,-122.022/stations
    [countyZoneURL] => https://api.weather.gov/zones/county/CAC085
    [countyZone] => CAC085
    [fireWeatherZoneURL] => https://api.weather.gov/zones/fire/CAZ513
    [fireWeatherZone] => CAZ513
    [timeZone] => America/Los_Angeles
    [radarStation] => KMUX
    [WFOname] => San Francisco Bay Area/Monterey, CA
)
 -->
<!-- point forecast processing -->

<!-- forecast updated '2017-07-14T08:32:04+00:00' (1:32 am PDT Jul 14, 2017) for lat,long or zone 'POINT (-122.022 37.2639)' -->
<!-- curl fetching 'https://api.weather.gov/alerts?active=1&zone=CAZ513' -->
<!-- HTTP stats:  RC=200 dest=23.197.96.136 port=443 (from sce=192.168.1.104)
      Times: dns=0.000 conn=0.031 pxfer=0.047 get=0.016 total=0.063 secs -->
<!-- loaded alert for CAZ513 from https://api.weather.gov/alerts?active=1&zone=CAZ513 - 659 bytes -->
<!-- wrote cache file ./forecast-CAZ513-0-json-alerts.txt -->
<!-- ALERTJSON
Array
(
    [@context] =>
    [@graph] => Array
        (
        )

    [title] => Current watches, warnings, and advisories for Santa Clara Valley Including San Jose (CAZ513) CA
)
 -->
<!-- preparing 0 warning links -->
<!-- now 12:51 pm PDT Jul 14, 2017 (7:51 pm GMT Jul 14, 2017) -->
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 tshattuck

  • Forecaster
  • *****
  • Posts: 337
    • Your Local Weather - Clay, NY
Re: advforecast2.php
« Reply #2 on: July 14, 2017, 04:04:30 PM »
Ken:
I loaded version 5.02 back on my website so you can view. I am not sure what source code to look for. The page has been working fine for over a month then today no NWS weather data display. You will now see what is happening when you view my site (Home and Forecast page).

Here is the message I am seeing on the Forecast page:

<p>Sorry.. the forecast for Clay, NY is not available at this time.</p>
<!-- advforecast2.php (JSON) - V5.02 - 22-May-2017 on PHP 5.4.45-->
<!-- RAW NWS URL: http://forecast.weather.gov/MapClick.php?CityName=Clay&state=NY&site=BGM&textField1=43.1858&textField2=-76.1728&e=1&TextType=2 -->
<!-- zone=NYZ018 -->
<!-- corrected NWS API URL='https://api.weather.gov/points/43.1858,-76.1728/forecast' -->
<!-- loaded cache file ./cache/forecast-NYZ018-0-json.txt - 851 bytes -->
<!-- meta info re: point='43.1858,-76.1728' zone='NYZ018' metacache= './cache/forecast-NYZ018-0-json-meta.txt' -->
<!-- metaZoneURL='https://api.weather.gov/zones/forecast/NYZ018' -->
<!-- loaded meta info from ./cache/forecast-NYZ018-0-json-meta.txt -->
<!-- META
Array
(
    [city] => 3 Miles SSW Brewerton
    [state] => NY
    [point] => 43.1858,-76.1728
    [forecastOfficeURL] => https://api.weather.gov/offices/BGM
    [forecastZoneURL] => https://api.weather.gov/zones/forecast/NYZ018
    [forecastZone] => NYZ018
    [forecastHourlyURL] => https://api.weather.gov/points/43.1858,-76.1728/forecast/hourly
    [forecastGridDataURL] => https://api.weather.gov/gridpoints/BGM/50,104
    [observationStationsURL] => https://api.weather.gov/points/43.1858,-76.1728/stations
    [countyZoneURL] => https://api.weather.gov/zones/county/NYC067
    [countyZone] => NYC067
    [fireWeatherZoneURL] => https://api.weather.gov/zones/fire/NYZ018
    [fireWeatherZone] => NYZ018
    [timeZone] => America/New_York
    [radarStation] => KTYX
    [zoneName] => Onondaga
    [WFOname] => Binghamton/Johnson City, NY
)
 -->
<p>NWS server  has an error.</p>
<p>View the source of this page for additional information in HTML comments.</p>



I hope this is a minor issue.
I should have added that before I posted the question, I checked other local weather websites that use your php scripts and they appear to be working.

Thanks
« Last Edit: July 14, 2017, 04:30:18 PM by tshattuck »

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: advforecast2.php
« Reply #3 on: July 14, 2017, 04:34:54 PM »
Ken,

I am also getting an error message on my forecast page. It says that the NWS server has an error.

Joe
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #4 on: July 14, 2017, 05:36:57 PM »
Their api.weather.gov server has been having issues lately .. when that server(s) has a problem, then neither the point nor the Zone forecast are available, so nothing is shown.  I can't display when there is no data to be had from the api.weather.gov server.  :(
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 tshattuck

  • Forecaster
  • *****
  • Posts: 337
    • Your Local Weather - Clay, NY
Re: advforecast2.php
« Reply #5 on: July 14, 2017, 05:51:22 PM »
Ken:
Hopefully the NWS will get the issue resolved quickly.
As always thanks for your assistance.

Offline tshattuck

  • Forecaster
  • *****
  • Posts: 337
    • Your Local Weather - Clay, NY
Re: advforecast2.php
« Reply #6 on: July 14, 2017, 07:34:56 PM »
Ken:
I just checked the NWS Forecast again and it's still not working.

I switched back to v.4.02 and don't see any obvious issues currently. What issues do I have by using advforecast2.php v. 4.02 until the NWS resolves their server issue?  I realize there is more going on in the background thus the need for your updates.
Version 4.02 is the latest version that currently works on my website. I don't want to leave my users without the forecasts, it doesn't make the website look good.

Thanks again for your assistance.

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: advforecast2.php
« Reply #7 on: July 15, 2017, 12:06:45 AM »
Having the same problem but, for only 2 of the 16 forecasts I have setup. Am running advforecast2 v5.02. This has happened previously and eventually it starts working again.
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #8 on: July 15, 2017, 12:30:22 PM »
All but 3 cities on my dropdown list are working. However over the past week or so I've seen 'stuttering' when the page comes up and also frequently the attachment. Looks like slow to no server response.
John
W7JKG

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #9 on: July 15, 2017, 12:34:59 PM »
Can you grab a copy of the JSON file from the cache when the 'stuttering' happens, also a view-source of the page itself with the HTML comments regarding the advforecast2.php V5.02 progress messages?

That would really help me see if there's a 'softer' way to handle presentation when the api.weather.gov server hiccups...
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 jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #10 on: July 15, 2017, 12:38:20 PM »
Will do my best, Ken. Doesn't happen every time.
John
W7JKG

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #11 on: July 15, 2017, 12:43:33 PM »
I did a quick run-through on your wxforecast.php page and found one (Show Low) that exhibited 'unavailable' error
Quote
Sorry.. the forecast for Show Low is not available at this time.

NWS server https://api.weather.gov/points/34.2542,-110.0298/forecast has an error.

View the source of this page for additional information in HTML comments.

-- the JSON returned was
Quote
HTTP/1.1 404 Not Found
Server: nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Content-Type: application/problem+json
X-Powered-By: PHP/5.6.5
Cache-Control: no-cache
Access-Control-Allow-Origin: *
X-Server-ID: vm-bldr-nids-apiapp33.ncep.noaa.gov
X-Correlation-ID: d62a0ca4-013b-437e-a3c4-5e4601fe656a
X-Request-ID: d62a0ca4-013b-437e-a3c4-5e4601fe656a
Date: Sat, 15 Jul 2017 16:37:07 GMT
Content-Length: 363
Connection: keep-alive
Vary: Accept

{
    "correlationId": "d62a0ca4-013b-437e-a3c4-5e4601fe656a",
    "title": "Data Unavailable For Requested Point",
    "type": "https://api.weather.gov/problems/InvalidPoint",
    "status": 404,
    "detail": "Unable to provide data for requested point 34.2542,-110.0298",
    "instance": "https://api.weather.gov/requests/d62a0ca4-013b-437e-a3c4-5e4601fe656a"
}

Previously, they'd responded with a '500 Server Error' -- the '404 Not Found' response is one I'd not seen before.
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 jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #12 on: July 15, 2017, 12:49:04 PM »
Here's info from stuttering and a couple missing forecast icons.

We might have been on that page at the same time. I found 3 cities with the missing forecast error, but it seems to be changing on the fly.

HTH.
« Last Edit: July 15, 2017, 12:52:15 PM by jgillett »
John
W7JKG

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #13 on: July 15, 2017, 12:58:38 PM »
Was the 'stuttering' on a DualImage.php produced icon? 
Did you try a right-click/View Image to see if the image displays then?

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 jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #14 on: July 15, 2017, 01:04:40 PM »
It was not a dual image icon, just a single forecast (if that's what you mean). A single page refresh always brings the missing icon(s) back. The word "Friday", the forecast itself, and the temp were showing, but not the icon. I did a few more refreshes and got the attached for the same city (Phoenix - AZZ544).

I don't have "View image" available with a right click (Safari), but "Open image in a new tab" did open the proper image (probably acting like a refresh does for me).
« Last Edit: July 15, 2017, 01:09:13 PM by jgillett »
John
W7JKG

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #15 on: July 15, 2017, 01:18:25 PM »
Went to FF and got a failure for Tucson. My FF does not show an indicator for the missing icon so there's nothing to right click.
John
W7JKG

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #16 on: July 15, 2017, 01:57:34 PM »
You can right-click on the first text description-- that's the alt="" text for the image.  So in the first missing icon, the "Scattered Showers and Thunderstorms" is the alt text for the image and right-clickable.  The "Scattered Showers and T-Storms" is the text of the forecast (not clickable).
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 jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #17 on: July 15, 2017, 02:46:11 PM »
Thanks for that, Ken. Not seeing failures on any of my listed cities right now. However, what I do see is the day, forecast, and temp coming in and then a delay of a second or two at most before the icons show up. It's only on one or two icons at a time but not every time, the rest come in immediately.

Will keep looking.
John
W7JKG

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #18 on: July 15, 2017, 03:13:34 PM »
Do keep looking.  I'd really like to know if the failures to load are for static images or for DualImage.php generated images .. it would make a difference in further diagnosing the problem.
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 Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: advforecast2.php
« Reply #19 on: July 15, 2017, 03:21:09 PM »
Ken,

Just an FYI... my local forecasts are up and running again.

Joe
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline tshattuck

  • Forecaster
  • *****
  • Posts: 337
    • Your Local Weather - Clay, NY
Re: advforecast2.php
« Reply #20 on: July 15, 2017, 05:13:05 PM »
Ken:

FYI... my local forecasts are also up and running again with v.5.0.2.

Tom

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #21 on: July 15, 2017, 05:42:43 PM »
Have another one, Ken. This was for Casa Grande, AZZ028. Missing icon for Tonight, right click shows a Dual, all attached.
John
W7JKG

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #22 on: July 15, 2017, 07:25:05 PM »
Ok, if it is a DualImage.php generated image that's 'broken', it is usually due to a server-load limitation (too many PHP processes for an individual account) -- it usually results in the image having a 500-Server Error return, which has no image embedded.

I've run into this on my own site when I had lots of scripts on various pages that were loading images and caching them dynamically (like the good 'ol Space Weather page).  I had to switch that page to loading the image cache files directly, and using a cron job to execute the cache set of image-space-*.php scripts instead of having them in an <img src="image-space-*.php"> set.

As time has gone on, various shared-service webhosters have been cranking down the number of concurrent PHP processes allowed and the symptom on a site is randomly occurring 500 errors for PHP scripts. 

Check your access_log (and error_log) for the site and look for 500 error codes to see which scripts are involved.

Regarding the missing images, there's not a good substitute for the DualImage.php script (which is itself very low overhead, but does use the GD library for image handling), so that's one script you shouldn't replace with a cron-run cache script.  The image-*.php ones are generally good to be run via cron (and the referring  pages switched to using the .jpg/.png cached file instead).

Hope this helps...
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 jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: advforecast2.php
« Reply #23 on: July 15, 2017, 08:45:32 PM »
Thanks for the info, Ken. My access_log is almost 19 hours old right now and in spite of all the errors seen today neither log is showing any 500 errors. Interesting.
John
W7JKG

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 321
    • Indian Trail Weather
Re: advforecast2.php
« Reply #24 on: July 16, 2017, 09:55:43 PM »
Hello Ken,

I'm also experiencing NWS forecasting issues. In my NWS drop down menu I get blank pages for Hessville, NY, Pittsburgh, PA and Utica, NY. See here http://indiantrailweather.com/wxforecast.php All of the other 13 drop down locations return a forecast.

However when I go directly to the NWS forcast page I'm able to retrieve the forecasts.

Hessville, NY http://forecast.weather.gov/MapClick.php?lat=42.8786&lon=-74.6828#.WWwaRlGQyM9

http://forecast.weather.gov/MapClick.php?CityName=Hessville&state=NY&site=ALY&textField1=42.8739&textField2=-74.6875&e=0#.WWwWqlGQyM8

Pittsburgh, PA  http://forecast.weather.gov/MapClick.php?lat=40.4385&lon=-79.9973#.WWwYbVGQyM8

Utica, NY  http://forecast.weather.gov/MapClick.php?lat=43.0959&lon=-75.2426#.WWwYmlGQyM8

What should I check? Thank you.

Jeff


« Last Edit: July 16, 2017, 10:03:15 PM by Breezy »
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

 

anything