Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cbirkenbeul opened this issue Feb 27, 2024 · 23 comments
Labels
bug Something isn't working

Comments

@cbirkenbeul
Copy link

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.

@cbirkenbeul cbirkenbeul added the bug Something isn't working label Feb 27, 2024
@hoetzgit
Copy link
Contributor

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
Copy link
Owner

Daveiano commented Mar 1, 2024

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
Copy link
Author

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
Copy link
Owner

Daveiano commented Mar 1, 2024

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
Copy link
Author

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
Copy link
Owner

Daveiano commented Mar 3, 2024

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
Copy link
Owner

Daveiano commented Mar 3, 2024

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
Copy link
Contributor

hoetzgit commented Mar 4, 2024

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

@cbirkenbeul
Copy link
Author

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
Copy link
Owner

Daveiano commented Mar 6, 2024

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
Copy link
Author

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
Copy link
Owner

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 [email protected]). In the meantime, disabling the stat-tables again should work.

@Nkawu
Copy link

Nkawu commented Mar 13, 2024

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
Copy link
Author

cbirkenbeul commented Mar 13, 2024

@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
Copy link
Owner

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

@donadroni
Copy link

donadroni commented Mar 27, 2024

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
Copy link
Owner

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
Copy link

@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
Copy link
Owner

@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 b56b5fc, 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
Copy link

donadroni commented Mar 29, 2024

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

Daveiano commented Apr 9, 2024

@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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants