Upgrade to 5.5 (on two machines) results in cheetah not generating the html files from the templates.

112 views
Skip to first unread message

gene...@gmail.com

unread,
Aug 8, 2026, 7:09:39 PM (3 days ago) Aug 8
to weewx-user
After updating 2 of the 5 weewx weather servers the Cheetah generator fails to create html files. Here's the log. It claims there is a syntax error and errors out all the reports

 08 17:00:15 babcock weewxd[410964]: ERROR weewx.cheetahgenerator: **** Reason: invalid syntax (<string>, line 1)
Aug 08 17:00:15 babcock weewxd[410964]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/index.html.tmpl
Aug 08 17:00:15 babcock weewxd[410964]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/index.html.tmpl failed with exception '<class 'SyntaxError'>'
Aug 08 17:00:15 babcock weewxd[410964]: INFO weewx.manager: Added record 2026-08-08 17:00:00 MDT (1786230000) to daily summary in 'weewx.sdb'
Aug 08 17:00:15 babcock weewxd[410964]: INFO weewx.manager: Added record 2026-08-08 17:00:00 MDT (1786230000) to database 'weewx.sdb'

This error sounds familiar to me but I can't find anything on it.  The template files are normal. and Cheetah makes the .png files but no html for the pages

I have removed and re-installed weewx on two machines (Pi 4 and a Pi 5) and still have issues.  What have I missed?

Tom Keffer

unread,
Aug 8, 2026, 7:22:04 PM (3 days ago) Aug 8
to weewx...@googlegroups.com
I don't know, but could you set debug=1, restart weewx, let it run through the first reporting cycle, then post the log. There just isn't enough here to make a diagnosis.

--
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.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/aed73623-7a6f-48c1-bd5a-32c44e330896n%40googlegroups.com.

gene...@gmail.com

unread,
Aug 9, 2026, 11:56:42 AM (2 days ago) Aug 9
to weewx-user
Thank you.  Sorry I'm so awkward here.  I have read many but never posted before. Here is the weewxd log from this morning.
I hope I got it tight this time.
20260809_weewxd_log

John Kline

unread,
Aug 9, 2026, 2:41:41 PM (2 days ago) Aug 9
to weewx...@googlegroups.com, weewx-user
This doesn’t look like a 5.5 problem to me. There are two separate errors in the log, and both look like unquoted format strings containing commas.

The SyntaxError comes from titlebar.inc, which isn’t the stock 5.5 file — yours has a $current.dateTime.format(format_string=%A, %B %d, %Y %H%M) with no quotes around the format.

The TypeError (“strftime() argument 1 must be str, not list”) is a config issue: a [[TimeFormats]] entry with commas and no quotes, which ConfigObj parses as a list instead of a string. That one also hits the Standard skin, so it’s separate from the skin customization.

Could you run these two and paste the output?

