"weectl database reconfigure --binding=wx_binding -y" (without " 
--dry-run") fails with the same message.

Zed schrieb am Donnerstag, 4. Dezember 2025 um 21:48:39 UTC+1:

> I guess "weectl database reconfigure --binding=wx_binding -y" will do this 
> job.
> But "weectl database reconfigure --binding=wx_binding --dry-run -y" fails:
>
> Using configuration file /home/weewx/weewx-data/weewx.conf
> This is a dry run. Nothing will actually be done.
> Copying database 'weewx' to 'weewx_new'
> The new database will use the same unit system as the old ('METRICWX').
> Traceback (most recent call last):
>   File "/home/weewx/weewx-venv/bin/weectl", line 7, in <module>
>     sys.exit(main())
>              ~~~~^^
>   File "/home/weewx/weewx-venv/lib/python3.13/site-packages/weectl.py", 
> line 67, in main
>     namespace.func(namespace)
>     ~~~~~~~~~~~~~~^^^^^^^^^^^
>   File 
> "/home/weewx/weewx-venv/lib/python3.13/site-packages/weectllib/__init__.py", 
> line 90, in dispatch
>     namespace.action_func(config_dict, namespace)
>     ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
>   File 
> "/home/weewx/weewx-venv/lib/python3.13/site-packages/weectllib/database_cmd.py",
>  
> line 371, in reconfigure_database
>     weectllib.database_actions.reconfigure_database(config_dict,
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
>                                                     
> db_binding=namespace.binding,
>                                                     
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                                                     
> dry_run=namespace.dry_run,
>                                                     
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
>                                                     
> no_confirm=namespace.yes)
>                                                     
> ^^^^^^^^^^^^^^^^^^^^^^^^^
>   File 
> "/home/weewx/weewx-venv/lib/python3.13/site-packages/weectllib/database_actions.py",
>  
> line 295, in reconfigure_database
>     weewx.manager.reconfig(manager_dict['database_dict'],
>     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                            new_database_dict,
>                            ^^^^^^^^^^^^^^^^^^
>                            new_unit_system=target_unit_system,
>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                            new_schema=manager_dict['schema'],
>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                            dry_run=dry_run)
>                            ^^^^^^^^^^^^^^^^
>   File 
> "/home/weewx/weewx-venv/lib/python3.13/site-packages/weewx/manager.py", 
> line 711, in reconfig
>     record_generator = 
> weewx.units.GenWithConvert(old_archive.genBatchRecords(),
>                        ^^^^^
> UnboundLocalError: cannot access local variable 'weewx' where it is not 
> associated with a value
> Zed schrieb am Donnerstag, 4. Dezember 2025 um 18:47:09 UTC+1:
>
>> Thank you vince. That makes sense.
>> These are the columns of table archive?
>> Are you using mariadb/mysql? Could you please post the result of 
>> "describe archive;" then.
>>
>> Could somebody please post a script to upgrade a mariadb from v4 to v5?
>> Is there a migration guide describing this step?
>> Is it sufficient to add these columns?
>>
>> vince schrieb am Donnerstag, 4. Dezember 2025 um 18:15:34 UTC+1:
>>
>>> If your weewx was fast with v4 and it is very slow with v5, you are very 
>>> likely trying to display something in a skin that is calculated yet not an 
>>> element in the db.  This is a change that occurred in v5.
>>>
>>> The schema definition in the db only creates new columns if you are 
>>> 'creating' a 'new' database, if I remember correctly.
>>>
>>>    - Your database has 53 items in the archive record.  That means you 
>>>    are using the old 'small' schema.
>>>    - My db has 114 items in the archive record. That means I am using 
>>>    the newer wview-extended schema.
>>>
>>> Your db is missing the following elements that were added in the 
>>> wview-extended schema.
>>>
>>> appTemp appTemp1
>>> batteryStatus1 batteryStatus2 batteryStatus3 batteryStatus4 
>>> batteryStatus5 batteryStatus6 batteryStatus7 batteryStatus8
>>> cloudbase
>>> co
>>> co2
>>> dewpoint1
>>> extraHumid3 extraHumid4 extraHumid5 extraHumid6 extraHumid7 extraHumid8
>>> extraTemp4 extraTemp5 extraTemp6 extraTemp7 extraTemp8
>>> forecast
>>> hailBatteryStatus
>>> heatindex1
>>> humidex humidex1
>>> illuminance
>>> inDewpoint
>>> lightning_distance lightning_disturber_count lightning_energy 
>>> lightning_noise_count lightning_strike_count luminosity
>>> maxSolarRad
>>> nh3
>>> no2
>>> noise
>>> o3
>>> pb
>>> pm1_0 pm10_0 pm2_5
>>> signal1 signal2 signal3 signal4 signal5 signal6 signal7 signal8
>>> snow snowBatteryStatus snowDepth snowMoisture snowRate
>>> so2
>>> uvBatteryStatus
>>> windrun 
>>>
>>>
>>> On Thursday, December 4, 2025 at 7:49:30 AM UTC-8 Zed wrote:
>>>
>>>> The differences in Seasons/skin.conf are:
>>>>
>>>> 8c8
>>>> < SKIN_VERSION = 5.2.0
>>>> ---
>>>> > SKIN_VERSION = 4.9.1
>>>> 29c29
>>>> <     # If you have a Google Analytics GA4 tag, uncomment and edit the 
>>>> next line, and
>>>> ---
>>>> >     # If you have a Google Analytics ID, uncomment and edit the next 
>>>> line, and
>>>> 31c31
>>>> <     #googleAnalyticsId = G-ABCDEFGHI
>>>> ---
>>>> >     #googleAnalyticsId = UA-12345678-1
>>>> 269c269
>>>> <         time_length = 27h
>>>> ---
>>>> >         time_length = 97200 # 27 hours
>>>> 350c350
>>>> <                 aggregate_interval = 1h
>>>> ---
>>>> >                 aggregate_interval = hour
>>>> 359c359
>>>> <                 aggregate_interval = 1h
>>>> ---
>>>> >                 aggregate_interval = hour
>>>> 384c384
>>>> <                 aggregate_interval = 1h
>>>> ---
>>>> >                 aggregate_interval = hour
>>>> 410c410
>>>> <         aggregate_interval = 1h
>>>> ---
>>>> >         aggregate_interval = hour
>>>> 488c488
>>>> <                 aggregate_interval = 1d
>>>> ---
>>>> >                 aggregate_interval = day
>>>> 496c496
>>>> <                 aggregate_interval = 1d
>>>> ---
>>>> >                 aggregate_interval = day
>>>> 521c521
>>>> <                 aggregate_interval = 1d
>>>> ---
>>>> >                 aggregate_interval = day
>>>> 546c546
>>>> <         aggregate_interval = 3h
>>>> ---
>>>> >         aggregate_interval = 10800 # 3 hours
>>>> 625c625
>>>> <                 aggregate_interval = 1d
>>>> ---
>>>> >                 aggregate_interval = day
>>>> 633c633
>>>> <                 aggregate_interval = 1d
>>>> ---
>>>> >                 aggregate_interval = day
>>>> 658c658
>>>> <                 aggregate_interval = 1d
>>>> ---
>>>> >                 aggregate_interval = day
>>>> 683c683
>>>> <         aggregate_interval = 1d
>>>> ---
>>>> >         aggregate_interval = day
>>>> 762c762
>>>> <                 aggregate_interval = 1w
>>>> ---
>>>> >                 aggregate_interval = week
>>>> 770c770
>>>> <                 aggregate_interval = 1w
>>>> ---
>>>> >                 aggregate_interval = week
>>>> 795c795
>>>> <                 aggregate_interval = 1w
>>>> ---
>>>> >                 aggregate_interval = week
>>>>
>>>>
>>>> Tom Keffer schrieb am Donnerstag, 4. Dezember 2025 um 16:35:39 UTC+1:
>>>>
>>>>> Yes, reports that use derived types can be slow if the type is not in 
>>>>> the database. The Belchertown skin has this problem because of its use of 
>>>>> type 'appTemp'. However, the Seasons skin does not do this. (Unless, of 
>>>>> course, you extended it.)
>>>>>
>>>>> The declaration for schema
>>>>>
>>>>>         schema = schemas.wview_extended.schema
>>>>>
>>>>> does not make any difference. It's only used when the database is 
>>>>> created.
>>>>>
>>>>> What type of Raspberry Pi are you using? I've used everything from an 
>>>>> RPi Zero on with no problem, but it will be slow.
>>>>>
>>>>> These performance problems can be difficult to diagnose. I 
>>>>> would suggest commenting out the template declarations in 
>>>>> Seasons/skin.conf 
>>>>> one by one until you find the culprit.
>>>>>
>>>>> -tk
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Dec 4, 2025 at 6:28 AM Zed <[email protected]> wrote:
>>>>>
>>>>>> Is the report generation dependent from the database layout?
>>>>>> What makes you think,  3rd party templates are in use?
>>>>>>
>>>>>> There is a  difference  in "schema" in weewx.conf:
>>>>>> Before  (v4.9.1):
>>>>>>
>>>>>> [DataBindings]
>>>>>>     [[wx_binding]]
>>>>>>         database = archive_mysql
>>>>>>         table_name = archive
>>>>>>         manager = weewx.manager.DaySummaryManager
>>>>>>         schema = schemas.wview_extended.schema
>>>>>>
>>>>>> Now (v5.2.0):
>>>>>>
>>>>>> [DataBindings]
>>>>>>     [[wx_binding]]
>>>>>>         database = archive_mysql
>>>>>>         table_name = archive
>>>>>>         manager = weewx.manager.DaySummaryManager
>>>>>>         schema = weewx.schemas.wview_extended.schema
>>>>>>
>>>>>> Could this cause this issue?
>>>>>> John Smith schrieb am Donnerstag, 4. Dezember 2025 um 14:51:36 UTC+1:
>>>>>>
>>>>>>> On Fri, 5 Dec 2025 at 00:38, Zed <[email protected]> wrote:
>>>>>>>
>>>>>>>> how can i check the columns? Attached please find the db-columns 
>>>>>>>> currently defined.
>>>>>>>>
>>>>>>>
>>>>>>> I have no direct experience with using 3rd party templates, but 
>>>>>>> you'd have to look for things in the template(s) that have no 
>>>>>>> corresponding 
>>>>>>> columns in the DB, especially for things like monthly or yearly stats 
>>>>>>> etc...
>>>>>>>
>>>>>>> When debugging things in general you should disable everything, and 
>>>>>>> then turn features back on one by one until you hit the same behaviour.
>>>>>>>
>>>>>> -- 
>>>>>>
>>>>> 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 visit 
>>>>>> https://groups.google.com/d/msgid/weewx-user/4ad2d41d-1343-4daa-9443-4bf567c2435fn%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/weewx-user/4ad2d41d-1343-4daa-9443-4bf567c2435fn%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 visit 
https://groups.google.com/d/msgid/weewx-user/ef248929-8c7e-4308-a981-781835101bd9n%40googlegroups.com.

Reply via email to