error with gauge-data-txt.tmpl

459 views
Skip to first unread message

Frank Johnson

unread,
Feb 17, 2015, 11:38:44 AM2/17/15
to weewx...@googlegroups.com
Last night i had this quite a while cleared up after rebooting...
  i have seen this off and on before do i have something just slightly wrong or was the
stars just not aligned right ha...

  Feb 16 23:15:19 frank-J10IL weewx[1824]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
   Feb 16 23:15:19 frank-J10IL weewx[1824]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/ss/gauge-data.txt.tmpl
   Feb 16 23:15:19 frank-J10IL weewx[1824]: cheetahgenerator: **** Reason: unsupported operand type(s) for /: 'int' and 'NoneType'
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****  Traceback (most recent call last):
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 289, in generate
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****      print >> _file, text
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****      rc = getattr(self, mainMethName)()
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****    File "_etc_weewx_skins_ss_gauge_data_txt_tmpl.py", line 139, in respond
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****  TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'
   Feb 16 23:16:10 frank-J10IL weewx[1824]: reportengine: ftp'd 73 files in 30.65 seconds
   Feb 16 23:21:31 frank-J10IL weewx[1824]: reportengine: ftp'd 75 files in 32.76 seconds

running ubuntu 14.04 with wmr88
Frank kf4cq

Pete Geenhuizen

unread,
Feb 17, 2015, 12:42:33 PM2/17/15
to weewx...@googlegroups.com
Frank,
I've experienced similar problems with the gauges, my error was different, but it mysteriously shows up and then disappears.  I've not rebooted but just waited it out.  It's now been running error free since around 1700 yesterday.

I'm running 2 instances under Centos 6, one is a WS23xx and the other is VantageVue.  Both installations are essentially the same and both have experienced the same errors, however the VantageVue errors persisted for 2 or more days where as the LaCross errors only lasted for a few hours.

Pete
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
Unencumbered by the thought process.  
 -- Click and Clack the Tappet brothers 

Frank Johnson

unread,
Feb 17, 2015, 12:52:41 PM2/17/15
to weewx...@googlegroups.com
  Thanks pete i saw your post but the error was different...
looks like the nature of the beast at this point...
  Frank

Pete Geenhuizen

unread,
Feb 17, 2015, 1:30:52 PM2/17/15
to weewx...@googlegroups.com
Yeah apparently it is the nature of the beast, I'm hopeful that now that it's running OK that it won't show up again.



On 02/17/15 12:52, Frank Johnson wrote:
  Thanks pete i saw your post but the error was different...
looks like the nature of the beast at this point...
  Frank


On Tuesday, February 17, 2015 at 11:38:44 AM UTC-5, Frank Johnson wrote:
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

mwall

unread,
Feb 20, 2015, 5:12:36 PM2/20/15
to weewx...@googlegroups.com
On Tuesday, February 17, 2015 at 11:38:44 AM UTC-5, Frank Johnson wrote:
Last night i had this quite a while cleared up after rebooting...
  i have seen this off and on before do i have something just slightly wrong or was the
stars just not aligned right ha...

  Feb 16 23:15:19 frank-J10IL weewx[1824]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
   Feb 16 23:15:19 frank-J10IL weewx[1824]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/ss/gauge-data.txt.tmpl
   Feb 16 23:15:19 frank-J10IL weewx[1824]: cheetahgenerator: **** Reason: unsupported operand type(s) for /: 'int' and 'NoneType'
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****  Traceback (most recent call last):
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 289, in generate
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****      print >> _file, text
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****      rc = getattr(self, mainMethName)()
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****    File "_etc_weewx_skins_ss_gauge_data_txt_tmpl.py", line 139, in respond
   Feb 16 23:15:19 frank-J10IL weewx[1824]: ****  TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'

there is a bug in the gauge-data.txt.tmpl file.  the humidex calculation will fail whenever dewpoint is None.  to fix it, change this:

#if $varExists('current.outTemp') and $current.outTemp is not None and $varExists('current.dewpoint') and $current.dewpoing is not None

to this:

#if $varExists('current.outTemp') and $current.outTemp is not None and $varExists('current.dewpoint') and $current.dewpoint is not None

or use the attached gauge-data.txt.tmpl instead.  it also contains some fixes for the solar radiation calculation.

m
gauge-data.txt.tmpl-r1278

frank

unread,
Feb 20, 2015, 10:09:45 PM2/20/15
to weewx...@googlegroups.com
On 02/20/2015 05:12 PM, mwall wrote:

Thanks m

frank
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/rDdSbzQWbFw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Pete Geenhuizen

unread,
Feb 24, 2015, 7:17:17 AM2/24/15
to weewx...@googlegroups.com
Matt,
I installed the template that you attached, and it seems to have solved my problems as well, thanks for the fix.

Pete
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Courgan2k10

unread,
May 18, 2015, 5:19:23 AM5/18/15
to weewx...@googlegroups.com, pe...@geenhuizen.net
Sry to dig out that old one but I have the same problem since a couple of days. Have done the changes mentioned above and also changed the whole gauge-data.txt.tmpl with minor success. Sometimes it works but most of the time not. I'm using weewx with the gauges. Any ideas? Thank you very much. Martin

