<div id="main-copy">
<div class="advisoryBoxnoactive"><!-- wxtest.php - V2.00 02-Jun-2009 BETA .009 -->
<!-- getting new file from http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ505 -->
<!-- CURL GET /alerts-beta/wwaatmget.php?x=WAZ505 HTTP/1.0 Host: www.weather.gov -->
<!-- CURL Network error: Operation timed out with 0 out of -1 bytes received -->
<!-- CURL Network error: Operation timed out with 0 out of -1 bytes received -->
<!-- Time to fetch: 24.154 sec -->
<!-- HTML fetch length = 0 ; Cache not saved. -->
<!-- headers n/a -->
There are no active watches, warnings or advisories for zone WAZ505.</div>
<p> </p>
</div><!-- end main-copy -->
But it also looks like the NWS could be having some problems, cause the original advisory isnt working either at the present time.
Advisory Information Unavailable, error reading RSS Data saved from the NOAA advisories server.
The NWS is having some problems today. This is a good opportunity for me to work on error handling.
I see a problem with what you posted because in this scenario it should not print “There are no active watches, warnings or advisories for zone WAZ505.” It should print: “Advisory Information Unavailable, error fetching data from the NOAA advisories server.”
<!-- rss-advisory-2009.php - V2.00 02-Jun-2009 BETA .011 -->
<!-- getting new file from http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ021 -->
<!-- CURL GET /alerts-beta/wwaatmget.php?x=WAZ021 HTTP/1.0 Host: www.weather.gov -->
<!-- Time to fetch: 20.689 sec -->
<!-- HTML fetch length = 52 ; Cache not saved. -->
<!-- Headers received: n/a -->
<!-- HTML received: Can't connect to MySQL server on 'mysql-cluster' (4) -->
<p>Advisory Information Unavailable, error fetching data from the <a href="http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ021">NOAA advisories server.</a></p>
<!-- Zone='WAZ021' -->
I almost have it all fixed on my development server …new beta coming soon.
fixed error handling for when the NOAA servers are having problems. Soft failures are printed in html comments as usual. (hopefully I did not break stuff for when NOAA is working again)
fixed potential problem if NOAA servers fail while fetching fullMessages, it will fall back to $fullMessagesMode off so that it can still show the summary alert message instead of an error. (assuming you still have a valid summary alert message available.) Soft failures are printed in html comments as usual.
changes to simplify graceful_error function.
Here is an example of what you get if NOAA server is having a Mysql problem:
Your visitor sees:
“Advisory Information Unavailable, error fetching or reading data from the NOAA advisories server.”
Many times when an error like this happens there is a long delay while fetching, so the error is cached for your set cache interval.
Your visitor can refresh and there is no delay.
View the source of the HTML:
<div class="advisoryBoxnoactive"><!-- advisories.php - V2.00 03-Jun-2009 BETA .011 -->
<!-- using cached version from rss-advisory-2009-WAZ021.txt - age=23 secs. Next fetch in 577 secs. -->
<!-- Warning: cache file size = 90 is too small.. XML data not found. -->
<!-- Cache file HTML contents: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 -->
<p>Advisory Information Unavailable, error fetching or reading data from the <a href="http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ021">NOAA advisories server.</a></p>
<!-- zone=WAZ021 -->
</div>
Any time you want to troubleshoot a problem, view the source of the HTML
Edit: beta 11 has a problem, stay tuned for beta 12…
Hi Mike getting this error on the newest beta:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home3/johnsto1/public_html/weather/rss-advisory-2009.php on line 326
Advisory Information Unavailable, error fetching or reading data from the NOAA advisories server.
Like right now. My page just had it again. When I refresh it goes away. Then If i go back in 5 mins, it could be there again. The NWS has been having problems since early this morning, and still are. i really think “could be wrong” that its on there end thats causing the issues were seeing.
I think it would be nice If it gave a little more detail where the adisory was. I like it now, But If you want to change it, I’d go for that too. Thanks for all the time you’ve put into this.
Well I think some may be used to the old way, then when they install the new script they will ask why it is different. Maybe I will add the feature as configurable an option.
Got a severe thunderstorm watch out for my county but it’s showing “There are no active watches, warnings or advisories for zone WVZ053.” This can be seen at http://www.harpersferry-weather.com/wxadvisory-2009.php. (use orange wide screen). The rrs-advisory-WVZ053.txt shows Jefferson County (WVZ053) with Severe Thunderstorm Watch.
The older rrs script shows the Severe Thunderstorm Watch at the top of my main page and also got the menu bar script showing the severe thunderstorm watch.
If an alert just came out, your cache file might not see it until the next refresh. you can force a refresh like this:
rss-advisory-2009.php?cache=refresh