grep -n -A12 'TimeFormats' /etc/weewx/weewx.conf /etc/weewx/skins/*/skin.conf
grep -n 'dateTime' /etc/weewx/skins/Seasons/titlebar.inc

John

On Aug 9, 2026, at 8:56 AM, gene...@gmail.com <gene...@gmail.com> wrote:



Tom Keffer

unread,
Aug 9, 2026, 2:48:05 PM (2 days ago) Aug 9
to weewx...@googlegroups.com
No problem at all.

There are actually two different classes of errors in the log.

Syntax error

The current time is being explicitly formatted with a tag something like $current.dateTime.format(%A, %B %d, %Y %H%M). Note the lack of quotation marks around the format. It should be  $current.dateTime.format("%A, %B %d, %Y %H%M"). Here's an example in the log:

Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/statistics.html.tmpl failed with exception '<class 'SyntaxError'>'
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/statistics.html.tmpl
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: **** Reason: invalid syntax (<string>, line 1)
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 338, in generate
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_Seasons_statistics_html_tmpl.py", line 178, in respond
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1712, in _handleCheetahInclude
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_Seasons_titlebar_inc.py", line 161, in respond
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_Seasons_titlebar_inc.py", line 78, in __errorCatcher2
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      VFN(VFFSL(SL,"current.dateTime",True),"format",False)(format_string=%A, %B %d, %Y %H%M)
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****                                                                          ^
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****  SyntaxError: invalid syntax

Nowhere in the Seasons skin is the format "%A, %B %d, %Y %H%M" used, with or without the quotation marks. 

A common point between all these errors is the template include file "Seasons/titlebar.inc". I modified my version and replaced

    <p class="lastupdate">$current.dateTime</p>

with

    <p class="lastupdate">$current.dateTime.format(%A, %B %d, %Y %H%M)</p>

and got precisely the same error:

Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: Evaluation of template /home/tkeffer/weewx-data/skins/Seasons/statistics.html.tmpl failed with exception '<class 'SyntaxError'>'
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: **** Ignoring template /home/tkeffer/weewx-data/skins/Seasons/statistics.html.tmpl
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: **** Reason: invalid syntax (<string>, line 1)
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****    File "/home/tkeffer/git/weewx/src/weewx/cheetahgenerator.py", line 337, in generate
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****    File "_home_tkeffer_weewx_data_skins_Seasons_statistics_html_tmpl.py", line 178, in respond
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****    File "/home/tkeffer/git/weewx/.venv-3.13/lib/python3.13/site-packages/Cheetah/Template.py", line 1712, in _handleCheetahInclude
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****    File "_home_tkeffer_weewx_data_skins_Seasons_titlebar_inc.py", line 161, in respond
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****    File "_home_tkeffer_weewx_data_skins_Seasons_titlebar_inc.py", line 78, in __errorCatcher2
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****      VFN(VFFSL(SL,"current.dateTime",True),"format",False)(%A, %B %d, %Y %H%M)
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****                                                            ^
Aug 09 11:31:27 NUC-black weectl[1241232]: ERROR weewx.cheetahgenerator: ****  SyntaxError: invalid syntax

Is it possible that you changed "Seasons/titlebar.inc" and forgot the quotation marks?

strftime() error

The second class of errors look like this:

Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/rss.xml.tmpl failed with exception '<class 'TypeError'>'
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/rss.xml.tmpl
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: **** Reason: strftime() argument 1 must be str, not list
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 338, in generate
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_Seasons_rss_xml_tmpl.py", line 144, in respond
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 780, in filter
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      filtered = str(val)
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/units.py", line 1083, in __str__
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      return self.toString()
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****             ~~~~~~~~~~~~~^^
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/units.py", line 1076, in toString
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      s = self.formatter.toString(self.value_t, self.context, addLabel=addLabel,
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****                                  useThisFormat=useThisFormat, None_string=None_string,
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****                                  localize=localize)
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/units.py", line 734, in toString
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      s = self._to_string(val_t, context, addLabel, useThisFormat, None_string, localize)
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/units.py", line 784, in _to_string
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****      val_str = time.strftime(self.time_format_dict.get(context, DEFAULT_TIME_FORMAT),
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****                              time.localtime(t))
Aug 08 04:30:15 babcock weewxd[279844]: ERROR weewx.cheetahgenerator: ****  TypeError: strftime() argument 1 must be str, not list

WeeWX allows customization of how times are formatted. You typically do this by modifying / adding entries in weewx.conf under [[[[TimeFormats]]]]. I suspect that you modified the "current" entry by adding a comma. This would cause the parser for ConfigObj to interpret it as a list. For example,

            [[[[TimeFormats]]]]
                # day        = %H:%M
                # week       = %H:%M on %A
                # month      = %d-%b-%Y %H:%M
                # year       = %d-%b-%Y %H:%M
                # rainyear   = %d-%b-%Y %H:%M
                # current    = %d-%b-%Y %H:%M

was changed to

            [[[[TimeFormats]]]]
                # day        = %H:%M
                # week       = %H:%M on %A
                # month      = %d-%b-%Y %H:%M
                # year       = %d-%b-%Y %H:%M
                # rainyear   = %d-%b-%Y %H:%M
                current    = %d-%b-%Y, %H:%M

If you're going to do this, you should add quotation marks:

            [[[[TimeFormats]]]]
                # day        = %H:%M
                # week       = %H:%M on %A
                # month      = %d-%b-%Y %H:%M
                # year       = %d-%b-%Y %H:%M
                # rainyear   = %d-%b-%Y %H:%M
                current    = "%d-%b-%Y, %H:%M"


Added in postscript: I see that John Kline has given you essentially the same answer, except far more succinctly than my overly wordy response!

-tk

gene...@gmail.com

unread,
Aug 9, 2026, 5:16:11 PM (2 days ago) Aug 9
to weewx-user
Thank you both so much the quotes fixed it where I formatted the string with a comma. Great lesson for me.

You're awesome......
Reply all
Reply to author
Forward
0 new messages