Problem: Persistence services MapDB, Influx and MariaDB lost after every restart

Hi everyone,

I have a weird problem and I can’t find out the reason. At first, I was only working with rrd4j persistence. A couple of months ago I added MariaDB first and afterwards MapDB and InfluxDB.

The problem is that OpenHAB loses these three added services after every restart. I get an error in my log and when I check the bindings in the UI, I can see that all of them are not installed. At first I thought that I had a double configuration (textual and UI) but for Influx and MapDB I am 100% sure that I never configured anything outside the UI. MapDB doesn’t requite anyhing anyways.

Did anyone experience a similar problem? Any idea what I can do to fix this?

Best, Max

Restart of openHAB or restart of the whole machine?

openHABian or some other installation? If some other installation are you using zram or some other RAM based file system?

What do you see in the logs during startup? Does it show the add-ons being uninstalled?

Do you see any other weird behavior? Deleted files reappearing, strange errors during startup, etc?

Hi @rlkoshak,
it happens both when restarting the whole machine or just the OpenHAB service. For example, I upgrade to 3.3.1 today using openhabian-config and afterwards these persistence services were gone.
I have ZRam enabled. My system is OpenHABian on a RPi 4.
Startup takes quite long (around 4-5 minutes) until all services are up and running but this might be normal.
I will check if I can find anything in the log.

2022-06-28 22:28:16.658 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'jdbc.persist'

2022-06-28 22:28:56.997 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: Driver is available::Yank setupDataSource

2022-06-28 22:37:05.513 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'jdbc'

2022-06-28 22:37:12.188 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'jdbc'

2022-06-28 22:37:12.200 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'jdbc'

2022-06-28 22:37:12.213 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'jdbc'

2022-06-28 22:37:12.216 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'jdbc'

2022-06-28 22:37:12.222 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'jdbc'

For Influx:

2022-06-28 22:28:16.162 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'

And MapDB:

2022-06-28 22:28:17.136 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mapdb.persist'

The whole reboot procedure takes almost 15 minutes. I did not find any uninstallation notes in the log. However, the three services are gone again after rebooting.

Do you see anything about installing or uninstalling addons during the boot process in the logs?

Does any other data disappear? For example, create an Item, restart, and see if the Item remains.

Ultimately this is not something specific to your openHAB configuration (assuming your addons.cfg file is empty like you said). So the problem is going to be something wrong with zram writing the changes to the SD card on a reboot or the SD card is full or worn out or something like that.

You just gave me an idea: My addons.cfg is not empty. It just doesn’t contain the three persistance services I installed via the UI. This might be the reason for the problem.

Here is the persistence line of addons.cfg:

# A comma-separated list of persistence services to install (e.g. "persistence = jpa,rrd4j")
persistence = rrd4j

Now that I am thinking about it, it should be either all or none, right? What do you suggest? Should I add the other services in addons.cfg or comment out the persistence line in the file?

If there is anything in addons.cfg, that’s what will get installed. Anything else not in that file will be uninstalled. You should either always use addons.cfg or never use addons.cfg. You can’t mix and match.

I think you can comment out the line, restart, then install all your addons through the UI.

Thank you. That was the solution. This time all persistence services survived the restart. Easy one but I only realized the problem when you brought up the file. It helps so much to discuss and think together on the forum.

HTML issue? Was this meant for a different thread?

Sorry. Yes, different thread. Will delete this here …