Error in logs, but working fine

I’m getting these errors in my logs, but the systems seems to be working fine.

I’m running a Mac OSX and a total noob.

> The above exception was the direct cause of the following exception:

> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/recorder/__init__.py", line 188, in run
>     self._setup_connection()
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/recorder/__init__.py", line 269, in _setup_connection
>     models.Base.metadata.create_all(self.engine)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/sql/schema.py", line 3745, in create_all
>     tables=tables)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1856, in _run_visitor
>     conn._run_visitor(visitorcallable, element, **kwargs)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1481, in _run_visitor
>     **kwargs).traverse_single(element)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/sql/visitors.py", line 121, in traverse_single
>     return meth(obj, **kw)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/sql/ddl.py", line 709, in visit_metadata
>     [t for t in tables if self._can_create_table(t)])
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/sql/ddl.py", line 709, in <listcomp>
>     [t for t in tables if self._can_create_table(t)])
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/sql/ddl.py", line 686, in _can_create_table
>     table.name, schema=table.schema)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/dialects/sqlite/base.py", line 1139, in has_table
>     connection, "table_info", table_name, schema=schema)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/dialects/sqlite/base.py", line 1480, in _get_table_pragma
>     cursor = connection.execute(statement)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 906, in execute
>     return self._execute_text(object, multiparams, params)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1054, in _execute_text
>     statement, parameters
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1146, in _execute_context
>     context)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
>     exc_info
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/util/compat.py", line 202, in raise_from_cause
>     reraise(type(exception), exception, tb=exc_tb, cause=cause)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/util/compat.py", line 185, in reraise
>     raise value.with_traceback(tb)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1139, in _execute_context
>     context)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/default.py", line 450, in do_execute
>     cursor.execute(statement, parameters)
> sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'PRAGMA table_info("recorder_runs")']
> 16-08-29 18:25:02 homeassistant.components.sensor.efergy: Could not update status for Energy Usage
> 16-08-29 18:25:12 homeassistant.components.recorder: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'PRAGMA table_info("recorder_runs")']
> Traceback (most recent call last):
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/base.py", line 1139, in _execute_context
>     context)
>   File "/Users/Hilton/.homeassistant/deps/sqlalchemy/engine/default.py", line 450, in do_execute
>     cursor.execute(statement, parameters)
> sqlite3.DatabaseError: database disk image is malformed

This can be associated with a corrupted database. Try moving the database files out of your conifg directory.
If the error persists just move them back.

1 Like

Thank you. I deleted the database file and it corrected itself. Thank you!!