WeeWX keeps crashing

53 views
Skip to first unread message

dave.sp...@gmail.com

unread,
May 30, 2020, 8:17:55 PM5/30/20
to weewx...@googlegroups.com

This morning, I noticed that I was not getting any data from WeeWX. I am running weewx ver 3.9.1 on a raspberry pi. I have reboot the raspberry pi to see if it would fix the issue but still nothing. When I look at that tail -f /var/log/syslog Here is the error that I am getting.

 

May 30 18:07:46 raspberrypi weewx[467]: manager: Added record 2020-05-30 18:07:30 MDT (1590883650) to database 'weewx'

May 30 18:07:46 raspberrypi weewx[467]: engine: Main loop exiting. Shutting engine down.

May 30 18:07:46 raspberrypi weewx[467]: engine: Shutting down StdReport thread

May 30 18:07:46 raspberrypi weewx[467]: engine: Caught unrecoverable exception in engine:

May 30 18:07:46 raspberrypi weewx[467]:     ****  unsupported operand type(s) for +=: 'NoneType' and 'float'

May 30 18:07:46 raspberrypi weewx[467]:     ****  Traceback (most recent call last):

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 890, in main

May 30 18:07:46 raspberrypi weewx[467]:     ****      engine.run()

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 202, in run

May 30 18:07:46 raspberrypi weewx[467]:     ****      self.dispatchEvent(weewx.Event(weewx.POST_LOOP))

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 224, in dispatchEvent

May 30 18:07:46 raspberrypi weewx[467]:     ****      callback(event)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 582, in post_loop

May 30 18:07:46 raspberrypi weewx[467]:     ****      self._software_catchup()

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 646, in _software_catchup

May 30 18:07:46 raspberrypi weewx[467]:     ****      self.engine.dispatchEvent(weewx.Event(weewx.NEW_ARCHIVE_RECORD, record=record, origin='software'))

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 224, in dispatchEvent

May 30 18:07:46 raspberrypi weewx[467]:     ****      callback(event)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/engine.py", line 601, in new_archive_record

May 30 18:07:46 raspberrypi weewx[467]:     ****      dbmanager.addRecord(event.record, accumulator=self.old_accumulator)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/manager.py", line 246, in addRecord

May 30 18:07:46 raspberrypi weewx[467]:     ****      self._addSingleRecord(record, cursor, log_level)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/manager.py", line 1216, in _addSingleRecord

May 30 18:07:46 raspberrypi weewx[467]:     ****      _day_summary.addRecord(record, weight=_weight)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/accum.py", line 256, in addRecord

May 30 18:07:46 raspberrypi weewx[467]:     ****      func(self, record, obs_type, add_hilo, weight)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/accum.py", line 315, in add_value

May 30 18:07:46 raspberrypi weewx[467]:     ****      self[obs_type].addSum(val, weight=weight)

May 30 18:07:46 raspberrypi weewx[467]:     ****    File "/home/weewx/bin/weewx/accum.py", line 94, in addSum

May 30 18:07:46 raspberrypi weewx[467]:     ****      self.sum     += val

May 30 18:07:46 raspberrypi weewx[467]:     ****  TypeError: unsupported operand type(s) for +=: 'NoneType' and 'float'

May 30 18:07:46 raspberrypi weewx[467]:     ****  Exiting.

 

 

How do I get weewx working again?

 

Thanks

Dave

John Kline

unread,
May 30, 2020, 8:31:46 PM5/30/20
to weewx...@googlegroups.com
Did you change the default version of Python to 3?

What is the output of:
python —version

On May 30, 2020, at 5:17 PM, dave.sp...@gmail.com wrote:


--
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/008201d636e0%24ea6155b0%24bf240110%24%40gmail.com.

dave.sp...@gmail.com

unread,
May 30, 2020, 8:35:44 PM5/30/20
to weewx...@googlegroups.com

Ok. I did a little bit more troubleshooting on this and it appears that I have a database corruption. I took a backup of my existing database for weewx which is on MySQL. Let it recreate the database and now it is stable.

 

Is there a way for weewx to repair the database so that I don’t loose all of my data?

 

When I ran python –version is came back as Python 2.7.13

 

Dave

Tom Keffer

unread,
May 30, 2020, 8:45:37 PM5/30/20
to weewx-user
I would guess that the column 'sum' in one of the daily summaries now has a value of "null" instead of 0. If you have a good idea which table it is (there are dozens!), you could search for it. For example:

sqlite3 weewx.sdb
sqlite> select dateTime, sum from archive_day_rain where sum=null;

But, if you don't know which table, this could get pretty tedious.

Fortunately, you have a backup, right? ☺

-tk

dave.sp...@gmail.com

unread,
May 30, 2020, 9:36:44 PM5/30/20
to weewx...@googlegroups.com

Thanks Tom for that info. As soon as you told me that, I knew exactly what tables to fix. I had an some bad data this morning that I fixed. Instead on putting a 0 in its place I just nulled it out. I is now back up and running all of the way with all of my data?

 

Since I am running an old version of weewx 3.9.1, how old will it be to upgrade to the latest? What steps would I take to do that?

 

Thanks

Dave

Tom Keffer

unread,
May 30, 2020, 9:41:33 PM5/30/20
to weewx-user
No reason to upgrade unless you want to use Python 3. 

It appears that you used the setup.py install method. If your RPi is running Stretch or Buster, upgrading is pretty easy. Just follow the directions: http://www.weewx.com/docs/setup.htm. If it's an older version, you might have to work harder getting the pre-requisites installed.

-tk

Reply all
Reply to author
Forward
0 new messages