I seem to have a very specific problem due to my complex changes within weewx. First I'll shortly describe my problem, then I'll explain my weewx environment:
My problem: weewx 4.10.2 is working fine during daytimes, but imagegenerator fails daily between 0:00 and 5:15 all 5min with the same set of error messages, e.g.
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** no such table: forecast_day_wind
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** Traceback (most recent call last):
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weedb/sqlite.py", line 39, in guarded_fn
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** return fn(*args, **kwargs)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weedb/sqlite.py", line 233, in execute
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** return sqlite3.Cursor.execute(self, *args, **kwargs)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** sqlite3.OperationalError: no such table: forecast_day_wind
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: ****
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** During handling of the above exception, another exception occurred:
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: ****
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** Traceback (most recent call last):
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** obj.start()
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** self.run()
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/imagegenerator.py", line 44, in run
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** self.gen_images(self.gen_ts)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/imagegenerator.py", line 109, in gen_images
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** plot = self.gen_plot(plotgen_ts,
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/imagegenerator.py", line 248, in gen_plot
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** start_vec_t, stop_vec_t, data_vec_t = weewx.xtypes.get_series(
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/xtypes.py", line 100, in get_series
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** return xtype.get_series(obs_type, timespan, db_manager, aggregate_type,
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/xtypes.py", line 920, in get_series
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** return ArchiveTable.get_series(obs_type, timespan, db_manager, aggregate_type,
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/xtypes.py", line 167, in get_series
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** agg_vt = get_aggregate(obs_type, stamp, do_aggregate, db_manager)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/xtypes.py", line 127, in get_aggregate
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** return xtype.get_aggregate(obs_type, timespan, aggregate_type, db_manager,
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/xtypes.py", line 1102, in get_aggregate
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** row = db_manager.getSql(sql, timespan)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/manager.py", line 579, in getSql
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** _cursor.execute(sql, sqlargs)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** File "/usr/share/weewx/weedb/sqlite.py", line 47, in guarded_fn
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** raise weedb.NoTableError(e)
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** weedb.NoTableError: no such table: forecast_day_wind
Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR weewx.reportengine: **** Generator terminated
My weewx environment:
I'm using the current weewx version 4.10.2 with a highly customized Seasons skin on a raspberry pi 3 with current bullseye linux.
I also use the German DWD forecast module to get local forecasts, being stored within a separate sqlite DB (updated each hour by cron).
I want to see the forecast data within the same diagrams as the measured data, i.e. those diagrams contain data from 2 sqlite databases. Sadly there seeme to be no standard mechanism to extend the x-axis (time) into the "future". Thus I've tweaked the function scaletime within utities.py to include an optional parameter offset. This offset is forwarded from skin.conf to extend the x-axis by 10h (for daily reports) resp. 5days (for weekly reports).
This complicated setup works fine - except every neight between 0:00 and 5:15. I have noticed that exactly after 5:15 the forecast DB no longer contains data from the previous day, i.e. exactly after midnight the current time and the first data within forecast DB are from different dates.
Then I've tried to debug my code changes of scaletime by
cd /usr/share/weewx/weeplot
PYTHONPATH=/usr/share/weewx python3 -i utilities.py
and calling scaletime step by step at some critical dates after midnight. But my modifications to extend the time interval exactly work as intended (and I see completly correct images during daytime including all lnes from both sqlite DBs).
I've checked the created forecast DB - it's fine all over the day, especially nightly.
Of course I might post my changes if you ask for. But it would make my current post even more unreadable:-) . Here only 2 code lines from utilities.py (I do more)
def scaletime(tmin_ts, tmax_ts, offset=0):
...
tmax_dt = datetime.datetime.fromtimestamp(tmax_ts + offset)
...
Any ideas?