Loosing "Standard Persistence Service" setting when restarting OH

Hi all,

I am running OpenHAB 4.3 M2 in a docker container on my NAS (x86_64). The OpenHAB data is stored on mounted, writeable, persistent file systems.

I am using the existing Maria DB environment on my NAS for the persistence and everything works fine storing and retrieving item data. And before I started using the Main UI for dashboards I did not realize that I have a problem that OpenHAB forgets the setting of the standard persistence service at every restart/reboot.

My addons.cfg:

persistence = jdbc-mariadb,mapdb

My runtime.cfg:

#org.eclipse.smarthome.persistence:default=jdbc
org.eclipse.smarthome.persistence:default=jdbc-mariadb

I tested both entries in the runtime.cfg as the first one was active first. I learned during my research in the community topics that in addons.cfg the entry needs to be jdbc-maradb. Hence, I tried this now also in the runtime.cfg.
But neither entry makes OH persistently saving the standard persistence service.

When I am opening the “Settings” in the UI and go to “Persistence” I see no service active:

In this condition I do not see any data in the charts of my Main UI dashboards.

When I am now selecting JDBC and saving this setting everything is ok because I see data in the charts of my Main UI dashboards.

But when I need to restart my OH instance this setting is gone and there is no standard persistence service active. I always need to go to “Settings” => “Persistence” and select&save JDBC in the “General Settings”.

I would love to have this setting persistently stored as I need to restart my docker instance from time to time and it is annoying that I cannot really use my Main UI dashboards because I always need this manual intervention.

I am carrying this behaviour since OH v3 I guess but it never bothered me as I used HABPanel in the past and that works without that setting but the Main UI requires the standard persistence service to be set.

I found this old topic with same problem but it was solved with the persistence settings in the addons.cfg and runtime.cfg. I tried this already without success and I now have no more idea how solve this:

Can somebody tell me where OH stores this setting when I click “Save” at the top right of the UI:

So that I can check where if and how it is stored to find out why it gets lost at restart?

I kindly appreciate any guidance as I would like to rely on the Main UI in the future.

Thank you for all your support

Cheers
Justus

You must have pulled that from an old example or post on the forum. org.eclipse.smarttthome hasn’t existed since OH 3.0. Try org.openhab.persistence:default=jdbc-mariadb

The cfg files are used to populate the $OH_USERDATA/config/org/openhab/*.config files. Those will show you excatly what OH thinks it’s configured with. But you shouldn’t edit those files directly.

Thank you @rlkoshak,

I always mounted the file systems from the old docker containers to the new and hence the old syntax seem to have survived and slipped into the new environment …

I am currently rebooting after changing the setting by your recommendation …

This did not solve the problem. After restart still no setting:

I think it should be jdbc, rather than jdbc-mariadb.

1 Like

Thank you, @Mherwege !!!

I will try that too. But I am confused that in addons.cfg it is

persistence = jdbc-mariadb

and in runtime.cfg it should be

org.openhab.persistence:default=jdbc

:thinking:

In essence, there actually is only one jdbc binding, but it gets installed in a different flavor, depending on the database you select. So in the addons it is listed as multiple, but underneath, all is the same except one dependency.
You can also not use multiple jdbc addons at the same time.

1 Like

That is finally it … so the mistake was in the runtime.cfg!!! It was a combination of the wrong old parameter name:

org.eclipse.smarthome.persistence:default

that should be

org.openhab.persistence:default

and than I used the wrong binding name:

WRONG: org.openhab.persistence:default=jdbc-mariadb
RIGHT: org.openhab.persistence:default=jdbc

Thank you @rlkoshak and @Mherwege :clap: :clap: :clap: :clap: :clap:

1 Like