Daveiano / weewx-wdc

Weather Data Center skin for WeeWX
https://www.weewx-hbt.de/
GNU General Public License v3.0
48 stars 14 forks source link

[BUG] Reason: '<' not supported between instances of 'NoneType' and 'float' in the skins/weewx-wdc/year-%Y.html.tmpl file #256

Closed cbirkenbeul closed 6 months ago

cbirkenbeul commented 8 months ago

Hello, I've upgraded to weewx 5.0.2 and your skin to 3.5 and got a lot of issues. Most I could fix by myself because of the whew 5 upgrade.

But this issue I got and cannot solve by myself:

2024-02-27T10:05:36.003514+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/year-%Y.html.tmpl failed with exception '<class 'TypeError'>'
2024-02-27T10:05:36.003788+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/year-%Y.html.tmpl
2024-02-27T10:05:36.003952+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: **** Reason: '<' not supported between instances of 'NoneType' and 'float'
2024-02-27T10:05:36.005540+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
2024-02-27T10:05:36.005700+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
2024-02-27T10:05:36.005843+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
2024-02-27T10:05:36.005982+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27T10:05:36.006115+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_year__Y_html_tmpl.py", line 203, in respond
2024-02-27T10:05:36.006256+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
2024-02-27T10:05:36.006389+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
2024-02-27T10:05:36.006520+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_climatological_days_inc.py", line 861, in respond
2024-02-27T10:05:36.006650+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
2024-02-27T10:05:36.006772+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
2024-02-27T10:05:36.006895+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 403, in respond
2024-02-27T10:05:36.007017+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 144, in __errorCatcher11
2024-02-27T10:05:36.007140+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
2024-02-27T10:05:36.007272+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'NoneType' and 'float'
2024-02-27T10:05:49.659314+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/statistics.html.tmpl failed with exception '<class 'TypeError'>'
2024-02-27T10:05:49.659790+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/statistics.html.tmpl
2024-02-27T10:05:49.659942+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: **** Reason: '<' not supported between instances of 'NoneType' and 'float'
2024-02-27T10:05:49.661522+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
2024-02-27T10:05:49.661680+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
2024-02-27T10:05:49.661819+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
2024-02-27T10:05:49.661958+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27T10:05:49.662091+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_statistics_html_tmpl.py", line 250, in respond
2024-02-27T10:05:49.662226+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
2024-02-27T10:05:49.662356+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
2024-02-27T10:05:49.662484+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_climatological_days_inc.py", line 861, in respond
2024-02-27T10:05:49.662617+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
2024-02-27T10:05:49.662740+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
2024-02-27T10:05:49.662879+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 403, in respond
2024-02-27T10:05:49.663000+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 144, in __errorCatcher11
2024-02-27T10:05:49.663122+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
2024-02-27T10:05:49.663247+01:00 weewx weewxd[69217]: ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'NoneType' and 'float'

There were a fixed issue with the same template file that was solved for 3.5, but I got a different error. The message seems that it could be a skin issue. Otherwise I would ask in the google groups.

Thanks.

hoetzgit commented 8 months ago

Hello, a similar error in my case, WeeWX 4.10.2:

Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/weewx-wdc/statistics.html.tmpl
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: **** Reason: '<' not supported between instances of 'NoneType' and 'NoneType'
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 348, in generate
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_weewx_wdc_statistics_html_tmpl.py", line 250, in respond
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "/usr/local/lib/python3.10/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_weewx_wdc_includes_climatological_days_inc.py", line 861, in respond
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "/usr/local/lib/python3.10/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 403, in respond
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 144, in __errorCatcher11
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Feb 27 16:11:26 weewx weewx[114473] ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'

Henry

Daveiano commented 8 months ago

I can't spot any issue and I can't even reproduce this error.

Did you guys make any changes to the provided skin.conf of the skin?

There were a fixed issue with the same template file that was solved for 3.5

@cbirkenbeul What issue do you mean? The template which causes the error skins/weewx-wdc/includes/stat-table.inc was added in 3.5.0.

Please try to disable the new added Stat tables via skin.conf:

[DisplayOptions]
    ...
    # For instructions, see https://github.com/Daveiano/weewx-wdc/wiki/Configuration#stat_tables
    #[[stat_tables]]
    #    [[[tables_outtemp]]]
    #        observation = "outTemp"
    #        label = "Temperature Stat Table"
    #        aggregate_types = "avg"
    #    [[[tables_rain]]]
    #        observation = "rain"
    #        label = "Rain Stat Table"
    #        aggregate_types = "sum", "avg"

