Raspberry PI is loosing installed Bindings after reboot or power cycle

  • Platform information:

    • Hardware: Raspberry Pi 3 Model B Plus Rev 1.3
    • OS: Linux version 5.15.32-v7+
    • Java Runtime Environment:
      openjdk 11.0.13 2021-10-19 LTS
      OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
      OpenJDK Client VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)
  • openHAB version: openhab 3.2.0

  • Issue of the topic: lost installed Bindings after reboot or power cycle

Hello all,
I’m facing a odd issue that I cannot understand why and I’n not able fix it. I’ve been creating my openhab environment with several bindings, things, items, sitemap, Influxdb, Grafana, Mosquitto… I’ve been working during more than one week, installing Bindings, and Things, testing all after installed, sometimes doing sudo reboot, and turning the RPI off till next day, and all perfect. Suddenly, today I noticed all the the Things in UNINITIALIZED state. What was my surprise, I realized all the already installed Bindings were gone. I started to reinstalled, but if I turn off or do a reboot on RPI, all go away again.
I started all from the scratch, formatted SD card, Installed new openhabian image, update the RPI with latest version, and all update with openhabian-config tool, but didn’t fix.
I’m wondering if someone can help me to debug this issue.

Did you define any binding in config file?

that’s being done by using the shutdown command ?

No, no Binding was defined on files, only Bridges.

By power off. Even I simulate a energy outage for seconds, it happens. It didn’t before!

Another thing odd is the information related to Root memory, process and sessions:

It’s possible (likely?) the Raspberry SD card was corrupted by the power off. It’s a common problem.

Hi Mr-JR James R,
Yes. It was SD corrupted. I’ve changed it and installed the openhabian from scratch.
Thanks for your help.

You must not do this. It’s not surprising your SD got corrupted when you pull the plug several times. Take care from now on and properly shutdown the system.
And OH is supposed to run 24/7 so best practice actually is you shouldn’t be rebooting at all.

1 Like

software poweroff ( the command ) or physical power off ( pulling the plug ) ?

Yes, by switching of the power. I learn now that it shouldn’t be done.

Hello all,
After I’ve replaced the SD card to a brand new card, and verified that it fixed may problem, it is happening again. I’ve done no more power down by the switch energy. I’ve used the command sudo shutdown -h now and sudo reboot. Today I realized it is exactly the same. Now the bootstrap snapshot shows me none to Platform (see picture).
I’m really frustrated because the issue is back and I did nothing wrong.
I’m wondering if someone can help me to get specific logs to understand where is really the issue.

Your box has a new state now so it’s barely “exactly the same” and even the cause may be a different one now, without analysis noone can know.

So comprehensively explain again what the issue is now - no more, no less.

What did you do to replace the SD ? Install from scratch ?
If you copied over your old (corrupted !!) SD contents or restored any (potentially also corrupted !) backup, you will have your explanation right here.

Hello Markus,
I created a band new card from scratch with Etcher. I’ve loaded a backup zip file that I did before I noticed the issue first time. I did test, installing a binding to validate if the Bindings remain there, and it did. I proceed with the re-installation for all the other bindings, but today I was surprised with the issue again.
May it be related to the used backup?

Are the bindings downloaded on startup/boot time from mvn repository or did you install the openhab-addons apt package ? Which bindings do we talk about ?
Does /var/log/openhab/openhab.log provide more information about the problem’s root cause ?

Hi Wolfgang,
All the Bindings were installed through UI. I’ve installed several Bindings such Astro, OpenWeatherMap, iCalendar, Twitter, Telegram, etc…
I’ve again created a new openhabian image on the card, starting from the scratch. But this time, I won’t use the backup I did. If it will happen, I will share the logs.