Is the MySQL persistence add-on not able to reconnect? Am I missing some settings for reconnecting?
I see no problems with the MySQL server, and the “connection is not valid” came spontaneously while trying to write new data, and continues. Complete loss of database connectivity.
2017-05-04 15:58:19.821 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mysql.persist'
2017-05-04 15:58:22.508 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
2017-05-04 15:58:22.773 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-05-04 15:58:22.836 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-05-04 15:58:22.885 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-05-04 15:58:23.148 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-05-04 15:58:23.358 [INFO ] [al.protocol.ip.MySensorsIpConnection] - Successfully connected to MySensors Bridge.
2017-05-04 15:58:23.375 [WARN ] [al.protocol.ip.MySensorsIpConnection] - Network Sanity Checker thread disabled from bridge configuration
2017-05-05 20:46:07.629 [WARN ] [rs.internal.protocol.MySensorsWriter] - Message returned from queue is null
2017-05-07 18:29:09.171 [WARN ] [rs.internal.protocol.MySensorsWriter] - Message returned from queue is null
2017-05-08 18:29:09.177 [WARN ] [rs.internal.protocol.MySensorsWriter] - Message returned from queue is null
2017-05-09 18:29:09.178 [WARN ] [rs.internal.protocol.MySensorsWriter] - Message returned from queue is null
2017-05-10 09:45:00.051 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Connection is not valid!
2017-05-10 09:45:00.053 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Connection is not valid!
I have nothing fancy in my mysql config. I connect via an stunnel.
cat << EOF | sudo tee /etc/openhab2/services/mysql.cfg
# the database url like 'jdbc:mysql://<host>:<port>/<database>' (without quotes)
url=jdbc:mysql://127.0.0.1:3306/openhab
# the database user
user=openhabserver
# the database password
password=mypassword
EOF
I did not see any data in my hapanel graphs, as it could not read from the database.
Restarting openhab2 and connection is restored. Graphs are again populated.