Hi, after some hussel around sd card images (i.e. restoring snapshots) and some updates this errors occures:
2018-11-01 22:37:01 ERROR (SyncWorker_4) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT events.event_id AS events_event_id, events.event_type AS events_event_type, events.event_data AS events_event_data, events.origin AS events_origin, events.time_fired AS events_time_fired, events.created AS events_created, events.context_id AS events_context_id, events.context_user_id AS events_context_user_id \nFROM events LEFT OUTER JOIN states ON events.event_id = states.event_id \nWHERE events.event_type IN (?, ?, ?, ?, ?, ?) AND events.time_fired > ? AND events.time_fired < ? AND (states.last_updated = states.last_changed OR states.state_id IS NULL) ORDER BY events.time_fired'] [parameters: ('state_changed', 'logbook_entry', 'homeassistant_start', 'homeassistant_stop', 'alexa_smart_home', 'homekit_state_change', '2018-10-31 23:00:00.000000', '2018-11-01 23:00:00.000000')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:02 ERROR (SyncWorker_4) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT events.event_id AS events_event_id, events.event_type AS events_event_type, events.event_data AS events_event_data, events.origin AS events_origin, events.time_fired AS events_time_fired, events.created AS events_created, events.context_id AS events_context_id, events.context_user_id AS events_context_user_id \nFROM events LEFT OUTER JOIN states ON events.event_id = states.event_id \nWHERE events.event_type IN (?, ?, ?, ?, ?, ?) AND events.time_fired > ? AND events.time_fired < ? AND (states.last_updated = states.last_changed OR states.state_id IS NULL) ORDER BY events.time_fired'] [parameters: ('state_changed', 'logbook_entry', 'homeassistant_start', 'homeassistant_stop', 'alexa_smart_home', 'homekit_state_change', '2018-10-31 23:00:00.000000', '2018-11-01 23:00:00.000000')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:02 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, 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/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 66, in staticresource_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 113, in handle
result = await result
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/logbook.py", line 155, in get
return await hass.async_add_job(json_events)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/logbook.py", line 153, in json_events
_get_events(hass, self.config, start_day, end_day, entity_id)))
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/logbook.py", line 338, in _get_events
events = execute(query)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/recorder/util.py", line 64, in execute
(row.to_native() for row in qry)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2988, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3011, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT events.event_id AS events_event_id, events.event_type AS events_event_type, events.event_data AS events_event_data, events.origin AS events_origin, events.time_fired AS events_time_fired, events.created AS events_created, events.context_id AS events_context_id, events.context_user_id AS events_context_user_id \nFROM events LEFT OUTER JOIN states ON events.event_id = states.event_id \nWHERE events.event_type IN (?, ?, ?, ?, ?, ?) AND events.time_fired > ? AND events.time_fired < ? AND (states.last_updated = states.last_changed OR states.state_id IS NULL) ORDER BY events.time_fired'] [parameters: ('state_changed', 'logbook_entry', 'homeassistant_start', 'homeassistant_stop', 'alexa_smart_home', 'homekit_state_change', '2018-10-31 23:00:00.000000', '2018-11-01 23:00:00.000000')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:04 ERROR (SyncWorker_5) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:05 ERROR (SyncWorker_5) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:05 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, 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/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 66, in staticresource_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 113, in handle
result = await result
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 332, in get
entity_ids, self.filters, include_start_time_state)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 93, in get_significant_states
include_start_time_state)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 239, in states_to_json
for state in get_states(hass, start_time, entity_ids, filters=filters):
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 214, in get_states
return [state for state in execute(query)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/recorder/util.py", line 64, in execute
(row.to_native() for row in qry)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2988, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3011, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:17 WARNING (MainThread) [homeassistant.components.sensor] Updating mitemp_bt sensor took longer than the scheduled update interval 0:00:30
2018-11-01 22:37:23 ERROR (SyncWorker_17) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:24 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, 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/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 66, in staticresource_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 113, in handle
result = await result
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 332, in get
entity_ids, self.filters, include_start_time_state)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 93, in get_significant_states
include_start_time_state)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 239, in states_to_json
for state in get_states(hass, start_time, entity_ids, filters=filters):
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 214, in get_states
return [state for state in execute(query)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/recorder/util.py", line 64, in execute
(row.to_native() for row in qry)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2988, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3011, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:30 ERROR (SyncWorker_7) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-11-01 22:37:30 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, 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/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 66, in staticresource_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 113, in handle
result = await result
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 332, in get
entity_ids, self.filters, include_start_time_state)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 93, in get_significant_states
include_start_time_state)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 239, in states_to_json
for state in get_states(hass, start_time, entity_ids, filters=filters):
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/history.py", line 214, in get_states
return [state for state in execute(query)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/recorder/util.py", line 64, in execute
(row.to_native() for row in qry)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2988, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3011, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created, states.context_id AS states_context_id, states.context_user_id AS states_context_user_id \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states JOIN (SELECT states.entity_id AS max_entity_id, max(states.last_updated) AS max_last_updated \nFROM states \nWHERE states.last_updated >= ? AND states.last_updated < ? GROUP BY states.entity_id) AS anon_2 ON states.entity_id = anon_2.max_entity_id AND states.last_updated = anon_2.max_last_updated GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id \nWHERE states.domain NOT IN (?, ?) AND states.domain NOT IN (?, ?)'] [parameters: ('2018-10-29 20:44:05.094442', '2018-10-31 23:00:00.000000', 'zone', 'scene', 'zone', 'scene')] (Background on this error at: http://sqlalche.me/e/4xp6)
Connected
I already tried to delete log file from /homeassistant/config/home-assistant.log, but this error still occures everytime I am trying to access History tab.
Any ideas please?