Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Divide by zero WU-forecast.php

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Divide by zero WU-forecast.php

Post by gluepack »

This happened a short time ago and refreshing it didn't clear it, initially. I refreshed a couple of minutes later and it was ok though.

Hopefully, it is a one-off but I wouldn't want end-users to have the error message show up even though the display didn't look too bad apart from the error message above the dashboard and the lack of the two forecast periods below it.

It was line 764 in WU-forecast.php, in case anyone is anxious to solve the problem ;)
$wdth = intval(100/count($WUforecasticons));
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Divide by zero WU-forecast.php

Post by saratogaWX »

It is likely that the error was caused by your webserver not getting a good response from weatherunderground.com when the cache was being refreshed so there was no page to parse at that time.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Divide by zero WU-forecast.php

Post by BCJKiwi »

I too have had that problem on occasion and found that the WU-forecast-0-en.txt file (your file may vary depending on your language) in the cache folder where they are placed, is 0 bytes or some other small number where it is usually around 250,000 to 300,00 bytes in size. Just delete the undersized file and refresh the webpage and all should be OK.
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Divide by zero WU-forecast.php

Post by gluepack »

This has started again...
Division by zero in /home/jerbi780/public_html/saratoga/WU-forecast.php on line 612
$wdth = intval(100/count($WUforecasticons));

I had a power outage (several) last night, during thunderstorms.
What I didn't realise was that the system (that Cumulus runs on) had failed to start. It went through a requested recovery process and then didn't automatically restart. I did a manual restart and Windows and Cumulus came up fine. There were 14 hours of backlog data by then and Cumulus started processing it. It seemed a lot slower than usual to read the cache, I thought, and Catch up never seemed to finish (until, of course, I was just about to post about that), it took an hour, which I thought was excessive but never mind.

Now (well, before the system recovery process), I'm getting that division by zero message. The WU-forecast-json-0-en.txt is being refreshed and is greater than 12k characters. (Even when it doesn't appear, I get no outlook or forecast.)

Any ideas?
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Divide by zero WU-forecast.php

Post by saratogaWX »

The 'Divide by zero' error is just a symptom of not being able to get a valid JSON response from WeatherUnderground.com

Yesterday, WeatherUnderground had a major failure in the website -- it was returning a default CentOS Apache page (like from a newly provisioned web server) and responding with 404-Not Found for many requests (including the ones for JSON).

The site (and yours) seem to be working fine today -- I guess they fixed the problem with WU website.
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Divide by zero WU-forecast.php

Post by gluepack »

Yes it is working now. What a coincidence, lol!
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
Post Reply