OpenHab freezes or crashes after running a few days

OpenHab freezes or crashes after running for a few days

I’m starting to experience that my Openhab freezes or crashes after a few days running. Ping does not come back. i can’t connect using ssh and i can’t access OH UI anymore. OH2 usually stops working after a few days running. There is no message or anything at the screen. The PI does take any input from the keyboard. i still see the screen…. OH is basically just dead and I have no other change as unplug the power and go for a reboot.

My setup:
-Using OH2.3 with InfluxDB & Grafana
-razberry board
-small configuration - under 10 z-wave device
-Release = Raspbian GNU/Linux 9 (stretch)
-Kernel = Linux 4.14.71-v7+
-Platform = Raspberry Pi 2 Model B Rev 1.1
-openHAB 2.3.0-1 (Release Build)
-Uptime = 0 day(s). 5:59:50
-CPU Usage = 0.76% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
-CPU Load = 1m: 1.01, 5m: 0.73, 15m: 0.59
-Memory = Free: 0.10GB (11%), Used: 0.85GB (89%), Total: 0.95GB
-Swap = Free: 0.09GB (100%), Used: 0.00GB (0%), Total: 0.09GB
-Root = Free: 4.02GB (58%), Used: 2.86GB (42%), Total: 7.21GB

i have looked at the following:
a.) My power supply should be suitable. I get throttled=0x0 using $ vcgencmd get_throttled which should indicate the PI is not underpowered.
b.) The SD card should not be an issue. After reboot everything works as expected at least until it stops again after a few days. There is nothing in fsck after shutdown with sudo shutdown -F -r now
c.) I don’t find anything useful openhab log.

Any suggestions on how to debug this issue?

Start with cleaning the cache and rebooting to see if that helps.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo reboot

If the issue remains l would try using a different persistence service as InfluxDB can sometimes be very taxing on memory. If it meets your needs RRD4J works well with the RPI.

Another thing to try is using a new SD card. I know you mentioned the SD should be fine but unplugging the power is never good and will eventually lead to a corrupt SD card. Once that happens troubleshooting/debugging becomes very difficult. If you have a spare SD card I would make a backup, install a fresh image, and restore the backup on the new card.

Also, here’s an interesting topic that may help.

Look into your system log files if you see anything. I’ve had a similar problem (only I have a SSD) I never found the problem but it looked like it stopped during the night after the system did an automatic update. It happend a few times. I haven’t seen the problems lately, but I’ve also run update on the whole system and are currently running latest version of openHAB. The fact you cannot connect via SSH probably means it’s not directly related to openHAB itself.

I experience the same with my installation
My setup:
-Using OH2.5.8-1 with InfluxDB & Grafana
-OS kernel: Linux 4.19.62-sunxi

  • release: Debian GNU/Linux 9 (Stretch)
  • CPU usage 4.02% over 2 CPUs (2 cores x 1 sp-ocket
  • CPU load: 1m: 0.28, 5m: 0.2, 15m: 0.26
  • CPU temp: 43°c
  • memory usage: 37 % of 2005MB
  • Swap: free: 0.97 GB (100%), used (0.00GB (0%), Total: 0.97 GB
  • Root: free 88.07 GB (94%), used 4.84 GB (6%), Total: 97.93 GB
  • processes: 106 running processes of 32768 maximum processes
  • hardware: Cubietruck
  • Battery: 99% charging

I can access the system without any issues but firering ZWave devices are not acting at all.
A reboot of OpnHab is solving the issue for about 10 days. After about 10 days the ZWave devices don’t act anymore on commands . Actually OpenHab is not sending commands anymore. ZWave.log is not recording anything. After the restart ZWave logging is recording again and everything is working as should be.