sudo wee_database --rebuild-daily does not work.

115 views
Skip to first unread message

geni08...@gmail.com

unread,
May 3, 2023, 7:34:43 AM5/3/23
to weewx-user
Raspi4, weewx 4.10.2, MariaDB 10 on Synology, Belchertown 1.3.1

What am I doing wrong?

pi@Wetter-Raspi4:~ $ sudo wee_database --rebuild-daily --dry-run
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
All daily summaries will be rebuilt.
Proceed (y/n)? y
Rebuilding daily summaries in database 'weewx_new' ...
Dry run. Nothing done.
pi@Wetter-Raspi4:~ $




pi@Wetter-Raspi4:~ $ sudo wee_database --rebuild-daily --date=2023-04-01 --to=2023-05-02 --dry-run
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
Traceback (most recent call last):
  File "/usr/share/weewx/wee_database", line 1168, in <module>
    main()
  File "/usr/share/weewx/wee_database", line 247, in main
    rebuildDaily(config_dict, db_binding, options)
  File "/usr/share/weewx/wee_database", line 314, in rebuildDaily
    from_dt, to_dt = _parse_dates(options)
  File "/usr/share/weewx/wee_database", line 1088, in _parse_dates
    raise ValueError("Specify either --date or a --from and --to combination; not both")
ValueError: Specify either --date or a --from and --to combination; not both
pi@Wetter-Raspi4:~ $

geni08...@gmail.com

unread,
May 3, 2023, 7:41:25 AM5/3/23
to weewx-user
pi@Wetter-Raspi4:~ $ sudo wee_database --rebuild-daily --date=2023-04-01
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
Daily summary for 2023-04-01 will be rebuilt.

Proceed (y/n)? y
Rebuilding daily summaries in database 'weewx_new' ...
Traceback (most recent call last):
  File "/usr/share/weewx/wee_database", line 1168, in <module>
    main()
  File "/usr/share/weewx/wee_database", line 247, in main
    rebuildDaily(config_dict, db_binding, options)
  File "/usr/share/weewx/wee_database", line 356, in rebuildDaily
    nrecs, ndays = dbmanager.backfill_day_summary(start_d=from_d,
  File "/usr/share/weewx/weewx/manager.py", line 1249, in backfill_day_summary
    raise weewx.ViolatedPrecondition("Daily summaries are not complete. "
weewx.ViolatedPrecondition: Daily summaries are not complete. Try again without from/to dates.
pi@Wetter-Raspi4:~ $

Tom Keffer

unread,
May 5, 2023, 7:56:37 PM5/5/23
to weewx...@googlegroups.com
Sorry. The error description is not the best. What it is saying is that you cannot rebuild a single day unless the daily summaries are complete. So, you will have to finish rebuilding all the summaries first.

Try

wee_database --rebuild-daily


--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/489fd6ec-7658-43bc-9a11-91b438901275n%40googlegroups.com.

geni08...@gmail.com

unread,
May 6, 2023, 1:33:34 AM5/6/23
to weewx-user
sudo wee_database --rebuild-daily was executed after sudo wee_database --reconfigure.

And now this result, is from to not allowed?
pi@Wetter-Raspi4:~ $ sudo wee_database --rebuild-daily --date=2023-04-01 --to=2023-05-02
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
Traceback (most recent call last):
  File "/usr/share/weewx/wee_database", line 1168, in <module>
    main()
  File "/usr/share/weewx/wee_database", line 247, in main
    rebuildDaily(config_dict, db_binding, options)
  File "/usr/share/weewx/wee_database", line 314, in rebuildDaily
    from_dt, to_dt = _parse_dates(options)
  File "/usr/share/weewx/wee_database", line 1088, in _parse_dates
    raise ValueError("Specify either --date or a --from and --to combination; not both")
ValueError: Specify either --date or a --from and --to combination; not both
pi@Wetter-Raspi4:~ $

gjr80

unread,
May 6, 2023, 2:20:50 AM5/6/23
to weewx-user
Did you run wee_database --rebuild_daily as suggested by Tom? When running wee_database --rebuild-daily you can use the optional --date by itself to specify a single day, you can use --to by itself to specify a date range from the first record in the database to a give date, you can use --from by itself to specify a date range from a given record through until the last record in the database or you can use --from and --to to specify a date range. You cannot use --date with --to or --date with --from, if you read the error message in you most recent post that is what it is telling you.

Gary

geni08...@gmail.com

unread,
May 6, 2023, 4:24:22 AM5/6/23
to weewx-user
OK, the correct syntax is:
pi@Wetter-Raspi4:~ $ sudo wee_database --rebuild-daily --from=2023-04-01 --to=2023-05-02

Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
Daily summaries from 2023-04-01 through 2023-05-02 inclusive will be rebuilt.

Proceed (y/n)? y
Rebuilding daily summaries in database 'weewx_new' ...
Records processed: 4000; time: 2023-04-28 19:30:00 CEST (1682703000)
Processed 4603 records to rebuild 32 daily summaries in 9.26 seconds
Rebuild of daily summaries in database 'weewx_new' complete
pi@Wetter-Raspi4:~ $

many thanks
Reply all
Reply to author
Forward
0 new messages