reportengine: Caught unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator

461 views
Skip to first unread message

Rune Lægreid

unread,
Sep 25, 2016, 10:56:28 AM9/25/16
to weewx-user
I know similar errors have been reported before, but I am not able to sort out the issue causing this error message:

Sep 24 12:41:44 WeatherPi weewx[12234]: reportengine: Caught unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator
Sep 24 12:41:44 WeatherPi weewx[12234]: **** unsupported operand type(s) for +=: 'float' and 'NoneType'
Sep 24 12:41:44 WeatherPi weewx[12234]: **** Traceback (most recent call last):
Sep 24 12:41:44 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/reportengine.py", line 140, in run
Sep 24 12:41:44 WeatherPi weewx[12234]: **** obj.start()
Sep 24 12:41:44 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/reportengine.py", line 170, in start
Sep 24 12:41:44 WeatherPi weewx[12234]: **** self.run()
Sep 24 12:41:44 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 143, in run
Sep 24 12:41:44 WeatherPi weewx[12234]: **** ngen = self.generate(gen_dict[option_section_name], self.gen_ts)
Sep 24 12:41:45 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 206, in generate
Sep 24 12:41:45 WeatherPi weewx[12234]: **** ngen += self.generate(section[subsection], gen_ts)
Sep 24 12:41:45 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 206, in generate
Sep 24 12:41:45 WeatherPi weewx[12234]: **** ngen += self.generate(section[subsection], gen_ts)
Sep 24 12:41:45 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 290, in generate
Sep 24 12:41:45 WeatherPi weewx[12234]: **** default_binding)
Sep 24 12:41:45 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 332, in _getSearchList
Sep 24 12:41:45 WeatherPi weewx[12234]: **** searchList += obj.get_extension_list(timespan, db_lookup)
Sep 24 12:41:45 WeatherPi weewx[12234]: **** File "/home/weewx/bin/user/wdSearchX3.py", line 456, in get_extension_list
Sep 24 12:41:45 WeatherPi weewx[12234]: **** monthRainAvg_vh, monthRainAvgNow_vh, monthTempAvg_vh, monthTempAvgNow_vh, monthRainMax_vh, monthTempMax_vh, monthTempMin_vh, yearmaxmonthrain_vh, ymaxrainmonth, ymaxrainyear, monthRainMax_ts = self.getMonthAveragesHighs(timespan, db_lookup)
Sep 24 12:41:45 WeatherPi weewx[12234]: **** File "/home/weewx/bin/user/wdSearchX3.py", line 339, in getMonthAveragesHighs
Sep 24 12:41:45 WeatherPi weewx[12234]: **** monthRainBin[_month_bin][0] += monthRain_tuple[0]
Sep 24 12:41:45 WeatherPi weewx[12234]: **** TypeError: unsupported operand type(s) for +=: 'float' and 'NoneType'
Sep 24 12:41:45 WeatherPi weewx[12234]: **** Generator terminated...
Sep 24 12:41:47 WeatherPi weewx[12234]: cheetahgenerator: Generated 1 files for report wdPWS in 1.84 seconds
Sep 24 12:41:48 WeatherPi weewx[12234]: reportengine: Caught unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator
Sep 24 12:41:48 WeatherPi weewx[12234]: **** unsupported operand type(s) for +=: 'float' and 'NoneType'
Sep 24 12:41:48 WeatherPi weewx[12234]: **** Traceback (most recent call last):
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/reportengine.py", line 140, in run
Sep 24 12:41:48 WeatherPi weewx[12234]: **** obj.start()
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/reportengine.py", line 170, in start
Sep 24 12:41:48 WeatherPi weewx[12234]: **** self.run()
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 143, in run
Sep 24 12:41:48 WeatherPi weewx[12234]: **** ngen = self.generate(gen_dict[option_section_name], self.gen_ts)
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 206, in generate
Sep 24 12:41:48 WeatherPi weewx[12234]: **** ngen += self.generate(section[subsection], gen_ts)
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 206, in generate
Sep 24 12:41:48 WeatherPi weewx[12234]: **** ngen += self.generate(section[subsection], gen_ts)
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 290, in generate
Sep 24 12:41:48 WeatherPi weewx[12234]: **** default_binding)
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 332, in _getSearchList
Sep 24 12:41:48 WeatherPi weewx[12234]: **** searchList += obj.get_extension_list(timespan, db_lookup)
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/user/wdSearchX3.py", line 456, in get_extension_list
Sep 24 12:41:48 WeatherPi weewx[12234]: **** monthRainAvg_vh, monthRainAvgNow_vh, monthTempAvg_vh, monthTempAvgNow_vh, monthRainMax_vh, monthTempMax_vh, monthTempMin_vh, yearmaxmonthrain_vh, ymaxrainmonth, ymaxrainyear, monthRainMax_ts = self.getMonthAveragesHighs(timespan, db_lookup)
Sep 24 12:41:48 WeatherPi weewx[12234]: **** File "/home/weewx/bin/user/wdSearchX3.py", line 339, in getMonthAveragesHighs
Sep 24 12:41:48 WeatherPi weewx[12234]: **** monthRainBin[_month_bin][0] += monthRain_tuple[0]
Sep 24 12:41:48 WeatherPi weewx[12234]: **** TypeError: unsupported operand type(s) for +=: 'float' and 'NoneType'
Sep 24 12:41:48 WeatherPi weewx[12234]: **** Generator terminated...
Sep 24 12:41:49 WeatherPi weewx[12234]: imageStackedWindRose: Generated 1 images for wdStackedWindRose in 1.16 seconds
Sep 24 12:41:53 WeatherPi weewx[12234]: cheetahgenerator: Generated 1 files for report wdSteelGauges in 3.48 seconds
Sep 24 12:41:53 WeatherPi weewx[12234]: reportengine: copied 6 files to /home/weewx/public_html/ss
Sep 24 12:42:00 WeatherPi weewx[12234]: cheetahgenerator: Generated 2 files for report SteelSeries in 6.23 seconds

