I fixed those which reduced the number of errors. With a mix of guesswork 
and turning on debugging, I found the other values which needed fixing. 
They included lightning_distance and lightning_strike_count.

No errors now, thankfully! 

BTW it would be good to be able to drop and rebuild the summary for just 
one of the values in archive, on the grounds that I know what columns I've 
updated and there is only a need to rebuild the summary / summaries for 
those columns. But again, maybe this is a rather rare use-case.


On Tuesday, 24 December 2024 at 19:37:40 UTC Tom Keffer wrote:

> Those are new errors, but there is a clue in one of them:
>
> ValueError: could not convert string to float: ''
>
>
> This implies that one of the values is a null string. Test for them:
>
> sqlite3 /var/lib/weewx/weewx.sdb
> sqlite> select dateTime, windDir, windGustDir from archive where 
> windDir='' or windGustDir='';
>
> This will show you any null strings for types windDir and windGustDir. 
> There may also be null strings for other types.
>
> Set them to a real null as follows:
>
> sqlite> update archive set windDir=null where windDir='';
> sqlite> update archive set windGustDir=null where windGustDir='';
>
> Then drop and rebuild the daily summaries.
>
>
>
>
>
> On Tue, Dec 24, 2024 at 8:13 AM Auchtermuchty Weather <[email protected]> 
> wrote:
>
>> I've done that, and at the same time more errors have popped up!
>>
>> On Tuesday, 24 December 2024 at 14:04:16 UTC Tom Keffer wrote:
>>
>>> I've included a version of xtypes.py that will tell us the value of 
>>> "direction" when an exception occurs. Could you substitute it for your copy?
>>>
>>>
>>>
>>> On Tue, Dec 24, 2024 at 12:31 AM Auchtermuchty Weather <
>>> [email protected]> wrote:
>>>
>>>> OK ran some SQL and captured the output:
>>>>
>>>> WindDir.csv:|null|9
>>>> WindDir.csv:|text|428413
>>>> WindGust.csv:|text|2021
>>>> WindGustDir.csv:|null|6
>>>> WindGustDir.csv:|text|371698
>>>>
>>>> However when I looked at the timestamps for the few rows with NULL,  
>>>> they were all in December this year, and from well after the problem 
>>>> started.
>>>>
>>>> I've had a look at the data - no over or under values in my view:
>>>>
>>>> sqlite> select min(windGustDir), max(windGustDir) from archive  where 
>>>> windGustDir <> "" ;      
>>>> 0.0|359.0
>>>> sqlite> select min(windDir), max(windDir) from archive  where windDir 
>>>> <> "" ;
>>>> 0.0|360.0
>>>>
>>>> So nothing strange there either.
>>>>
>>>> On Tuesday, 24 December 2024 at 07:53:58 UTC Auchtermuchty Weather 
>>>> wrote:
>>>>
>>>>> SQLite. I was wondering that, but as "0" <> 0, selecting windGust, 
>>>>> count(*) should bring back separate rows for each.
>>>>>
>>>>> On Monday, 23 December 2024 at 22:49:54 UTC Tom Keffer wrote:
>>>>>
>>>>>> I would guess that one of the fields in your database that you think 
>>>>>> holds a number, actually holds a string. It could be a string for value 
>>>>>> zero ('0'), instead of the actual value zero (0).
>>>>>>
>>>>>> The error occurred on a line that is doing queries in the main 
>>>>>> archive table (not the daily summaries) using columns 'windDir' or 
>>>>>> 'windGustDir'. 
>>>>>>
>>>>>> One more thing: what kind of database? Sqlite?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Dec 23, 2024 at 10:55 AM Auchtermuchty Weather <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Sorry truncated the error report. I used cut to remove the stuff at 
>>>>>>> the start of each line and put the output into a file, then used 'set 
>>>>>>> number' in my text editor to make sure I pasted all the lines.,
>>>>>>>
>>>>>>>       1 Caught unrecoverable exception in generator 
>>>>>>> 'weewx.imagegenerator.ImageGenerator'
>>>>>>>       2         ****  unsupported operand type(s) for -: 'float' and 
>>>>>>> 'str'
>>>>>>>       3         ****  Traceback (most recent call last):
>>>>>>>       4         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 109, in get_series
>>>>>>>       5         ****      return xtype.get_series(obs_type, 
>>>>>>> timespan, db_manager, aggregate_type,
>>>>>>>       6         ****             
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>       7         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 1040, in get_series
>>>>>>>       8         ****      return ArchiveTable.get_series(obs_type, 
>>>>>>> timespan, db_manager, aggregate_type,
>>>>>>>       9         ****             
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      10         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 210, in get_series
>>>>>>>      11         ****      agg_vt = get_aggregate(obs_type, stamp, 
>>>>>>> do_aggregate, db_manager,
>>>>>>>      12         ****               
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      13         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 136, in get_aggregate
>>>>>>>      14         ****      return xtype.get_aggregate(obs_type, 
>>>>>>> timespan, aggregate_type, db_manager,
>>>>>>>      15         ****             
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      16         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 1168, in get_aggregate
>>>>>>>      17         ****      xsum += mag * math.cos(math.radians(90.0 - 
>>>>>>> direction))
>>>>>>>      18         ****                                         
>>>>>>>  ~~~~~^~~~~~~~~~~
>>>>>>>      19         ****  TypeError: unsupported operand type(s) for -: 
>>>>>>> 'float' and 'str'
>>>>>>>      20         ****
>>>>>>>      21         ****  During handling of the above exception, 
>>>>>>> another exception occurred:
>>>>>>>      22         ****
>>>>>>>      23         ****  Traceback (most recent call last):
>>>>>>>      24         ****    File 
>>>>>>> "/usr/share/weewx/weewx/reportengine.py", line 248, in run
>>>>>>>      25         ****      obj.start()
>>>>>>>      26         ****    File 
>>>>>>> "/usr/share/weewx/weewx/reportengine.py", line 465, in start
>>>>>>>      27         ****      self.run()
>>>>>>>      28         ****    File 
>>>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 37, in run
>>>>>>>      29         ****      self.gen_images(self.gen_ts)
>>>>>>>      30         ****    File 
>>>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 100, in gen_images
>>>>>>>      31         ****      plot = self.gen_plot(plotgen_ts,
>>>>>>>      32         ****             ^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      33         ****    File 
>>>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 236, in gen_plot
>>>>>>>      34         ****      start_vec_t, stop_vec_t, data_vec_t = 
>>>>>>> weewx.xtypes.get_series(
>>>>>>>      35         ****                                           
>>>>>>>  ^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      36         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 114, in get_series
>>>>>>>      37         ****      return xtype.get_series(obs_type, 
>>>>>>> timespan, db_manager, aggregate_type,
>>>>>>>      38         ****             
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      39         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 1040, in get_series
>>>>>>>      40         ****      return ArchiveTable.get_series(obs_type, 
>>>>>>> timespan, db_manager, aggregate_type,
>>>>>>>      41         ****             
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      42         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 210, in get_series
>>>>>>>      43         ****      agg_vt = get_aggregate(obs_type, stamp, 
>>>>>>> do_aggregate, db_manager,
>>>>>>>      44         ****               
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      45         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 136, in get_aggregate
>>>>>>>      46         ****      return xtype.get_aggregate(obs_type, 
>>>>>>> timespan, aggregate_type, db_manager,
>>>>>>>      47         ****             
>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>      48         ****    File "/usr/share/weewx/weewx/xtypes.py", 
>>>>>>> line 1168, in get_aggregate
>>>>>>>      49         ****      xsum += mag * math.cos(math.radians(90.0 - 
>>>>>>> direction))
>>>>>>>      50         ****                                         
>>>>>>>  ~~~~~^~~~~~~~~~~
>>>>>>>      51         ****  TypeError: unsupported operand type(s) for -: 
>>>>>>> 'float' and 'str'
>>>>>>>      52         ****  Generator terminated
>>>>>>>      53 rand type(s) for -: 'float' and 'str'
>>>>>>>      54 rand type(s) for -: 'float' and 'str'
>>>>>>>
>>>>>>> On Monday, 23 December 2024 at 18:53:18 UTC Auchtermuchty Weather 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I was getting errors. Process of elimination showed it was the 
>>>>>>>> monthwindvec image causing them, though not the day, week or year 
>>>>>>>> versions 
>>>>>>>> of that images.
>>>>>>>>
>>>>>>>> I suspect data is at the bottom of this, but what data? Nothing odd 
>>>>>>>> in archive.windGust or windGustDir.
>>>>>>>>
>>>>>>>> This is the latest WeeWx running on a Debian 12 virtual machine, 
>>>>>>>> and the database has the extended schema.
>>>>>>>>
>>>>>>>> Turning on debugging didn't bring any extra information.
>>>>>>>>
>>>>>>>> Caught unrecoverable exception in generator 
>>>>>>>> 'weewx.imagegenerator.ImageGenerator'
>>>>>>>>         ****  unsupported operand type(s) for -: 'float' and 'str'
>>>>>>>>         ****  Traceback (most recent call last):
>>>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 109, 
>>>>>>>> in get_series
>>>>>>>>         ****      return xtype.get_series(obs_type, timespan, 
>>>>>>>> db_manager, aggregate_type,
>>>>>>>>         ****             
>>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 1040, 
>>>>>>>> in get_series
>>>>>>>>         ****      return ArchiveTable.get_series(obs_type, 
>>>>>>>> timespan, db_manager, aggregate_type,
>>>>>>>>         ****             
>>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 210, 
>>>>>>>> in get_series
>>>>>>>>         ****      agg_vt = get_aggregate(obs_type, stamp, 
>>>>>>>> do_aggregate, db_manager,
>>>>>>>>         ****               
>>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 136, 
>>>>>>>> in get_aggregate
>>>>>>>>         ****      return xtype.get_aggregate(obs_type, timespan, 
>>>>>>>> aggregate_type, db_manager,
>>>>>>>>         ****             
>>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 1168, 
>>>>>>>> in get_aggregate
>>>>>>>>         ****      xsum += mag * math.cos(math.radians(90.0 - 
>>>>>>>> direction))
>>>>>>>>         ****                                         
>>>>>>>>  ~~~~~^~~~~~~~~~~
>>>>>>>>         ****  TypeError: unsupported operand type(s) for -: 'float' 
>>>>>>>> and 'str'
>>>>>>>>         ****
>>>>>>>>         ****  During handling of the above exception, another 
>>>>>>>> exception occurred:
>>>>>>>>         ****
>>>>>>>>         ****  Traceback (most recent call last):
>>>>>>>>         ****    File "/usr/share/weewx/weewx/reportengine.py", line 
>>>>>>>> 248, in run
>>>>>>>>         ****      obj.start()
>>>>>>>>         ****    File "/usr/share/weewx/weewx/reportengine.py", line 
>>>>>>>> 465, in start
>>>>>>>>
>>>>>>> -- 
>>>>>>> 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/e8d2f679-c9e7-46a2-9588-652cf0852a90n%40googlegroups.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/weewx-user/e8d2f679-c9e7-46a2-9588-652cf0852a90n%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/456aeb45-2d77-4136-bea2-22b0ecfb2004n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/weewx-user/456aeb45-2d77-4136-bea2-22b0ecfb2004n%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/863b352f-18cd-47c5-9e7b-000a8f8c1755n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/863b352f-18cd-47c5-9e7b-000a8f8c1755n%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/c9c59c59-76fd-4333-bc3b-a98331c14f4en%40googlegroups.com.

Reply via email to