Hi Daniel,
I am not surprised that a hard powerdown might lead to some duplicate
archive records, but if they sorted themselves out I would have expected
the reports to fall into line. Could I ask for a bit more loggging? Could
you set debug=1, stop/start weewx and post from startup and include at
least 2 full report cyles. I am suspicious that the weewx-WD code that
calculates midnight in that particular SLE may be somewhat fragile.
Gary
On Wednesday, 1 February 2017 10:06:54 UTC+10, Daniel Rich wrote:
>
> I had a hard powerdown of my WeeWX Pi the other day, and ever since it
> hasn't
> been updating the web pages or external weather feeds.
>
> I see some archive update errors after the crash, the logs show the
> following
> and my last update was at 18:35:
>
> Jan 25 18:35:16 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:20:00 PST (1485397200) to database 'weewx.sdb': UNIQUE
> constraint failed: archive.dateTime
> Jan 25 18:35:16 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:20:00 PST (1485397200) to database 'archive/weewxwd.sdb':
> UNIQUE constraint failed: archive.dateTime
> Jan 25 18:35:17 weather weewx[763]: restx: ISY: Published record
> 2017-01-25 18:20:00 PST (1485397200)
> Jan 25 18:35:17 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:25:00 PST (1485397500) to database 'weewx.sdb': UNIQUE
> constraint failed: archive.dateTime
> Jan 25 18:35:17 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:25:00 PST (1485397500) to database 'archive/weewxwd.sdb':
> UNIQUE constraint failed: archive.dateTime
> Jan 25 18:35:17 weather weewx[763]: restx: EmonCMS: Published record
> 2017-01-25 18:20:00 PST (1485397200)
> Jan 25 18:35:17 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:30:00 PST (1485397800) to database 'weewx.sdb': UNIQUE
> constraint failed: archive.dateTime
> Jan 25 18:35:17 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:30:00 PST (1485397800) to database 'archive/weewxwd.sdb':
> UNIQUE constraint failed: archive.dateTime
> Jan 25 18:35:17 weather weewx[763]: restx: PWSWeather: Published record
> 2017-01-25 18:20:00 PST (1485397200)
> Jan 25 18:35:17 weather weewx[763]: restx: ISY: Published record
> 2017-01-25 18:25:00 PST (1485397500)
> Jan 25 18:35:17 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:35:00 PST (1485398100) to database 'weewx.sdb': UNIQUE
> constraint failed: archive.dateTime
> Jan 25 18:35:17 weather weewx[763]: manager: unable to add record
> 2017-01-25 18:35:00 PST (1485398100) to database 'archive/weewxwd.sdb':
> UNIQUE constraint failed: archive.dateTime
>
>
> These errors show up until 19:05, then there are no more errors until
> after
> midnight on the 27th. After that each update cycle shows:
>
> Jan 27 00:00:33 weather weewx[754]: reportengine: Caught unrecoverable
> exception in generator weewx.cheetahgenerator.CheetahGenerator
> Jan 27 00:00:33 weather weewx[754]: **** start time (1485504000)
> is greater than stop time (1485484500)
> Jan 27 00:00:33 weather weewx[754]: **** Traceback (most recent
> call last):
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/reportengine.py", line 238, in run
> Jan 27 00:00:33 weather weewx[754]: **** obj.start()
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/reportengine.py", line 271, in start
> Jan 27 00:00:33 weather weewx[754]: **** self.run()
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 150, in run
> Jan 27 00:00:33 weather weewx[754]: **** ngen =
> self.generate(gen_dict[section_name], self.gen_ts)
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 219, in generate
> Jan 27 00:00:33 weather weewx[754]: **** ngen +=
> self.generate(section[subsection], gen_ts)
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 219, in generate
> Jan 27 00:00:33 weather weewx[754]: **** ngen +=
> self.generate(section[subsection], gen_ts)
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 305, in generate
> Jan 27 00:00:33 weather weewx[754]: **** default_binding)
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 357, in _getSearchList
> Jan 27 00:00:33 weather weewx[754]: **** searchList +=
> obj.get_extension_list(timespan, db_lookup)
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/user/wdSearchX3.py", line 859, in get_extension_list
> Jan 27 00:00:33 weather weewx[754]: **** (time_start_vt,
> time_stop_vt, wind_speed_vt) =
> db_lookup().getSqlVectors(weeutil.weeutil.TimeSpan(midnight_ts,
> timespan.stop), 'windSpeed')
> Jan 27 00:00:33 weather weewx[754]: **** File
> "/usr/share/weewx/weeutil/weeutil.py", line 315, in __new__
> Jan 27 00:00:33 weather weewx[754]: **** raise
> ValueError("start time (%d) is greater than stop time (%d)" % (args[0],
> args[1]))
> Jan 27 00:00:33 weather weewx[754]: **** ValueError: start time
> (1485504000) is greater than stop time (1485484500)
> Jan 27 00:00:33 weather weewx[754]: **** Generator terminated
> Jan 27 00:00:33 weather weewx[754]: cheetahgenerator: Generated 1 files
> for report wdPWS in 0.37 seconds
> Jan 27 00:00:42 weather weewx[754]: cheetahgenerator: Generated 1 files
> for report wdClientraw in 8.55 seconds
>
>
> I'm assuming there are some bad records in the archive db, any tips on
> locating them and purging them? The archive data definitely stops at the
> time
> of the error:
>
> > sqlite3 /var/lib/weewx/weewx.sdb
> SQLite version 3.8.7.1 2014-10-29 13:59:56
> Enter ".help" for usage hints.
> > select * from archive where dateTime > 1485484000;
> 1485484200|1|5|30.421|29.9812588051139|30.3939839514882|68.7|47.8|49.0|78.0|0.0||0.0||0.0|0.0|41.2786972752926|47.8|47.8|0.0||||||||||||||||||||99.9375||||||||||||
>
>
> 1485484500|1|5|30.421|29.9812416704312|30.3939666219138|68.7|47.5|49.0|78.0|0.0||0.0||0.0|0.0|40.9874488882043|47.5|47.5|0.0||||||||||||||||||||99.0833333333333||||||||||||
>
>
> sqlite>
>
> > sqlite3 /var/lib/weewx/archive/weewxwd.sdb
> SQLite version 3.8.7.1 2014-10-29 13:59:56
> Enter ".help" for usage hints.
> sqlite> select * from archive where dateTime > 1485484000;
> 1485484200|1|5|46.6223678190296|45.8320586487554||47.8
> 1485484500|1|5|46.2230403396625|45.4734264426846||47.5
> sqlite>
>
> --
> Dan Rich <[email protected] <javascript:>> |
> http://www.employees.org/~drich/
> | "Step up to red alert!" "Are you sure,
> sir?
> | It means changing the bulb in the
> sign..."
> | - Red Dwarf (BBC)
>
>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.