Another difference between versions 4 and 5 reports that has had me baffled 
for far too long.

For my V4 Seasons Skin I had deleted the sensor fields that I did not have, 
which led to empty fields in the skin file, such as:
 
    sensor_connections = 
    sensor_batteries = 
    sensor_voltages =
    telemetry_plot_groups =

This was fine with V4, but caused nasty problems with V5 - there was no 
index.html created, but the report generator kept barreling on after the 
error and still created the images and the other component files.
Once I added a single parameter to each of  these lines then V5 ran to 
completion (but not fast). I am not sure if there was one in particular 
causing the problem.

It happens with both mysql and sqlite3 drivers, with the error reported by 
mysql being
 "MySQLdb._exceptions.ProgrammingError: (1064, "You have an error in ... 
near 'IS NOT NULL LIMIT 1' at line 1")"
While the sqlite driver reports: "sqlite3.OperationalError: near "IS": 
syntax error".
Obviously the bit *before *the "IS" is the critical part but they'll leave 
that as an exercise for the reader.

The (trimmed) backtrace from cheetahgenerator  for the sqlite version is:

Evaluation of template /etc/weewx/skins/Seasons-combined-v4/index.html.tmpl 
failed with exception '<class 'weedb.OperationalError'>'
 **** Ignoring template /etc/weewx/skins/Seasons-combined-v4/index.html.tmpl
 **** Reason: near "IS": syntax error
 ****  Traceback (most recent call last):
 ****    File "/usr/share/weewx/weedb/sqlite.py", line 38, in guarded_fn
 ****      return fn(*args, **kwargs)
 ****             ^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weedb/sqlite.py", line 233, in execute
 ****      return sqlite3.Cursor.execute(self, *args, **kwargs)
 ****             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****  sqlite3.OperationalError: near "IS": syntax error
 ****  
 ****  During handling of the above exception, another exception occurred:
 ****  
 ****  Traceback (most recent call last):
 ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in 
generate
 ****      unicode_string = compiled_template.respond()
 ****                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "_etc_weewx_skins_Seasons_combined_v4_index_html_tmpl.py", 
line 221, in respond
 ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 
1708, in _handleCheetahInclude
 ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
 ****    File 
"_export__remounts_var_shared_html_weewx_skins_Seasons_combined_v4_sensors_inc.py",
 
line 333, in respond
 ****    File "/usr/share/weewx/weewx/tags.py", line 389, in has_data
 ****      val = weewx.xtypes.has_data(self.obs_type, self.timespan, 
db_manager)
 ****           
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weewx/xtypes.py", line 156, in has_data
 ****      vt = xtype.get_aggregate(obs_type, timespan, 'not_null', 
db_manager)
 ****           
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weewx/xtypes.py", line 373, in get_aggregate
 ****      row = db_manager.getSql(select_stmt)
 ****            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weewx/manager.py", line 579, in getSql
 ****      _cursor.execute(sql, sqlargs)
 ****    File "/usr/share/weewx/weedb/sqlite.py", line 52, in guarded_fn
 ****      raise weedb.OperationalError(e)
 ****  weedb.OperationalError: near "IS": syntax error
 Evaluation of template 
/etc/weewx/skins/Seasons-combined-v4/telemetry.html.tmpl failed with 
exception '<class 'weedb.OperationalError'>'
 **** Ignoring template 
/etc/weewx/skins/Seasons-combined-v4/telemetry.html.tmpl
 **** Reason: near "IS": syntax error
 ****  Traceback (most recent call last):
 ****    File "/usr/share/weewx/weedb/sqlite.py", line 38, in guarded_fn
 ****      return fn(*args, **kwargs)
 ****             ^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weedb/sqlite.py", line 233, in execute
 ****      return sqlite3.Cursor.execute(self, *args, **kwargs)
 ****             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****  sqlite3.OperationalError: near "IS": syntax error
 ****  
 ****  During handling of the above exception, another exception occurred:
 ****  
 ****  Traceback (most recent call last):
 ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in 
generate
 ****      unicode_string = compiled_template.respond()
 ****                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File 
"_etc_weewx_skins_Seasons_combined_v4_telemetry_html_tmpl.py", line 222, in 
respond
 ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 
1708, in _handleCheetahInclude
 ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
 ****    File 
"_export__remounts_var_shared_html_weewx_skins_Seasons_combined_v4_sensors_inc.py",
 
line 333, in respond
 ****    File "/usr/share/weewx/weewx/tags.py", line 389, in has_data
 ****      val = weewx.xtypes.has_data(self.obs_type, self.timespan, 
db_manager)
 ****           
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weewx/xtypes.py", line 156, in has_data
 ****      vt = xtype.get_aggregate(obs_type, timespan, 'not_null', 
db_manager)
 ****           
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weewx/xtypes.py", line 373, in get_aggregate
 ****      row = db_manager.getSql(select_stmt)
 ****            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ****    File "/usr/share/weewx/weewx/manager.py", line 579, in getSql
 ****      _cursor.execute(sql, sqlargs)
 ****    File "/usr/share/weewx/weedb/sqlite.py", line 52, in guarded_fn
 ****      raise weedb.OperationalError(e)
 ****  weedb.OperationalError: near "IS": syntax error

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/b4703738-062d-4b1c-aac9-7f739b270706n%40googlegroups.com.

Reply via email to