May 18 11:15:23 localhost weewx[2558]: manager: added record 2015-05-18 11:15:00 CEST (1431940500) to database 'archive/weewx.sdb'
May 18 11:15:23 localhost weewx[2558]: manager: added record 2015-05-18 11:15:00 CEST (1431940500) to daily summary in 'archive/weewx.sdb'
May 18 11:15:32 localhost weewx[2558]: cheetahgenerator: Generated 15 files for report StandardReport in 9.40 seconds
May 18 11:15:36 localhost weewx[2558]: genimages: Generated 8 images for StandardReport in 3.35 seconds
May 18 11:15:36 localhost weewx[2558]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
May 18 11:15:36 localhost weewx[2558]: cheetahgenerator: **** Ignoring template /home/weewx/skins/ss/gauge-data.txt.tmpl
May 18 11:15:36 localhost weewx[2558]: cheetahgenerator: **** Reason: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
May 18 11:15:36 localhost weewx[2558]: ****  Traceback (most recent call last):
May 18 11:15:36 localhost weewx[2558]: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 289, in generate
May 18 11:15:36 localhost weewx[2558]: ****      print >> _file, text
May 18 11:15:36 localhost weewx[2558]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
May 18 11:15:36 localhost weewx[2558]: ****      rc = getattr(self, mainMethName)()
May 18 11:15:36 localhost weewx[2558]: ****    File "_home_weewx_skins_ss_gauge_data_txt_tmpl.py", line 190, in respond
May 18 11:15:36 localhost weewx[2558]: ****  TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
May 18 11:15:36 localhost weewx[2558]: cheetahgenerator: Generated 1 files for report SteelSeries in 0.25 seconds
May 18 11:15:40 localhost weewx[2558]: genimages: Generated 11 images for SteelSeries in 3.52 seconds

gjr80

unread,
May 18, 2015, 10:10:31 PM5/18/15
to weewx...@googlegroups.com
Hi,

The error you have is due to one or more of the operands in an equation in the template being 'None', most likely one or more of the readings from your station is 'None'. The equation concerned will involve subtraction. The modified template that Matthew posted should handle this but clearly something is getting through to cause the problem. I appreciate you said you have 'done the changes mentioned above and also changed the whole gauge-data.txt.tmpl with minor success' but these sorts of errors in templates can be very difficult to track down, to make life easier could you please post the exact template file (ie gauge-data.txt.tmpl) you are using. Also, what type of station do you have?

Gary

Courgan2k10

unread,
May 21, 2015, 1:00:53 PM5/21/15
to weewx...@googlegroups.com
Hi Gary, I'm using a TFA Nexus with TE923 station data. Attached is the gauge-data.txt.tmpl I'm currently using. Thank you very much for your help!

Martin
gauge-data.txt.tmpl

gjr80

unread,
May 24, 2015, 12:07:10 AM5/24/15
to weewx...@googlegroups.com
Hi Martin,

Sorry for the delay in replying, was away from home for the weekend and wanted to try a few things at home before replying. I suspect the problem you are having is due to the if ... else ... end if statements in gauge-data.txt.tmpl not properly picking up observations that are None. I suggest you edit gauge-data.txt.tmpl and replace all occurences of
$current.xxxxxxxx is not None

with
$current.xxxxxxxx.raw is not None

where xxxxxx is outTemp or dewpoint or outHumidity or windSpeed (lines 49, 86 and 104). You will also need to make a similar change to
$day.windSpeed is not None

at line 169. It should be
$day.windSpeed.raw is not None

Explanation. Without the .raw cheetah is checking against the string value returned by weewx for say $current.dewpoint. If the current dewpoint reading is indeed None, $current.dewpoint will return a string containing the None setting under [Units][[StringFormats]] in your skin.conf (rather than the Python None value). This setting is usually something like '   N/A' etc, certainly not None as far as Python (or cheetah) is concerned. To get the actual value returned and be able to check against it being None you need to use .raw.

There is no need to change any of the other if ... else statements that check plain ordinary Python variables (eg line 43).

Once done, save gauge-data.txt.tmpl and hopefully next report generation cycle it will generate without error. Let us know how you go.

Gary

Courgan2k10

unread,
May 27, 2015, 8:09:45 AM5/27/15
to weewx...@googlegroups.com
Hi Gary, don't worry about the delay. I'm more than happy that I have found somebody who knows what I'm talking about ;) Thank you very much for your help.

Have made the changes you mentioned but again with minor success. I receive a new error message now (see below) ;)
I have also attached the gauge-data.txt.tmpl with my changes. Maybe I've missed something.

Thx
Martin


May 27 14:05:20 localhost weewx[2558]: manager: added record 2015-05-27 14:05:00 CEST (1432728300) to database 'archive/weewx.sdb'
May 27 14:05:20 localhost weewx[2558]: manager: added record 2015-05-27 14:05:00 CEST (1432728300) to daily summary in 'archive/weewx.sdb'
May 27 14:05:30 localhost weewx[2558]: cheetahgenerator: Generated 15 files for report StandardReport in 10.15 seconds
May 27 14:05:34 localhost weewx[2558]: genimages: Generated 8 images for StandardReport in 3.38 seconds
May 27 14:05:34 localhost weewx[2558]: cheetahgenerator: Generate failed with exception '<type 'exceptions.KeyError'>'
May 27 14:05:34 localhost weewx[2558]: cheetahgenerator: **** Ignoring template /home/weewx/skins/ss/gauge-data.txt.tmpl
May 27 14:05:34 localhost weewx[2558]: cheetahgenerator: **** Reason: 'raw'
May 27 14:05:34 localhost weewx[2558]: ****  Traceback (most recent call last):
May 27 14:05:34 localhost weewx[2558]: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 289, in generate
May 27 14:05:34 localhost weewx[2558]: ****      print >> _file, text
May 27 14:05:34 localhost weewx[2558]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
May 27 14:05:34 localhost weewx[2558]: ****      rc = getattr(self, mainMethName)()
May 27 14:05:34 localhost weewx[2558]: ****    File "cheetah__home_weewx_skins_ss_gauge_data_txt_tmpl_1432726837_48_36238.py", line 247, in respond
May 27 14:05:34 localhost weewx[2558]: ****    File "/home/weewx/bin/weewx/tags.py", line 310, in __getattr__
May 27 14:05:34 localhost weewx[2558]: ****      return self._do_query(aggregate_type)
May 27 14:05:34 localhost weewx[2558]: ****    File "/home/weewx/bin/weewx/tags.py", line 324, in _do_query
May 27 14:05:34 localhost weewx[2558]: ****      val=val, **self.option_dict)
May 27 14:05:34 localhost weewx[2558]: ****    File "/home/weewx/bin/weewx/wxmanager.py", line 62, in getAggregate
May 27 14:05:34 localhost weewx[2558]: ****      return weewx.manager.DaySummaryManager.getAggregate(self, timespan, obs_type, aggregateType, **option_dict)
May 27 14:05:34 localhost weewx[2558]: ****    File "/home/weewx/bin/weewx/manager.py", line 1185, in getAggregate
May 27 14:05:34 localhost weewx[2558]: ****      _row = self.getSql(DaySummaryManager.sqlDict[aggregate_type] % interDict)
May 27 14:05:34 localhost weewx[2558]: ****  KeyError: 'raw'
May 27 14:05:34 localhost weewx[2558]: cheetahgenerator: Generated 1 files for report SteelSeries in 0.28 seconds
May 27 14:05:38 localhost weewx[2558]: genimages: Generated 11 images for SteelSeries in 3.61 seconds
gauge-data.txt.tmpl

gjr80

unread,
May 27, 2015, 9:31:44 AM5/27/15
to weewx...@googlegroups.com
Hi Martin,

Fortunately that one was relatively easy to spot - my bad - I gave you some bad instructions for line 169, it should read:

#if $varExists('day.windSpeed') and $day.windSpeed.max.raw is not None

I left out the .max - it should work now

Gary

Courgan2k10

unread,
May 31, 2015, 6:05:59 AM5/31/15
to weewx...@googlegroups.com
Hi Gary, you were absolutely right. The "max" solved the problem! Everything works fine now!

Thank you very much for your help!
Martin

Александр Игнатишин

unread,
Jan 20, 2016, 4:24:26 AM1/20/16
to weewx-user
Jan 20 12:10:20 meteo weewx[7439]: cheetahgenerator: Generate failed with exception '<type 'exceptions.OverflowError'>'
Jan 20 12:10:20 meteo weewx[7439]: cheetahgenerator: **** Ignoring template /home/weewx/skins/ss/gauge-data.txt.tmpl
Jan 20 12:10:20 meteo weewx[7439]: cheetahgenerator: **** Reason: math range error
Jan 20 12:10:20 meteo weewx[7439]: ****  Traceback (most recent call last):
Jan 20 12:10:20 meteo weewx[7439]: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 295, in generate
Jan 20 12:10:20 meteo weewx[7439]: ****      print >> _file, text
Jan 20 12:10:20 meteo weewx[7439]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Jan 20 12:10:20 meteo weewx[7439]: ****      rc = getattr(self, mainMethName)()
Jan 20 12:10:20 meteo weewx[7439]: ****    File "_home_weewx_skins_sofaskin_v1_gauge_data_txt_tmpl.py", line 142, in respond
Jan 20 12:10:20 meteo weewx[7439]: ****  OverflowError: math range error
Jan 20 12:10:22 meteo weewx[7439]: cheetahgenerator: Generated 15 files for report StandardReport in 6.06 seconds
Jan 20 12:10:23 meteo weewx[7439]: genimages: Generated 12 images for StandardReport in 1.38 seconds
Jan 20 12:11:15 meteo weewx[7439]: restx: StationRegistry: Failed to publish record 2016-01-20 12:10:00 MSK (1453281000): FAIL: execute failed: database is locked(5) at dbdimp.c line 403


Reply all
Reply to author
Forward
0 new messages