Rune.

gjr80

unread,
Sep 25, 2016, 6:50:46 PM9/25/16
to weewx-user
Hi,

You are correct, the issue has come up a couple of times before. The code on bitbucket has been fixed for sometime but I have not packaged up the patched file. My bad, will make a point of doing that today. The easiest fix for you is to follow the instructions here.

Gary

gjr80

unread,
Sep 25, 2016, 7:28:56 PM9/25/16
to weewx-user
My apologies but I discovered another bug in the code. It will only affect you if you have a complete months gap in your data so its unlikey to impact many folks. The fix is the same as the link I posted earlier but you need to get wdSearchX3.py as follows:


Gary

Rune Lægreid

unread,
Sep 30, 2016, 4:01:43 AM9/30/16
to weewx-user
Gary,

That fixed this issue, but the logs indicates another issue with the new wdSearchX3.py (I am, by the way one of the few with complete months gap in my data):

Sep 30 09:53:05 WeatherPi weewx[27820]: cheetahgenerator: **** Reason: math range error
Sep 30 09:53:05 WeatherPi weewx[27820]: **** Traceback (most recent call last):
Sep 30 09:53:05 WeatherPi weewx[27820]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 300, in generate
Sep 30 09:53:05 WeatherPi weewx[27820]: **** print >> _file, text
Sep 30 09:53:05 WeatherPi weewx[27820]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Sep 30 09:53:05 WeatherPi weewx[27820]: **** rc = getattr(self, mainMethName)()
Sep 30 09:53:05 WeatherPi weewx[27820]: **** File "_home_weewx_skins_ss_gauge_data_txt_tmpl.py", line 142, in respond
Sep 30 09:53:05 WeatherPi weewx[27820]: **** OverflowError: math range error
Sep 30 09:53:05 WeatherPi weewx[27820]: cheetahgenerator: Generated 1 files for report SteelSeries in 6.27 seconds

gjr80

unread,
Sep 30, 2016, 9:47:17 AM9/30/16
to weewx-user
Rune,

The log extract below seems to indicate there is an issue with the gauge-data.txt.tmpl template which is part of the ss skin provided with the SteelSeries gauges v2.5.0 or later. gauge-data.txt (generated from gauge-data.txt.tmpl) was developed as the weewx standard data file used to feed the SteelSeries gauges when SteelSeries v.2.5.0 was reelased with native weewx support. Previously the only way to use the SteelSeries gauges with weewx was to mimic one of the other data files that the SteelSeries gauges accepts. This is what weewx-wd does, it produces the WeatherDisplay file customclientraw.txt via the SteelSeries skin. The upshot of it all is that wdSearchX3.py is only used by the weewx-wd skins, in this case the error is coming from a non-weewx-wd skin so the issue is not to do with wdSearchX3.py.

Are you using the current gauge-data.txt.tmpl from the SteelSeries github site? I ask as the early versions had a few issues that under certain circumstances caused an error. I thought the current version had picked up all those issues, but maybe not. Once you confirm you are in fact using the lastest gauge-data.txt.tmpl I will have another look at the template and see if I can pickup where the issue is. If it turns out you ar enot using the lastest version I strongly suggest you update to the latest version. These sorts of errors from Cheetah are notoriously hard to track down, unlike the previous error which gave a line number in wdSerarchX3.py, this error gives a line number in a temporay file that we cannot access.

Gary

Rune Lægreid

unread,
Oct 3, 2016, 7:38:02 AM10/3/16
to weewx-user
Hi,
I am using the gauge-data.txt.tmpl from the SteelSeries github site. To be 100% certain I re- downloaded the file, but the issue is still there.
It does not seem to create any problems, but it is kind of annoying seeing it in the log.

Rune.

gjr80

unread,
Oct 3, 2016, 9:35:58 AM10/3/16
to weewx-user
Hi Rune,

Ok, think I have spotted the issue. I mentioned that earlier versions of the gauge-data.txt template had a few issues; one of these issues was an error in the humidex formula that resulted in the same error as you have experienced when dewpoint approached 0 (C or F depending on your units in use). As dewpoint moved away from 0 the template would starting being produced again without error. I note from looking at your site your dewpoint has been around 0 at times today. I did submit a patch to the owner of the SteelSeries-Weather-Gauges GitHub repo sometime ago, which he did accept, but looking at the repo again just now it looks as if he reverted the change shortly after. I will take that up with him again.

In the meantime if you are up to editing gauge-data.txt.tmpl try replacing the following lines in gauge-data.txt.tmpl (circa lines 57-59):

#set $dp = $current.dewpoint.raw
#if $oT_C is not None and $dp is not None
#set $e = 6.11 * math.exp(5417.7530 * ((1/273.16) - 1/$dp))

with these:

#set $dp_K = $current.dewpoint.degree_C.raw + 273.15
#set $e = 6.11 * math.exp(5417.7530 * ((1/273.16) - 1/$dp_K))

and delete lines 69-71 inclusive:

#else
#set $humidex = 'N/A'
#end if

No need to restart, on the next report cycle the template should now generate without error, particularly when dewpoint is near 0. Let us know if that fixes it.

Gary

Rune Lægreid

unread,
Oct 4, 2016, 8:40:53 AM10/4/16
to weewx-user
Thanks - it works and no errors in the log :-)
Reply all
Reply to author
Forward
0 new messages