Hello, I ran into a weird issue that prevented me from restarting my server… after some hours of trying to resolve the issue I concluded that I could not, I therefore decided to restore a snapshot I made earlier same day.
However, I’m not sure this was a good idea, I am seeing a ton of other issue now
Many things that relies on date time seems to be broken, for example time charts didn’t work properly. Also the log book doesn’t show anything anymore. I thought it would just be a bit out of sync, but it’s now two days later and its still not showing anything. when i change the search time interval, no cigar. the log book is empty.
When I look at the logs I also see a lot of errors that I haven’t seen before. One in particular sounds very scary… “database disk image is malformed”
I hope someone can tell me what to do. In advance thanks!
Logger: homeassistant.components.recorder
Source: components/recorder/init.py:509
Integration: Recorder (documentation, issues)
First occurred: October 29, 2020, 12:30:32 AM (6414 occurrences)
Last logged: 9:05:52 AM
- Error saving events: (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-10-29 23:34:42.469303’, ‘2020-10-29 23:34:42.469303’, ‘fa8050fe3a4xxx064a52ff6fe7184842’, None, None)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)
- Error saving events: (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-10-29 23:34:44.347480’, ‘2020-10-29 23:34:44.347480’, ‘536814155cxxx647ddda8e70c31bd39b’, None, None)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)
- Error saving events: (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-10-29 23:34:53.170589’, ‘2020-10-29 23:34:53.170589’, ‘d619a5920ab817xxxaaac4c6f5e21b58’, None, None)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)
- Error saving events: (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-10-29 23:35:12.448356’, ‘2020-10-29 23:35:12.448356’, ‘4f271cedc870xxxe2a70633240c479cf’, None, None)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)
- Error saving events: (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-10-29 23:35:14.541055’, ‘2020-10-29 23:35:14.541055’, ‘aa1a80e078d4xxxc543f525e7a2dc0f8’, None, None)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)
Traceback (most recent call last): File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 1276, in _execute_context self.dialect.do_execute( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py”, line 593, in do_execute cursor.execute(statement, parameters) sqlite3.DatabaseError: database disk image is malformed The above exception was the direct cause of the following exception: Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/recorder/init.py”, line 454, in _commit_event_session_or_retry self._commit_event_session() File “/usr/src/homeassistant/homeassistant/components/recorder/init.py”, line 509, in _commit_event_session self.event_session.flush() File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py”, line 2536, in flush self._flush(objects) File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py”, line 2678, in flush transaction.rollback(capture_exception=True) File “/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py”, line 68, in exit compat.raise( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py”, line 182, in raise raise exception File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py”, line 2638, in flush flush_context.execute() File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py”, line 419, in execute n.execute_aggregate(self, set) File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py”, line 521, in execute_aggregate self.execute(uow) File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py”, line 586, in execute persistence.save_obj( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py”, line 239, in save_obj _emit_insert_statements( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py”, line 1135, in _emit_insert_statements result = cached_connections[connection].execute( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 1011, in execute return meth(self, multiparams, params) File “/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py”, line 298, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 1124, in _execute_clauseelement ret = self._execute_context( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 1316, in _execute_context self.handle_dbapi_exception( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 1510, in handle_dbapi_exception util.raise( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py”, line 182, in raise raise exception File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 1276, in _execute_context self.dialect.do_execute( File “/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py”, line 593, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.DatabaseError: (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-10-28 23:29:06.226915’, ‘2020-10-28 23:29:06.226915’, ‘228c9b85b56dexxxd5e83fc9b0ec3a78’, None, None)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)