cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'

208 views
Skip to first unread message

Cat22

unread,
Sep 11, 2019, 6:24:18 AM9/11/19
to weewx-user
I'm running weewx 3.9.2 and using the steel series gauges and a Vantage Pro II weather station.
I have cycled power to the datalogger and rebooted the pc but to no avail.
Any ideas?

Here is an excerpt from the systemd log:

Sep 11 03:10:15 erb2 weewx[15222]: manager: Added record 2019-09-11 03:10:00 PDT (1568196600) to database 'weewx.sdb'
Sep 11 03:10:15 erb2 weewx[15222]: manager: Added record 2019-09-11 03:10:00 PDT (1568196600) to daily summary in 'weewx.sdb'
Sep 11 03:10:15 erb2 weewx[15222]: copygenerator: copied 7 files to /usr/local/bin/weewx/public_html
Sep 11 03:10:16 erb2 weewx[15222]: restx: Wunderground-PWS: Published record 2019-09-11 03:10:00 PDT (1568196600)
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: **** Ignoring template /usr/local/bin/weewx/skins/ss/gauge-data.txt.tmpl
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: **** Reason: unsupported operand type(s) for -: 'float' and 'NoneType'
Sep 11 03:10:16 erb2 weewx[15222]: ****  Traceback (most recent call last):
Sep 11 03:10:16 erb2 weewx[15222]: ****    File "/usr/local/bin/weewx/bin/weewx/cheetahgenerator.py", line 332, in generate
Sep 11 03:10:16 erb2 weewx[15222]: ****      fd.write(str(compiled_template))
Sep 11 03:10:16 erb2 weewx[15222]: ****    File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1005, in __str__
Sep 11 03:10:16 erb2 weewx[15222]: ****      rc = getattr(self, mainMethName)()
Sep 11 03:10:16 erb2 weewx[15222]: ****    File "_usr_local_bin_weewx_skins_ss_gauge_data_txt_tmpl.py", line 190, in respond
Sep 11 03:10:16 erb2 weewx[15222]: ****  TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: Generated 1 files for report StandardReport in 0.35 seconds
Sep 11 03:10:16 erb2 weewx[15222]: restx: CWOP: Published record 2019-09-11 03:10:00 PDT (1568196600)
Sep 11 03:10:16 erb2 weewx[15222]: imagegenerator: Generated 11 images for StandardReport in 0.30 seconds
Sep 11 03:10:16 erb2 weewx[15222]: copygenerator: copied 7 files to /usr/local/bin/weewx/public_html/ss
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: **** Ignoring template /usr/local/bin/weewx/skins/ss/gauge-data.txt.tmpl
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: **** Reason: unsupported operand type(s) for -: 'float' and 'NoneType'
Sep 11 03:10:16 erb2 weewx[15222]: ****  Traceback (most recent call last):
Sep 11 03:10:16 erb2 weewx[15222]: ****    File "/usr/local/bin/weewx/bin/weewx/cheetahgenerator.py", line 332, in generate
Sep 11 03:10:16 erb2 weewx[15222]: ****      fd.write(str(compiled_template))
Sep 11 03:10:16 erb2 weewx[15222]: ****    File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1005, in __str__
Sep 11 03:10:16 erb2 weewx[15222]: ****      rc = getattr(self, mainMethName)()
Sep 11 03:10:16 erb2 weewx[15222]: ****    File "_usr_local_bin_weewx_skins_ss_gauge_data_txt_tmpl.py", line 190, in respond
Sep 11 03:10:16 erb2 weewx[15222]: ****  TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
Sep 11 03:10:16 erb2 weewx[15222]: cheetahgenerator: Generated 1 files for report SteelSeries in 0.18 seconds
Sep 11 03:10:17 erb2 weewx[15222]: imagegenerator: Generated 11 images for SteelSeries in 0.26 seconds

gjr80

unread,
Sep 11, 2019, 6:37:38 PM9/11/19
to weewx-user
Hi,

These sorts of template/Cheetah errors can be difficult to pinpoint and time consuming to track down. That being said the error message gives us a couple of clues. The error message indicates there is a an expression somewhere in the gauge-data.txt.tmpl that is trying to calculate the difference between a floating point number and the python value None. The None value is likely the result of a 'missing' observation value, most likely windSpeed or dewpoint. The puzzling part is that the gauge-data.txt.tmpl template has been hardened over a number of iterations and the current version should be immune to such errors.

Could you confirm which version of gauge-data.txt.tmpl you are using; either provide a link to the file/extension you are using or post the actual gauge-data.txt.tmpl from you system. Also is your site internet accessible? A link would help in determining which observation is returning the None value.

Gary

Cat22

unread,
Sep 14, 2019, 3:50:12 AM9/14/19
to weewx-user
I had meant to get back here yesterday but had pressing business.
I figured out this was due to a bad humidity sensor in my Vantage Pro 2.
I have a new one ordered from Davis
I can track humidity and see it goes to Zero for hours at a time then rises again to normal levels

gjr80

unread,
Sep 14, 2019, 4:33:00 AM9/14/19
to weewx-user
Interesting, because humidity going to zero does not fit the error. Even humidity going to None should not cause the cheetah error you are seeing (provided you are using the latest version of the template). Will be interesting to see how things go when you replace the sensor.

Gary

Cat22

