Anyone having issue with MariaDB when upgrading, seems to fail at the DB migration phase with a connection issue after about 40-50 minutes, but the DB doesn’t go down, any help greatly appreciated, I have had to restore the DB and regress to 0.111.4 for now.:
2020-07-02 11:56:17 WARNING (Recorder) [homeassistant.components.recorder.migration] Database is about to upgrade. Schema version: 7
2020-07-02 11:56:17 WARNING (Recorder) [homeassistant.components.recorder.migration] Adding columns context_parent_id to table events. Note: this can take several minutes on large databases and slow computers. Please be patient!
2020-07-02 11:56:26 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2020-07-02 12:37:54 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8)
2020-07-02 12:37:54 ERROR (Recorder) [sqlalchemy.pool.impl.QueuePool] Exception during reset or similar
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2345, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 500, in checkout
rec._checkin_failed(err)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 497, in checkout
dbapi_connection = rec.get_connection()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 610, in get_connection
self.__connect()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 27, in session_scope
yield session
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 52, in migrate_schema
_apply_update(instance.engine, new_version, current_version)
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 268, in _apply_update
_add_columns(engine, "events", ["context_parent_id CHARACTER(36)"])
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 203, in _add_columns
table=table_name, column_def=column_def
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2243, in execute
connection = self._contextual_connect(close_with_result=True)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2311, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2349, in _wrap_pool_connect
e, dialect, self
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1591, in _handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2345, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 500, in checkout
rec._checkin_failed(err)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 497, in checkout
dbapi_connection = rec.get_connection()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 610, in get_connection
self.__connect()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 752, in _rollback_impl
self.engine.dialect.do_rollback(self.connection)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/base.py", line 2351, in do_rollback
dbapi_connection.rollback()
MySQLdb._exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 697, in _finalize_fairy
fairy._reset(pool)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 891, in _reset
self._reset_agent.rollback()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1760, in rollback
self._do_rollback()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1798, in _do_rollback
self.connection._rollback_impl()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 754, in _rollback_impl
self._handle_dbapi_exception(e, None, None, None, None)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1518, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 752, in _rollback_impl
self.engine.dialect.do_rollback(self.connection)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/base.py", line 2351, in do_rollback
dbapi_connection.rollback()
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query')
(Background on this error at: http://sqlalche.me/e/e3q8)
2020-07-02 12:37:54 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:37:57 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:00 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:03 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:06 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:09 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:12 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:16 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:19 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:22 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:22 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Integration failed to initialize.