Homeassistant components recorder

Dear People, I have recently updated hassio to version 0.113.3. Since then I get a log full of messages from the recorder integration. Does anyone have an idea how to solve this.

Error saving events: 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: (‘state_changed’, ‘{}’, ‘LOCAL’, ‘2020-08-05 08:56:04.119073’, ‘2020-08-05 08:56:04.126186’, ‘2b6289851eca4945ada01cc9ba2abada’, None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)

10:56:15 – Recorder (ERROR) - bericht kwam voor het eerst om 10:42:12 en verschijnt 302 malen

Error executing query: 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: (‘state_changed’, ‘{}’, ‘LOCAL’, ‘2020-08-05 08:56:04.119073’, ‘2020-08-05 08:56:04.126186’, ‘2b6289851eca4945ada01cc9ba2abada’, None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)

10:56:15 – Recorder (ERROR) - bericht kwam voor het eerst om 10:42:12 en verschijnt 302 malen

Error adding state change: 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: (‘state_changed’, ‘{}’, ‘LOCAL’, ‘2020-08-05 08:56:04.119073’, ‘2020-08-05 08:56:04.126186’, ‘2b6289851eca4945ada01cc9ba2abada’, None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)

10:56:14 – Recorder (ERROR) - bericht kwam voor het eerst om 10:42:14 en verschijnt 1243 malen

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: (‘state_changed’, ‘{}’, ‘LOCAL’, ‘2020-08-05 08:56:04.119073’, ‘2020-08-05 08:56:04.126186’, ‘2b6289851eca4945ada01cc9ba2abada’, None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)

10:56:14 – Recorder (ERROR) - bericht kwam voor het eerst om 10:42:11 en verschijnt 972 malen

Error adding event: (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: (‘state_changed’, ‘{}’, ‘LOCAL’, ‘2020-08-05 08:56:04.119073’, ‘2020-08-05 08:56:04.126186’, ‘2b6289851eca4945ada01cc9ba2abada’, None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6)

10:56:14 – Recorder (ERROR) - bericht kwam voor het eerst om 10:42:14 en verschijnt 302 malen

Error in database connectivity during keepalive: 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: (‘state_changed’, ‘{}’, ‘LOCAL’, ‘2020-08-05 08:47:16.608495’, ‘2020-08-05 08:47:16.615845’, ‘45a493bf6ae143839d8ab625abaf3ed3’, None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)

10:47:17 – Recorder (ERROR)

Delete the home-assistant_v2.db and restart HA.

where do i do that?

In your config directory, where the configuration.yaml, automation.yaml, … lives.

I think you mean this, but it’s empty

No, i mean the file home-assistant_v2.db in your config directory.

Top, thank you. I now receive the following message:

Logger: homeassistant.components.sensor
Source: components/systemmonitor/sensor.py:151
Integration: Sensor (documentation, issues)
First occurred: 11:24:50 (1 occurrences)
Last logged: 11:24:50

systemmonitor: Error on device update!

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 320, in _async_add_entity await entity.async_device_update(warning=False) File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 465, in async_device_update await self.hass.async_add_executor_job( File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run result = self.fn(*self.args, **self.kwargs) File “/usr/src/homeassistant/homeassistant/components/systemmonitor/sensor.py”, line 151, in update self._state = round(psutil.disk_usage(self.argument).free / 1024 ** 3, 1) File “/usr/local/lib/python3.8/site-packages/psutil/init.py”, line 2013, in disk_usage return _psplatform.disk_usage(path) File “/usr/local/lib/python3.8/site-packages/psutil/_psposix.py”, line 121, in disk_usage st = os.statvfs(path) FileNotFoundError: [Errno 2] No such file or directory: ‘’

Besides deleting the database, is there a different way to get ride of this error. Basically I’ve just finished my ZHA components and don’t want to start over again.

By deleting the database, you only loose your history, not your devices.
But you can search the forum for ‘sqlite recover’ or something to repair the db if you want.

EDIT: Here’s one