unread,
Sep 14, 2019, 6:12:17 PM9/14/19
to weewx-user
Once I replace the sensor i will post back here and let you know how its working out.
The file gauges-ss.css shows:
/* CSS for SteelSeries Gauges
 * Mark Crossley
 * v2.5.0 - 03 Dec 2014
*/
Is that the steel series version?

gjr80

unread,
Sep 14, 2019, 6:52:42 PM9/14/19
to weewx-user
That is the CSS file, we are interested in gauge-data.txt.tmpl, this link is to the current version https://raw.githubusercontent.com/mcrossley/SteelSeries-Weather-Gauges/master/weather_server/WeeWX/gauge-data.txt.tmpl

Gary

Cat22

unread,
Sep 17, 2019, 1:04:35 AM9/17/19
to weewx-user
Well i seem to have an older copy, are there any relevant changes?

## template for json data to feed the steel series gauges
## $Id: gauge-data.txt.tmpl 1279 2015-03-01 15:49:03Z mwall $
## by Matthew Wall on flight 868 ;)
## 31dec2014
## Updated 25jan2015 by M Crossley, changed cloudbase: to cloudbasevalue:

## definitions for the tags can be found here:
## http://wiki.sandaysoft.com/a/Webtags
##
## the following fields are not directly available from weewx:
##
## ver:10?
## apptemp - calculated in this template
## apptempTL
## apptempTH
## TapptempTL
## TapptempTH
## humidex - calculated in this template
## forecast - calculated by forecasting module
## LastRainTipISO
## Tbeaufort - calculated by this template
## BearingRangeFrom10 - lowest clockwise bearing in last 10 minutes
## BearingRangeTo10 - highest clockwise bearing in last 10 minutes
## CurrentSolarMax - calculated in this template
## WindRoseData
## windrun - calculated in this template
##
## ver:12
## cloudbasevalue - calculated in this template in feet
## cloudbaseunit - defined in this template as ft

gjr80

unread,
Sep 17, 2019, 2:55:57 AM9/17/19
to weewx-user
On Tuesday, 17 September 2019 15:04:35 UTC+10, Cat22 wrote:
Well i seem to have an older copy, are there any relevant changes?


Heaps :) , the most significant being a number of changes to harden the template so it can handle obs that are None. I would be updating to the latest version. There is a SteelSeries WeeWX extension available through the WeeWX Wiki (scroll down to Extensions to WeeWX, Skins) that you can use to automate most of the installation or you can manually install the latest SteelSeries Gauges by following the instructions in the WeeWX readme.txt in the SteelSeries Weather Gauges GitHub repo.

Gary


Cat22

unread,
Sep 17, 2019, 7:19:15 AM9/17/19
to weewx-user
I've let it run nearly 5 hours now after updating the gauge-data.txt.tmpl and no errors.
Still have a bad humidity sensor but that should be arriving any day now.
I'll look at upgrading like you posted.
Thanks for the help!

Cat22

unread,
Sep 17, 2019, 9:48:50 AM9/17/19
to weewx-user
 I updated the files for steelseries gauges after downloading them from git release, (BTW the link to github on the weewx extensions page is broken or outdated, it 404's) and restarted weewx, i dont see any errors reported but it stopped creating index.php. I then restored the old files and index.php is now being created again. Something is amiss in the new files. I did not use the weewx installer just unpacked the tar in /tmp and then used cp -a to copy the dirs  skins to skins in my weewx installation.

gjr80

unread,
Sep 17, 2019, 11:58:12 PM9/17/19
to weewx-user
On Tuesday, 17 September 2019 23:48:50 UTC+10, Cat22 wrote:
BTW the link to github on the weewx extensions page is broken or outdated, it 404's

Interesting, the link worked yesterday arvo when I made the 2.7.4 extension available and I just checked again now and the wiki link works as do all of the subsequent page links. Could you please detail exactly which link is dead?
 
i dont see any errors reported but it stopped creating index.php. I then restored the old files and index.php is now being created again. Something is amiss in the new files. I did not use the weewx installer just unpacked the tar in /tmp and then used cp -a to copy the dirs  skins to skins in my weewx installation.

You mention index.php but the WeeWX Steelseries Weather Gauges produces index.html not index.php, I presume you meant index.html? Either way if a template is not being processed correctly there should be some indication in the log. With the problem install could you set debug = 1 in weewx.conf, save weewx.conf then restart WeeWX. Let WeeWX run for at least three archive periods then post an unedited extract of the log from when WeeWX was restarted through until the three archive periods have elapsed.

I am also getting a little confused about what you actually installed. You say the link was broken so which repo did you go to and what .tar.gz did you use, steelseries-2.7.4.tar.gz ?

Gary

Cat22

unread,
Sep 18, 2019, 3:12:15 AM9/18/19
to weewx-user
I went back and tried it again, the links work, so it must have been a temporary thing - anyway the sensor arrvied today but it was pouring rain all day, when the weather clears i'll install it and then we can see whats up

Cat22

unread,
Sep 23, 2019, 10:25:59 AM9/23/19
to weewx-user
I got the new sensor installed. Its been over 12 hours and so far no errors in weewx and the humidity is showing a  very reasonable value for the whole 12 hours.
It fluctuates a small amount as expected but holds very near our areas humidity according to Accuweather. I'll keep watching it but i think this is solved.
Reply all
Reply to author
Forward
0 new messages