I have pages of this repeating error. Does anyone know what it is and how I can solve it? Thanks!
2020-07-11 16:59:39 ERROR (Recorder) [homeassistant.components.recorder] Error adding event: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed
[SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('service_registered', '{"domain": "recorder", "service": "purge"}', 'LOCAL', '2020-07-11 21:47:50.290131', '2020-07-11 21:56:59.181541', 'e8c914c5a9ad4c6c89f74489cc88abb5', None, None)]
(Background on this error at: http://sqlalche.me/e/4xp6) (Background on this error at: http://sqlalche.me/e/7s2a)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 379, in run
self.event_session.flush()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2523, in flush
self._flush(objects)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2619, in _flush
subtransactions=True
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 953, in begin
self.transaction = self.transaction._begin(nested=nested)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 317, in _begin
self._assert_active()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 296, in _assert_active
code="7s2a",
sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed
[SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('service_registered', '{"domain": "recorder", "service": "purge"}', 'LOCAL', '2020-07-11 21:47:50.290131', '2020-07-11 21:56:59.181541', 'e8c914c... ...f74489cc88abb5', None, None)]
(Background on this error at: http://sqlalche.me/e/4xp6) (Background on this error at: http://sqlalche.me/e/7s2a)