Automatic recover from interrupted mySQL service

Tags: #<Tag:0x00007f61829a2a50>

How can OH recover automatically from a temporary interrupted mySQL service?

When the (remote) mySQL service is (temporarily) not available for whatever reason, persistence extension functions like e.g. .deltaSince(AbstractInstant) result naturally in an error like:
2017-12-14 10:52:49.916 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Connection is not valid!
2017-12-14 10:52:49.917 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Error running querying :

When the (remote) mysql service does become available again, OH1 does not restore its mySQL connection and keeps on repeating above error messages. Manually restarting OH does solve this problem (which I don’t like in unattended situations of course)

PS: I am running OH1 with mysql persistence plugin v1.9.0 on a RaspberryPi (jessie); mysql is running on another Ubuntu server in my LAN.

The best I could recommend is to file an issue. I’m not sure if OH 1.x and 2.x share the same baseline. If not, I’m not sure this will get fixed.

I believe the openhab1-addons repo is the correct location.

This might already be fixed in the OH 2.x baseline if they do not share a different baseline.

To test OH2.2.0 snapshot 1114, I stopped and restarted the mariadb service. OH persistence continued after it was restarted.

1 Like

Thanks all for the feedback. Another reason to schedule some time for migrating to OH2.