I guess I didn’t fix it after all. I am now on Version core-2021.6.0
. It would be ok for a week and then all graphs flatline. I am clueless of how to fix this? I would think by dropping all tables and start new, it will work. Help?
config:
recorder:
db_url: !secret MySQL_login # External MySQL DB.
purge_keep_days: 4
exclude:
domains:
- group
- automation
- camera
- media_player
- scene
- script
entities:
- sun.sun
- sensor.date_time
Error:
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-06-27T05:46:30.089012+09:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('state_changed', '{}', 'LOCAL', datetime.datetime(2021, 6, 26, 20, 46, 29, 837416, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 26, 20, 46, 29, 837416, tzinfo=datetime.timezone.utc), '474361fe88daf6e70a82a8eec0c010ca', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)
6:51:04 AM – (ERROR) Recorder - message first occurred at June 26, 2021, 8:27:13 PM and shows up 20 times
Database connection invalidated: Error executing query: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('state_changed', '{}', 'LOCAL', datetime.datetime(2021, 6, 26, 20, 46, 29, 837416, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 26, 20, 46, 29, 837416, tzinfo=datetime.timezone.utc), '474361fe88daf6e70a82a8eec0c010ca', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8). (retrying in 3 seconds)
6:51:01 AM – (ERROR) Recorder - message first occurred at June 26, 2021, 8:27:10 PM and shows up 20 times
Error handling request
6:33:01 AM – (ERROR) components/recorder/util.py - message first occurred at June 26, 2021, 8:21:01 PM and shows up 5 times
Error executing query: Can't reconnect until invalid transaction is rolled back. (Background on this error at: http://sqlalche.me/e/14/8s2b)
6:33:01 AM – (ERROR) Recorder - message first occurred at June 26, 2021, 8:21:01 PM and shows up 5 times
Error executing query: Can't reconnect until invalid transaction is rolled back. (Background on this error at: http://sqlalche.me/e/14/8s2b)
6:33:01 AM – (ERROR) Recorder - message first occurred at June 26, 2021, 8:21:01 PM and shows up 15 times
Error doing job: Task exception was never retrieved
6:22:22 AM – (ERROR) /usr/src/homeassistant/homeassistant/runner.py - message first occurred at 3:06:18 AM and shows up 6 times
Error handling request
6:21:27 AM – (ERROR) components/websocket_api/http.py - message first occurred at 3:05:23 AM and shows up 6 times
Exact Error message. How to issue a rollback?
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-06-27T06:07:29.084823+09:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('state_changed', '{}', 'LOCAL', datetime.datetime(2021, 6, 26, 21, 7, 28, 825461, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 26, 21, 7, 28, 825461, tzinfo=datetime.timezone.utc), '73143a2d8968c24bbe90a0bd4c564c54', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-06-27T06:12:48.001046+09:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('state_changed', '{}', 'LOCAL', datetime.datetime(2021, 6, 26, 21, 12, 47, 874719, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 26, 21, 12, 47, 874719, tzinfo=datetime.timezone.utc), '25395ea3efc7c47be058c1e08822867d', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-06-27T06:12:59.001823+09:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2013, "Lost connection to MySQL server at 'reading authorization packet', system error: 11") (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-06-27T06:13:49.001829+09:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('call_service', '{"domain": "mqtt", "service": "publish", "service_data": {"topic": "/appliance/2009228823079551802948e1e934c753/subscribe", "payload": "{\\"header\\" ... (203 characters truncated) ... e1e934c753/system\\", \\"timestamp\\": 1609405973, \\"timestampMs\\": 980, \\"sign\\": \\"fd3d14744e3d07dfcfa0e3991d9ee3dc\\"}, \\"payload\\": {}}"}}', 'LOCAL', datetime.datetime(2021, 6, 26, 21, 13, 48, 422871, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 26, 21, 13, 48, 422871, tzinfo=datetime.timezone.utc), '83c362c7517e369c918120ae21ca5082', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-06-27T06:14:00.042106+09:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('state_changed', '{}', 'LOCAL', datetime.datetime(2021, 6, 26, 21, 13, 59, 314988, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 26, 21, 13, 59, 314988, tzinfo=datetime.timezone.utc), '6e54bc4d5827ce42019ea61b70f4a03f', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)