Memory Error when running wee_database --check

66 views
Skip to first unread message

Andrew M

unread,
Dec 30, 2020, 10:46:59 AM12/30/20
to weewx-user

My search for a solution resulted in not finding anything. I apologize if I missed it. 

I was seeing some oddities in Daily Summaries. I stopped weewx and then ran wee_database --check and received "MemoryError"

Any suggestions?

Thank you in advance.

----

Below are the results from using wee_database --check

@weather:/usr/bin $ sudo wee_database --check
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
Checking daily summary tables version...
Daily summary tables are at version 2.0
Interval Weighting Fix is not required.
Daily summary tables version check completed in 0.53 seconds.
Preparing Null String Fix, this may take a while...
Traceback (most recent call last):
File "/usr/share/weewx/wee_database", line 974, in <module>
main()
File "/usr/share/weewx/wee_database", line 151, in main
check(config_dict, db_binding, options)
File "/usr/share/weewx/wee_database", line 518, in check
check_strings(config_dict, db_binding, options, fix=False)
File "/usr/share/weewx/wee_database", line 767, in check_stringsfor record in dbmanager.genBatchRows():
File "/usr/share/weewx/weewx/manager.py", line 346, in genBatchRows
"SELECT * FROM %s ORDER BY dateTime ASC" % self.table_name)
File "/usr/share/weewx/weedb/mysql.py", line 52, in guarded_fn
return fn(*args, **kwargs)
File "/usr/share/weewx/weedb/mysql.py", line 262, in execute
self.cursor.execute(mysql_string, tuple(sql_tuple))
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 247, in execute
res = self._query(query)
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 412, in _query
self._post_get_result()
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 416, in _post_get_result
self._rows = self._fetch_row(0)
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 384, in _fetch_row
return self._result.fetch_row(size, self._fetch_type)
MemoryError

Debug attached. Other details:

Raspi details:
RaspberryPi 4
ARMv7
Buster 10.6
Running Raspi using a 240 GB SSD drive
No overclocking

Results of “free”
Mem:       
Total 8063912
Used 233544     
Free 7378124
Sharedcc 52148
buff/cache 452244
available 7539256

Swap:
Total 102396     
Used 0
Free 102396


weewx_debug.txt

Karen K

unread,
Dec 30, 2020, 11:29:02 AM12/30/20
to weewx-user
Did you try to restart MySQL?

Could you access the database by some SQL tool?

You could enter the following SQL statement:
select * from archive;

Does that result in a list of values? 

Andrew M

unread,
Dec 30, 2020, 4:40:47 PM12/30/20
to weewx-user

The MySQL/Maria DB is hosted remotely. I have no issues writing data to that DB
I used MySQL/Maria command line from the RaspberryPi to execute the query select * from archive;  

At the time of this message my DB has about 3909106 rows. If I just use the * option in the query after about 20 minutes of the results scrolling by my RaspberryPi terminal window "crashes". Tried this two times. 
If I do a query asking for less columns of data the query is completing. 

So, I suspect I really could be running out of memory and that's why the terminal window is crashing?  Not quite sure where this would be in logs. I don't think i see anything in syslog or messages log.

-andrew
Reply all
Reply to author
Forward
0 new messages