Author Topic: Hanis Radar errors  (Read 705 times)

0 Members and 1 Guest are viewing this topic.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Hanis Radar errors
« on: August 14, 2018, 11:08:40 AM »
Over the past 2 days, I've been getting the following error on my Hanis Radar page.  It's been happening from multiple machines.  If I refresh the page, it comes up without errors.  So I'm guessing it may be a timing thing?  Anyone else seeing this?

Notice: Undefined offset: 1 in /home/bismarckweather/public_html/radar-status-getradar.php on line 158

Notice: Undefined offset: 1 in /home/bismarckweather/public_html/radar-status-getradar.php on line 164

http://www.bismarckweather.net/wxusradars-hanis3.php
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Hanis Radar errors
« Reply #1 on: August 14, 2018, 01:36:21 PM »
I see what you mean.

When I right click on the page and 'View page source' the problem only occurs when the script, 'radar-status-getradar.php' tries to read in a new file to cache.  Here are the relevant debugging messages when all is well:
Code: [Select]
<div class="center" align="center" style="width:620px">
<!-- radar-status-getradar.php Version 5b - 26-Feb-2017 -->
<!-- using Cached version of ./cache/radar-status-KBIS.txt -->
<!-- 203 records found -->
<!--
UTCdate    =1534264562 (2018-08-14 04:36:02)
lastUTCdate=1534264519 (2018-08-14 04:35:19)
 -->
<!-- NEXRAD Radar KBIS status: Active [last data 43 secs ago] as of Tue, 14-Aug-2018 11:36am CDT -->
On the other hand, here are the debugging messages when the script displays abnormally:
Code: [Select]
<div class="center" align="center" style="width:620px">
<!-- radar-status-getradar.php Version 5b - 26-Feb-2017 -->
<!-- loading ./cache/radar-status-KBIS.txt from http://radar3pub.ncep.noaa.gov/rcvxmit.sites.public.html -->
<!-- curl fetching 'http://radar3pub.ncep.noaa.gov/rcvxmit.sites.public.html' -->
<!-- curl Error: Resolving timed out after 6001 milliseconds -->
<!-- HTTP stats:  RC=0 dest= port=0 (from sce=)
      Times: dns=0.000 conn=0.000 pxfer=0.000 get=6.001 total=6.001 secs -->
<!-- headers returned:

 -->
<br />
<b>Notice</b>:  Undefined offset: 1 in <b>/home/bismarckweather/public_html/radar-status-getradar.php</b> on line <b>158</b><br />
<!-- appending ./cache/radar-status-KBIS.txt from http://radar3pub.ncep.noaa.gov/ftm.txt -->
<!-- curl fetching 'http://radar3pub.ncep.noaa.gov/ftm.txt' -->
<!-- HTTP stats:  RC=200 dest=140.172.138.16 port=80 (from sce=107.180.109.46)
      Times: dns=0.001 conn=0.053 pxfer=0.054 get=0.109 total=0.163 secs -->
<!-- problem fetching main/txtmsg file(s) -->
<!-- main  content length=0, headers

-->
<!-- txtmsg content length=17549, headers
HTTP/1.1 200 OK
Date: Tue, 14 Aug 2018 16:55:54 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Last-Modified: Tue, 14 Aug 2018 16:54:03 GMT
ETag: "4fd0062-448d-573680eaa9a3f"
Accept-Ranges: bytes
Content-Length: 17549
Vary: Accept-Encoding
Content-Type: text/plain; charset=UTF-8
-->
<!-- cache not saved to ./cache/radar-status-KBIS.txt. -->
<!-- unable to process radar-status.. insufficient data -->

It looks like maybe the 'curl' functions aren't waiting long enough for a return.  Try setting the timeout in 'radar-status-getradar.php' here
Code: [Select]
function RS_fetchUrlWithoutHanging($url,$useFopen) {
// get contents from one URL and return as string
  global $Debug, $needCookie;
 
  $overall_start = time();
  if (! $useFopen) {
   // Set maximum number of seconds (can have floating-point) to wait for feed before displaying page without feed
   $numberOfSeconds=6;   

// Thanks to Curly from ricksturf.com for the cURL fetch functions
to something greater, such as
Code: [Select]
function RS_fetchUrlWithoutHanging($url,$useFopen) {
// get contents from one URL and return as string
  global $Debug, $needCookie;
 
  $overall_start = time();
  if (! $useFopen) {
   // Set maximum number of seconds (can have floating-point) to wait for feed before displaying page without feed
   $numberOfSeconds=15;   

// Thanks to Curly from ricksturf.com for the cURL fetch functions

Hope this helps...
Regards, Jerry Wilkins
gwwilk@gmail.com

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Hanis Radar errors
« Reply #2 on: August 14, 2018, 03:05:30 PM »
Or.. get your webhoster to fix the DNS resolution issue.  DNS queries via PHP should take <2 seconds (even with failover in DNS).

Something is wrong with the DNS used by your webserver (upstream DNS resolvers are listed in /etc/resolv.conf as nameserver entries).

Ask the tech support to log on your webserver and do
Code: [Select]
dig radar3pub.ncep.noaa.gov and that should show them the issue.
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 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Hanis Radar errors
« Reply #3 on: August 14, 2018, 03:55:41 PM »
I did add in the timeout up to 30 seconds.  I still get the line 158 error.

Oh man, that means calling GoDaddy tech support.  They aren't the speediest, or brightest sometimes.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Hanis Radar errors
« Reply #4 on: August 14, 2018, 04:24:07 PM »
I was able to enable SSH.  But I get a "command not found" error when I do a dig from a Putty window.  Is that something they are blocking perhaps?
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Hanis Radar errors
« Reply #5 on: August 14, 2018, 04:27:56 PM »
Actually, I noticed in cpanel, a Track DNS program.  I think that has what you're asking.

Code: [Select]
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6_9.5 <<>> radar3pub.ncep.noaa.gov
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50831
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;radar3pub.ncep.noaa.gov. IN A

;; ANSWER SECTION:
radar3pub.ncep.noaa.gov. 110 IN CNAME radar3pub.bldr.ncep.noaa.gov.
radar3pub.bldr.ncep.noaa.gov. 831 IN CNAME novarbal.bldr.ncep.noaa.gov.
novarbal.bldr.ncep.noaa.gov. 839 IN A 140.172.138.16

;; Query time: 2 msec
;; SERVER: 10.255.250.30#53(10.255.250.30)
;; WHEN: Tue Aug 14 13:25:50 2018
;; MSG SIZE  rcvd: 109
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Hanis Radar errors
« Reply #6 on: August 15, 2018, 12:06:32 AM »
Runs in 2 msec via cPanel.  I suspect the cPanel server may not be the same server as your webserver, since it works, and your PHP on the webserver fails to return an IP address and times-out.  I just logged in via SSH to my GoDaddy shared server site, and both 'nslookup' and 'dig' commands were not present for mere mortals such as us.  Typical.  When they login with admin logins, they likely have those tools available.

I still suggest calling the tech support and have them SSH to your webserver and try the dig command themselves.
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 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Hanis Radar errors
« Reply #7 on: August 16, 2018, 04:34:50 PM »
Errors quit now.  And pages are loading faster than before.  I'll be out of town for a week, so I'll just keep an eye on it until I get back.  Thanks for your assistance.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI