Problem with SQLite after HA upgrade from 0.34.4 to 0.34.5

Hi
After upgrade HA from 0.34.4 to 0.34.5 I have problem with SQLite and history componnent. There isn’t any states changes in history componnent. Above errors from log. Any idea how to fix that?

16-12-14 08:07:54 sqlalchemy.pool.NullPool: Exception during reset or similar Traceback (most recent call last): File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 687, in _finalize_fairy fairy._reset(pool) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 829, in _reset pool._dialect.do_rollback(self) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/engine/default.py", line 439, in do_rollback dbapi_connection.rollback() sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1928143968 and this is thread id 1996316672 16-12-14 08:07:54 sqlalchemy.pool.NullPool: Exception closing connection <sqlite3.Connection object at 0x686f7ac0> Traceback (most recent call last): File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 687, in _finalize_fairy fairy._reset(pool) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 829, in _reset pool._dialect.do_rollback(self) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/engine/default.py", line 439, in do_rollback dbapi_connection.rollback() sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1928143968 and this is thread id 1996316672 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 300, in _close_connection self._dialect.do_close(connection) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/engine/default.py", line 445, in do_close dbapi_connection.close() sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1928143968 and this is thread id 1996316672 16-12-14 08:07:54 sqlalchemy.pool.NullPool: Exception during reset or similar Traceback (most recent call last): File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 687, in _finalize_fairy fairy._reset(pool) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 829, in _reset pool._dialect.do_rollback(self) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/engine/default.py", line 439, in do_rollback dbapi_connection.rollback() sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1898968160 and this is thread id 1996316672 16-12-14 08:07:54 sqlalchemy.pool.NullPool: Exception closing connection <sqlite3.Connection object at 0x6b4980a8> Traceback (most recent call last): File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 687, in _finalize_fairy fairy._reset(pool) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/pool.py", line 829, in _reset pool._dialect.do_rollback(self) File "/home/homeassistant/.homeassistant/deps/sqlalchemy/engine/default.py", line 439, in do_rollback dbapi_connection.rollback() sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1898968160 and this is thread id 1996316672

I’m not able to help you with the error but I had a few problems with SQLite so changed to using a Postgresql database on my Pi 3. It was very easy to do and took about 5 minutes and I have seen much improvement especially with History.

There is an easy to follow tutorial on the forum at Howto: Postgresql on Raspberry Pi All-In-One Installer

Hope this might help.

1 Like

Thank you. I will try Postgresql.

Unfortunately, after change to PostgreSQL still something is wrong. The History tab shows data only to midnight.