This should stop the error and generate the templates.

cbirkenbeul commented 8 months ago

Hey, thanks for your reply. I've made a complete new installation, because I messed up with the 4 to 5 upgrade.

With disabling the stat_table fields all reports are now generated fine.

Daveiano commented 8 months ago

Ok but something is going on here. Do you have any missing data? Like you gathered data since 2020 but your database does not contain values for August 2021 or something?

Cant make any sense out of this Error message.

Would it be possible to share your weewx db with me? This way I could debug into this with the actual data causing this.

cbirkenbeul commented 8 months ago

We had an hardware issue since then. So no software problem.

I could, but I use a mariadb as backend and the sql file seems quite big. But should missing old data cause this issue? I mean, I run the 3.3 version quite long without any issues.

Daveiano commented 8 months ago

The error is triggered by the stat-table.inc template, these were added in 3.5.0 (new feature, see here: https://github.com/Daveiano/weewx-wdc/wiki/Configuration#stat_tables) - so I think it does not matter if the skin runs with an earlier version since the template was added in the last version.

One thing you could try in the skin.conf: Please just comment out the "tables_rain", like this:

...
[[stat_tables]]
        [[[tables_outtemp]]]
            observation = "outTemp"
            label = "Temperature Stat Table"
            aggregate_types = "min", "avg", "max"
        #[[[tables_rain]]]
        #   observation = "rain"
        #   label = "Rain Stat Table"
        #   aggregate_types = "sum", "avg"
...

Does this also solve the problem?

@hoetzgit Do you have a sqlite file of your DB to reproduce the problem for me?

Daveiano commented 8 months ago

Ok, I think I found the problem. Attached is an updated file stat-table.inc (its named stat-table.txt, please rename to stat-table.inc). Can you please copy it over the old one?

Its at skins/weewx-wdc/includes/stat-table.inc, see https://www.weewx.com/docs/5.0/usersguide/where/

You can then enable back the [[stat_tables]] an they should render as expected as you can see here in the example: https://github.com/Daveiano/weewx-wdc/wiki/Configuration#stat_tables

stat-table.txt

hoetzgit commented 8 months ago

I have no more errors in the log with the customized stat-table.inc

cbirkenbeul commented 8 months ago

For me it does not work. I've implemented your file and reenabled the stats_table section which I comment out some days ago. Log attached for further debugging. weewx.log

Daveiano commented 8 months ago

Ok, I don't think the changed file is related to the error.

The error appears on every page, except the index page (at least it's not included in the log) - the changed file only impacts the year and statistics pages, not eg. the week or month pages which also fail to generate.

There seems to be something messed up. Did you only change the one file or did you change other things, too? Perhaps copied to the wrong location? Changed something in skin.conf?

cbirkenbeul commented 8 months ago

As you told me in your very first answer, I disabled the stats_table completely. For your patch I reenabled them.

I have changed the language and added the lightning values as discussed here.

I've download your file with wget on my system. Renamed it and copied the file to the includes directory. I don't see any formatting errors like utf-8 or so. My procedure should be fine.

Daveiano commented 7 months ago

Sorry for not getting back to you sooner, I got a nasty cold last week...

It's really difficult for me to reproduce these error messages. The first thing would be to disable the stat-tables again, I guess. This should solve the errors.

The error from your logs 1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'radiation IS NOT NULL LIMIT 1' at line 1"is hard to understand since the stat_tables only query rain and outTemp, but no radiation.

So if you want to share your DB with me I would have a look to reproduce the issue (you can share it with david.baetge@gmail.com). In the meantime, disabling the stat-tables again should work.

Nkawu commented 7 months ago

Just upgraded to weewx 5.0.2 & weewx-wdc 3.5.0. Got the same error but on a different template. Change to stat-table.inc fixed it for me also. I didn't have the stat_tables section in my weewx.conf at all.

cbirkenbeul commented 7 months ago

@Daveiano Its still to big to send by mail. I've uploaded it to google drive. Please let me now If you downloaded the file, so I can delete it. Thanks.

Daveiano commented 7 months ago

Ok, I downloaded the file. Will set up a testing environment and have a look in the next days.

donadroni commented 7 months ago

Seems like I am having similiar issues. Ive tried swapping out stat_table.inc , and also complete fresh install of weewx and weewx-wdc skin but same error. It just stopped all of a sudden. I am really out of ideas.

ar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/year-%Y.html.tmpl failed with exception '<class 'TypeError'>'
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/year-%Y.html.tmpl
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Reason: '<' not supported between instances of 'NoneType' and 'float'
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_year__Y_html_tmpl.py", line 203, in respond
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_climatological_days_inc.py", line 861, in respond
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 403, in respond
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 144, in __errorCatcher11
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Mar 27 08:01:29 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'NoneType' and 'float'
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/year-%Y.html.tmpl failed with exception '<class 'TypeError'>'
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/year-%Y.html.tmpl
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Reason: '<' not supported between instances of 'float' and 'NoneType'
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_year__Y_html_tmpl.py", line 203, in respond
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_climatological_days_inc.py", line 861, in respond
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 403, in respond
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 144, in __errorCatcher11
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Mar 27 08:01:30 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'float' and 'NoneType'
Mar 27 08:01:32 pi weewxd[11984]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/index.html.tmpl failed with exception '<class 'TypeError'>'
Mar 27 08:01:32 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/index.html.tmpl
Mar 27 08:01:32 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Reason: argument of type 'NoneType' is not iterable
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/xtypes.py", line 86, in get_scalar
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      return xtype.get_scalar(obs_type, record, db_manager, **option_dict)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 84, in get_scalar
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      return getattr(self, 'calc_%s' % obs_type)(obs_type, record, db_manager)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 201, in calc_appTemp
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      if 'outTemp' not in data or 'outHumidity' not in data or 'windSpeed' not in data:
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  TypeError: argument of type 'NoneType' is not iterable
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  During handling of the above exception, another exception occurred:
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_index_html_tmpl.py", line 326, in respond
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_body_alternative_inc.py", line 234, in respond
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_tile_inc.py", line 592, in respond
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_tile_inc.py", line 148, in __errorCatcher12
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/tags.py", line 605, in __getattr__
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      vt = weewx.xtypes.get_scalar(obs_type, self.record, db_manager)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/xtypes.py", line 90, in get_scalar
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      return xtype.get_scalar(obs_type, record, db_manager)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 84, in get_scalar
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      return getattr(self, 'calc_%s' % obs_type)(obs_type, record, db_manager)
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 201, in calc_appTemp
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      if 'outTemp' not in data or 'outHumidity' not in data or 'windSpeed' not in data:
Mar 27 08:01:33 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  TypeError: argument of type 'NoneType' is not iterable
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/statistics.html.tmpl failed with exception '<class 'TypeError'>'
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/statistics.html.tmpl
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: **** Reason: '<' not supported between instances of 'NoneType' and 'float'
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_statistics_html_tmpl.py", line 250, in respond
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_climatological_days_inc.py", line 861, in respond
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 403, in respond
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_table_inc.py", line 144, in __errorCatcher11
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Mar 27 08:01:41 pi weewxd[11984]: ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'NoneType' and 'float'
Mar 27 08:01:41 pi weewxd[11984]: INFO weewx.cheetahgenerator: Generated 109 files for report StandardReport in 84.54 seconds
Mar 27 08:01:41 pi weewxd[11984]: INFO weewx.reportengine: Copied 19 files to /var/www/html/weewx
Mar 27 08:01:41 pi weewxd[11984]: Exception in thread ReportThread:
Mar 27 08:01:41 pi weewxd[11984]: Traceback (most recent call last):
Mar 27 08:01:41 pi weewxd[11984]:   File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
Mar 27 08:01:41 pi weewxd[11984]:     self.run()
Mar 27 08:01:41 pi weewxd[11984]:   File "/usr/share/weewx/weewx/reportengine.py", line 192, in run
Mar 27 08:01:41 pi weewxd[11984]:     with set_cwd(os.path.join(self.config_dict['WEEWX_ROOT'],
Mar 27 08:01:41 pi weewxd[11984]:   File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
Mar 27 08:01:41 pi weewxd[11984]:     return next(self.gen)
Mar 27 08:01:41 pi weewxd[11984]:   File "/usr/share/weewx/weewx/reportengine.py", line 73, in set_cwd
Mar 27 08:01:41 pi weewxd[11984]:     os.chdir(new_cwd)
Daveiano commented 7 months ago

Seems like I am having similiar issues. Ive tried swapping out stat_table.inc , and also complete fresh install of weewx and weewx-wdc skin but same error. It just stopped all of a sudden. I am really out of ideas.

Yes looks like you got two problems here. The Reason: '<' not supported between instances of 'NoneType' and 'float' error and another error:

 ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 84, in get_scalar
 ****      return getattr(self, 'calc_%s' % obs_type)(obs_type, record, db_manager)
 ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 201, in calc_appTemp
 ****      if 'outTemp' not in data or 'outHumidity' not in data or 'windSpeed' not in data:
 ****  TypeError: argument of type 'NoneType' is not iterable

Looks like weewx has problems to calculate the app_temp - I found https://groups.google.com/g/weewx-user/c/fKVxr07vMuE/m/I-PdDb7vBgAJ which includes the same error but sadly no solution.

For the Reason: '<' not supported between instances of 'NoneType' and 'float' error: I will try to setup a test and replicate the error with a DB I already received from a user, I hope that I get some time over the weekend to look into that.

@donadroni Out of curiosity: Do you use a MySQL or a SQLite DB with weewx?

donadroni commented 7 months ago

@donadroni Out of curiosity: Do you use a MySQL or a SQLite DB with weewx?

I am using the default so it is SQLite You are right , it is probably a config error for the first problem for me

Daveiano commented 7 months ago

@cbirkenbeul I am really out of ideas now. I just set up a local MySQL server and imported the provided DB. I can run the report without any errors, everything gets generated. If I remove the change from b56b5fc19d4711407e4b39b825461176f50d495e, the error re-appears again.

Here is a screenshot of the stat-tables, which trigger the error, no problems at all:

256

Just to be sure, I released v3.5.1 which includes the fix.

@cbirkenbeul @donadroni Could you please test with v3.5.1?

donadroni commented 7 months ago

I just freshly installed weewx from and installed wdc 3.5.1 with my database but default config. I maybe have time on sunday to test it further but here is the log.

`Mar 29 10:30:16 pi weewxd[2368637]: INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.73 seconds
Mar 29 10:30:16 pi weewxd[2368637]: INFO weewx.imagegenerator: Generated 14 images for report SeasonsReport in 0.22 seconds
Mar 29 10:30:16 pi weewxd[2368637]: INFO weewx.reportengine: Copied 5 files to /var/www/html/weewx
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/weewx-wdc/index.html.tmpl failed with exception '<class 'TypeError'>'
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/weewx-wdc/index.html.tmpl
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: **** Reason: argument of type 'NoneType' is not iterable
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/xtypes.py", line 86, in get_scalar
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      return xtype.get_scalar(obs_type, record, db_manager, **option_dict)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 84, in get_scalar
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      return getattr(self, 'calc_%s' % obs_type)(obs_type, record, db_manager)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 201, in calc_appTemp
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      if 'outTemp' not in data or 'outHumidity' not in data or 'windSpeed' not in data:
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****  TypeError: argument of type 'NoneType' is not iterable
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****  During handling of the above exception, another exception occurred:
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_index_html_tmpl.py", line 326, in respond
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_body_alternative_inc.py", line 234, in respond
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_tile_inc.py", line 592, in respond
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_weewx_wdc_includes_stat_tile_inc.py", line 148, in __errorCatcher12
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/tags.py", line 605, in __getattr__
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      vt = weewx.xtypes.get_scalar(obs_type, self.record, db_manager)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/xtypes.py", line 90, in get_scalar
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      return xtype.get_scalar(obs_type, record, db_manager)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 84, in get_scalar
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      return getattr(self, 'calc_%s' % obs_type)(obs_type, record, db_manager)
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 201, in calc_appTemp
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****      if 'outTemp' not in data or 'outHumidity' not in data or 'windSpeed' not in data:
Mar 29 10:30:45 pi weewxd[2368637]: ERROR weewx.cheetahgenerator: ****  TypeError: argument of type 'NoneType' is not iterable
Mar 29 10:30:52 pi weewxd[2368637]: INFO weewx.cheetahgenerator: Generated 13 files for report WdcReport in 35.73 seconds

-- edited I am just wondering if the data is coming from the weatherstation, maybe that is my problem. because the error indicates there is no data. The station is remote from me so I will take a drive on site over the weekend to doublecheck

Daveiano commented 7 months ago

Yeah, looks to me like something is going on with your station. Good luck with checking!

But: the original TypeError: '<' not supported between instances of 'NoneType' and 'float' error is gone, which is good!

cbirkenbeul commented 7 months ago

Good news from my site. I've updated the skin with the official documentation you provided. Default settings -> no errors.

Now update the weewx.conf and skin.conf with my customization (language, adding observations) and restarted weewx again. Still no error message. I will have a look tomorrow if it still dont throw any errors.

Thanks for your help!

Daveiano commented 6 months ago

@cbirkenbeul @donadroni Since there was no response to the issue for about a week, I consider this closed. Wil keep the issue open until the end of the week though. In case there is some feedback on the way ;)