Semantic model lost after restart

  • Platform information:
    • Hardware: Raspi 3B
    • OS: Openhabian 10, kernel 5.10.17-v7+
      Openhab 3.0.2

Hello, may be this was solved here, but I can not find it :frowning: (or how to describe to search).
My OH 2,5 crashed, so I make new instalation of 3.0.2.
Next I copied JSON setting files from old SD card with crashed OH 2,5. By this I recover things and items
Next I copied persistence and rules files from old SD card.

Openhab 3.0.2 works. BUT - when I create semantic model, save it and restart Raspberry, semantic model disappear. I think something about ZRAM, but when I run openhabian-config and want to disable USE ZRAM (item 38), I got error message

There was an error or interruption during the execution of: │
│ “30 | System Settings” │
│ │
│ Please try again. If the error persists, please read │
│ /opt/openhabian/docs/ or │
openhabian/ at main · openhab/openhabian · GitHub how │
│ to proceed.

I really dont know, how to fix problem with disappear of model after restart.

Thank you for any help.

This is definitely going to be a ZRAM issue. So I do recommend that you follow the suggestion in the error message to debug the problem. Until you do a run with debug enabled and gather and post the logs no one is going to be able to help. That link tells you how to do that.

1 Like

Thank you Rich, I set logging level to maximum in conf. and run openhabian-config. in log I found this

  • local ‘introText=You are about to activate the zram feature.\nBe aware you do this at your own risk of data loss.\nPlease check out the “zram status” thread at ZRAM status before p roceeding.’
  • local ‘lowMemText=Your system has less than 1 GB of RAM. It is definitely NOT recommended to run zram (AND o penHAB) on your box. If you proceed now you will do so at your own risk!’
  • local zramInstallLocation=/opt/zram
  • [[ install == \i\n\s\t\a\l\l ]]
  • [[ -f /etc/ztab ]]
  • [[ install == \u\n\i\n\s\t\a\l\l ]]
    ++ timestamp
    ++ date +%F_%T_%Z
  • echo ‘2021-05-29_07:23:38_CEST [openHABian] Refusing to install zram as it is already installed, please unin stall and then try again… EXITING’
    2021-05-29_07:23:38_CEST [openHABian] Refusing to install zram as it is already installed, please uninstall an d then try again… EXITING
  • return 1
  • ‘[’ 1 -ne 0 ‘]’
  • whiptail --msgbox ‘There was an error or interruption during the execution of:\n “30 | System Settings”\n\n Please try again. If the error persists, please read /opt/openhabian/docs/ or https://githu how to proceed.’ 14 80

As I understand, log said me, that ZRAM is installed. But now I dont know, what to try to get know why zram does not works correctly…

Issue zramctl to validate.

Any recent, proper setup of openHABian will not expose that behavior, so yours isn’t properly setup.
And it’s hard to recommend steps for a system of unknown status.

Your best choice is to install a new openHABian system to another SD card from scratch.
You can use openhabian-config to export your config then on the new system simply import it.

PS you don’t just pull the power plug, do you?

1 Like

Hello Markus,
thank you for answer,
zramctl said this
/dev/zram2 zstd 600M 159M 22.1M 23.9M 4 /opt/zram/zram2
/dev/zram1 zstd 900M 41.3M 1.9M 2.6M 4 /opt/zram/zram1
/dev/zram0 lzo-rle 600M 1.1M 269K 608K 4 [SWAP]

what I have installed is extracted openhabian 1.6.4 or 1.6.5 from your github. The same behavior has my friend, which install the same version of openhabian to new SD card (he was the first who notice it - that after restart he lost semantic model). The one common thing which we both made - recover setting by manual copying (and rename) openhab files from old SD card to new SD card (var/lib/openhab/jsondb) - backup created by openhabian-config in OH2.5 fails during import to OH3.0.

If we can not find any steps to try or something to analyze, I will create new instalation.

About “hard” power off - no, system was rebooted by “sudo reboot” or “sudo shutdown -r”, with the same result.

You claim you cannot UNinstall zram but your debug log shows you were trying to INSTALL.
Did you select the wrong menu option ? The “uninstall” one IIRC has no option, it is the one below the install one, 38.

It’s also possible that your issue is totally unrelated to ZRAM.
Validate: create a file on a ZRAM’ed directory and reboot.

1 Like

I think you mean /dev/zram0, /dev/zram1 or /dev/zram2 ? none of these folders exist…

no, for example /var/log

try again to uninstall

1 Like

Hello, Markus,
I tried to uninstall ZRAM and next to install again. Looks like that was installed (zramctl say something similar as above). Next I created a file in var/log, reboot by “sudo shutdown -r now”. After reboot, created file was still in var/log.
Next i tried to make semantic model and restart and the model disappear…Is there some file where the semantic model is stored ? To check if it is saved and what happens with it after reboot ?

My friend who made clear install and discover this problem will try today to make clear install again and we will see.
Have a nice day

Hello, Markus,
so final result - when I made a new, totaly clear instalation and make something in semantic model, it persist after reboot or shutdown and power up again…
Looks like, that this crazy behavior was caused by copying (and renaming to new format) OpenHAB JSON files from older instalation (/var/lib/openhab/jsondb folder).
So now I will try to transfer things/items configuration from old crazy installation to new installation. I hope, that export / import will works and did not transfer the zram problem also.

Thank you (and all others too) very much for your time and help.

So it was unrelated to zram.

You should not mess with copying json files anyway. That is neither recommended nor required.
And a bad idea unless you really have no other chance to and know the implications.

Use openhab-cli or openhabian-config menu 51 to backup and restore config. You can transfer the zip file between systems.

Yes, it is definitely another problem (the question is - where :slight_smile: )
But i did it because current instalation fails to boot - i tried to connect monitor with keyobard and after a few seconds after power up booting halt and I did not found any solve for it. Files from card was readable, so I tried to copy json files (as I found it as a possibility somewhere here).

Thank you again Markus.