[SOLVED] MariaDB keeps uninstalling

I am using MariaDB to persist a few items from openhabian to my QNAP NAS. Any time I restart openHAB, the log shows MariaDB being uninstalled. I can then reinstall it from PaperUI.

My configuration is entirely text and all of my bindings, UIs etc work fine from addons.cfg so I’m wondering if there is an error in that file. Currently the file contains:
persistence = jdbc-mariadb
but I’ve also tried:
persistence = jdbc
persistence = mariadb
persistence = MariaDB
and it’s the same every time.

I know the biggest problem I had getting this persistence service to work at all was naming it correctly. Does anyone know the correct name to use in the addons/cfg file?

It should be “jdbc-mariadb”.


The highlighted part is what you usually put into addons.cfg.

Do you see any errors or other interesting statements in the logs?

Thanks. I was seeing:
2019-07-02 19:13:32.725 [thome.event.ExtensionEvent] - Extension ‘persistence-jdbc-mariadb’ has been uninstalled.
in the log.
I’ve changed it back to
persistence = jdbc-mariadb
and it’s now working.
The naming of persistence service has made this the hardest part of openHAB to set up.
In addons.cfg you need jdbc-mariadb
The config file in /services is called jdbc
In jdbc.cfg you need jdbc:mariadb
The persistence file in /persistence is called jdbc
The name of the addon is MariaDB but you have to be careful not to use the capital letters anywhere.

I though only Microsoft could achieve those levels of inconsistency!

As with all things there are reasons for the inconsistency. There is actually only one JDBC binding. The main difference between the various JDBC bindings is which database’s JDBC driver library is available. Consequently you have jdbc.cfg and inside you have jdbc:mariadb.