Over the past weeks I had several issues with influxdb and openHAB wasn’t able to access influx anymore. Finally I at least found out how to fix it which
Now, I found out what causes the problem: it is a server restart of my raspbi4 which runs openHAB 3.4.1
Does anyone have an idea why the server restart creates the problem which I can fix by the above statements? (for the record, an openHAB restart does not result into the problem)
Is ZRAM turned on ? I had a similar problem when I was installing mosquitto some time ago.
For whatever reason ( at least in my case ) the underlying entries on filesystem did not get the changes done in ZRAM file layer.
I would suggest to have a look into folders, files in /opt/zram/*.bind/ and check the ownerships and permissions in those directories if they match with what they need to be.
If say /var/lib/influxdb is on ZRAM on your box, when ZRAM starts after a reboot, it’ll take the ‘real’ files+dirs+permission from /var/lib/influxdb which is on SD at that time and ‘replaces’ the directory with itself. The original SD directory will from then on be available as /opt/zram/something.bind. I suggest you change the permissions in there, too.
The problem usually is when you install something with ZRAM on then boot without letting ZRAM sync back to SD. It does on stopping the zram service which is part of any proper shutdown but will not work when there’s a power outage.
And if your problem relates to right the “root” dir of a ZRAM mount this is certainly a special edge case and changes aren’t synced even on proper shutdown. I would not know how to handle this.
I have been having the same problem with the owner and group of /var/lib/influxdb being reset to root on reboot.
I believe on installation, the ownership of the directory is set correctly to influxdb:influxdb. Running option 14 - Fix Permissions in openhabian-config actually changes the ownership to root:root. Looking at the code in /opt/openhabian/functions/system.bash confirms that it makes this change to /opt/zram/influxdb.bind. So it looks to me that this is a problem with openhabian-config.