This is the full stack trace, completely outside of the Kubernetes land
2025-01-07 19:42:06.453 ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup: (retrying in 3 seconds)
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
self._dbapi_connection = engine.raw_connection()
~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 3302, in raw_connection
return self.pool.connect()
~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/impl.py", line 447, in connect
return _ConnectionFairy._checkout(self, self._fairy)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
rec = pool._do_get()
File "/usr/src/homeassistant/homeassistant/components/recorder/pool.py", line 95, in _do_get
return super()._do_get()
~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/impl.py", line 429, in _do_get
c = self._create_connection()
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
self.__connect()
~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 914, in __connect
)._exec_w_sync_on_first_run(self.dbapi_connection, self)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/event/attr.py", line 483, in _exec_w_sync_on_first_run
self(*args, **kw)
~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/event/attr.py", line 497, in __call__
fn(*args, **kw)
~~^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1373, in _setup_recorder_connection
if database_engine := setup_connection_for_dialect(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self,
^^^^^
...<2 lines>...
not self._completed_first_database_setup,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 512, in setup_connection_for_dialect
execute_on_connection(dbapi_connection, "PRAGMA journal_mode=WAL")
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 335, in execute_on_connection
cursor.execute(statement)
~~~~~~~~~~~~~~^^^^^^^^^^^
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 914, in _setup_recorder
self._setup_connection()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1429, in _setup_connection
migration.pre_migrate_schema(self.engine)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 322, in pre_migrate_schema
inspector = sqlalchemy.inspect(engine)
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/inspection.py", line 140, in inspect
ret = reg(subject)
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/reflection.py", line 312, in _engine_insp
return Inspector._construct(Inspector._init_engine, bind)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/reflection.py", line 245, in _construct
init(self, bind)
~~~~^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/reflection.py", line 256, in _init_engine
engine.connect().close()
~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 3278, in connect
return self._connection_cls(self)
~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 148, in __init__
Connection._handle_dbapi_exception_noconnection(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
err, dialect, engine
^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 2442, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
self._dbapi_connection = engine.raw_connection()
~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 3302, in raw_connection
return self.pool.connect()
~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/impl.py", line 447, in connect
return _ConnectionFairy._checkout(self, self._fairy)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
rec = pool._do_get()
File "/usr/src/homeassistant/homeassistant/components/recorder/pool.py", line 95, in _do_get
return super()._do_get()
~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/impl.py", line 429, in _do_get
c = self._create_connection()
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
self.__connect()
~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/pool/base.py", line 914, in __connect
)._exec_w_sync_on_first_run(self.dbapi_connection, self)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/event/attr.py", line 483, in _exec_w_sync_on_first_run
self(*args, **kw)
~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/sqlalchemy/event/attr.py", line 497, in __call__
fn(*args, **kw)
~~^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1373, in _setup_recorder_connection
if database_engine := setup_connection_for_dialect(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self,
^^^^^
...<2 lines>...
not self._completed_first_database_setup,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 512, in setup_connection_for_dialect
execute_on_connection(dbapi_connection, "PRAGMA journal_mode=WAL")
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 335, in execute_on_connection
cursor.execute(statement)
~~~~~~~~~~~~~~^^^^^^^^^^^
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
(Background on this error at: https://sqlalche.me/e/20/e3q8)
2025-01-07 19:42:09.555 ERROR (Recorder) [homeassistant.components.recorder.util] The database at //config/home-assistant_v2.db is corrupt or malformed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 274, in validate_sqlite_database
run_checks_on_open_db(dbpath, conn.cursor())
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 285, in run_checks_on_open_db
sanity_check_passed = basic_sanity_check(cursor)
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 261, in basic_sanity_check
cursor.execute(
~~~~~~~~~~~~~~^
f"SELECT * FROM {table} LIMIT 1;" # noqa: S608 # not injection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
sqlite3.OperationalError: no such table: states
2025-01-07 19:42:09.560 ERROR (Recorder) [homeassistant.components.recorder.util] The system will rename the corrupt database file //config/home-assistant_v2.db to //config/home-assistant_v2.db.corrupt.2025-01-07T19:42:09.559983+00:00 in order to allow startup to proceed
2025-01-07 19:42:11.381 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2025-01-07 19:42:14.587 ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup: (retrying in 3 seconds)
Could this be Ubuntu related then I wonder. I’m going to try flashing a diff OS. maybe even try from a windows laptop.