Problems Installing influx on openhabian 3.2 (org.influxdb.InfluxDBException: mkdir /var/lib/influxdb/wal: permission denied)

These are my first steps with influxDb and Grafana.
I’ve installed both via openhabian-config on my openhabian 3.2 and on the system console:

influx -version


InfluxDB shell version: 1.8.10

but now my openhab logfile is full with error messages like this, after each item change.
Looks like problems with the file system rights for the influxDB, but i am a Linux beginner and i’ve no idea what I can do…

2022-02-07 18:51:08.527 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBException: mkdir /var/lib/influxdb/wal: permission denied
	at org.influxdb.InfluxDBException.buildExceptionFromErrorMessage( ~[bundleFile:?]
	at org.influxdb.InfluxDBException.buildExceptionForErrorState( ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.execute( ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.write( ~[bundleFile:?]
	at org.influxdb.impl.OneShotBatchWriter.write( ~[bundleFile:?]
	at org.influxdb.impl.BatchProcessor.write( [bundleFile:?]
	at org.influxdb.impl.BatchProcessor$ [bundleFile:?]
	at java.util.concurrent.Executors$ [?:?]
	at [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]

What is the output of:
ls -ld /var/lib/influxdb/ /var/lib/influxdb/*

openhabian@openhabian:/var/lib/influxdb $ ls -ld /var/lib/influxdb/ /var/lib/influxdb/*
drwxrwxr-x 1 root     root     4096 Feb  7 19:10 /var/lib/influxdb/
drwxrwxr-x 1 influxdb influxdb 4096 Feb  7 19:02 /var/lib/influxdb/data
-rw-rw-r-- 1 influxdb influxdb    4 Feb  7 19:01 /var/lib/influxdb/
drwxrwxr-x 1 influxdb influxdb 4096 Feb  7 19:02 /var/lib/influxdb/meta
openhabian@openhabian:/var/lib/influxdb $

change owner and group of directory /var/lib/influxdb.
Yours is owned by root:root

sudo chown influxdb:influxdb /var/lib/influxdb
makes it owned by influxdb:influxdb like the directories inside of that directory.
In case influxddb process wants to create further directories inside of /var/lib/influxdb that should be possible after executing the above command.

it works, but only until next reboot via “shutdown -r now”
could that be an issue with ZRAM?

yes. Try: turn off / deactivate or turn deinstall ZRAM; do the correction and activate ZRAM again.

thanks now it works even after a restart

1 Like