This could be anything. We will need to see more of the log to tell. For
example, you could be asking for a date one month after January 30.

Set debug=1, restart weewxd, post the log from startup through the error.

On Wed, Mar 20, 2024 at 3:57 AM 'Michael Waldor' via weewx-user <
[email protected]> wrote:

> Sadly those mysterious rows only appear AFTER .recover,  they appear
> within weewx.sql.
> The failing command is
>
> SELECT count(*)
> FROM archive
> WHERE
>   date(datetime, 'unixepoch', 'localtime')
>   between '2024-03-15' and '2024-03-15';
>
> But that command works fine AFTER .recover.
>
> The error message from weewxd clearly indicates wrong datetime:
>
> Mär 20 11:34:37 imurr9 weewxd[15172]: CRITICAL __main__:     ****
>  last_d = datetime.date.fromtimestamp(weeutil.weeutil.startOfArchiveDay(
> Mär 20 11:34:37 imurr9 weewxd[15172]:     time_dt =
> datetime.datetime.fromtimestamp(time_ts)
> Mär 20 11:34:37 imurr9 weewxd[15172]: OverflowError: timestamp out of
> range for platform time_t
> Mär 20 11:34:37 imurr9 weewxd[15172]: CRITICAL __main__:     ****    File
> "/usr/share/weewx/weeutil/weeutil.py", line 1196, in startOfArchiveDay
> Mär 20 11:34:37 imurr9 weewxd[15172]: CRITICAL __main__:     ****
>  time_dt = datetime.datetime.fromtimestamp(time_ts)
> Mär 20 11:34:37 imurr9 weewxd[15172]: CRITICAL __main__:     ****
>  OverflowError: timestamp out of range for platform time_t
> Mär 20 11:34:37 imurr9 weewxd[15172]: CRITICAL __main__:     ****  Exiting
> Michael Waldor schrieb am Mittwoch, 20. März 2024 um 10:43:13 UTC+1:
>
>> I do have a first idea: There are entries within weewx.sdb where datetime
>> is 0 or 7. Those values clearly are no valid timestamps.
>> I'll proceed in that direction ...
>>
>> Michael Waldor schrieb am Mittwoch, 20. März 2024 um 10:04:57 UTC+1:
>>
>>> Some days ago I've stopped weewx for roughly one day (I did change the
>>> GPIO connections of my raspberry pi4). Now I wanted to insert some data
>>> into my weewx.sdb from that timespan.
>>>
>>> When trying some sqlite3 commands (on a local copy of weewx.sdb - as an
>>> exercise a simple count) sqlite3 failed with corrupt database. OK, can
>>> imagine that that might have happened sometimes during the last 5 years.
>>> Thus I tried to rebuild my database by
>>>
>>> mv weewx.sdb weewx_corrupt.sdb
>>> sqlite3 weewx_corrupt.sdb .recover > weewx.sql
>>> sqlite3 weewx.sdb < weewx.sql
>>>
>>> Now my sqlite3 commands worked as expected, i.e. the newly created
>>> weewx.sdb seemed to be fixed. Keep in mind that I did not modify weewx.sql.
>>> Thus a potential error might still have "survived" within the newly created
>>> weewx.sdb.
>>>
>>> I then checked the modified weewx.sdb copied into /var/lib/weewx (weewx
>>> itself was NOT running) with
>>>
>>> weectl database check
>>>
>>> and got no error messages. But weewxd did not like that modified
>>> weewx.sdb. It reports "OverflowError: timestamp out of range for ..." when
>>> starting weewx.
>>>
>>> To me it's difficult to tell
>>> 1. whether my original weewx.sdb is corrupt at all (weewxd works fine)
>>> 2. if it's corrupt howto fix it.
>>>
>>> Hope somebody might have a suggestion, Michael
>>>
>>> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/b00628cf-ebf4-4fc2-a8bb-a193447e9476n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/b00628cf-ebf4-4fc2-a8bb-a193447e9476n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEBB5V2gC5P9wHoCp2%3D6XWNHjpyGf1OQGSHx8P7Xqf-3jA%40mail.gmail.com.

Reply via email to