Database Errors

Hi all,

Ever since I updated to 0.95.4, I’m getting database errors multiple times per day. The errors seem to come in pairs, first a “Error executing query” and then a “Error in database connectivity.” They also always seem to happen when inserting an event for sun.sun.

I’m running Home Assistant in docker, using a mariadb database in another docker as the recorder, and my OS is Unraid. Below are the two errors:

2019-07-14 03:50:11 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (MySQLdb._exceptions.OperationalError) (2006, 'MySQL server has gone away')
[SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (%s, %s, %s, %s, %s, %s, %s)]
[parameters: ('state_changed', '{"entity_id": "sun.sun", "old_state": {"entity_id": "sun.sun", "state": "below_horizon", "attributes": {"next_dawn": "2019-07-14T12:22:22+00:00", "ne ... (958 characters truncated) ... :00", "last_updated": "2019-07-14T10:50:11.001745+00:00", "context": {"id": "4a22c311f83c4e6892fe385a10f4bc56", "parent_id": null, "user_id": null}}}', 'LOCAL', datetime.datetime(2019, 7, 14, 10, 50, 11, 1791, tzinfo=<UTC>), datetime.datetime(2019, 7, 14, 10, 50, 11, 5570), '4a22c311f83c4e6892fe385a10f4bc56', None)]
(Background on this error at: http://sqlalche.me/e/e3q8)
2019-07-14 03:50:11 ERROR (Recorder) [homeassistant.components.recorder] Error in database connectivity: (MySQLdb._exceptions.OperationalError) (2006, 'MySQL server has gone away')
[SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (%s, %s, %s, %s, %s, %s, %s)]
[parameters: ('state_changed', '{"entity_id": "sun.sun", "old_state": {"entity_id": "sun.sun", "state": "below_horizon", "attributes": {"next_dawn": "2019-07-14T12:22:22+00:00", "ne ... (958 characters truncated) ... :00", "last_updated": "2019-07-14T10:50:11.001745+00:00", "context": {"id": "4a22c311f83c4e6892fe385a10f4bc56", "parent_id": null, "user_id": null}}}', 'LOCAL', datetime.datetime(2019, 7, 14, 10, 50, 11, 1791, tzinfo=<UTC>), datetime.datetime(2019, 7, 14, 10, 50, 11, 5570), '4a22c311f83c4e6892fe385a10f4bc56', None)]
(Background on this error at: http://sqlalche.me/e/e3q8). (retrying in 3 seconds)

Let me know if you need more information. Thanks for any insight you can provide!!

That suggests that either the database server has restarted, or there’s been a communication problem between the containers.

You’re likely seeing it with sun.sun since that updates every minute.

Is there any way for me to test this theory? There is nothing in the docker log on the mariadb container that would indicate the service is going down.
It seems strange to me that this would be on the mariadb side when the errors started occurring after an update to HA.