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

returns

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(InfluxDBException.java:161) ~[bundleFile:?]
	at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:173) ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:827) ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460) ~[bundleFile:?]
	at org.influxdb.impl.OneShotBatchWriter.write(OneShotBatchWriter.java:22) ~[bundleFile:?]
	at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:340) [bundleFile:?]
	at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:287) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

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/influxd.pid
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

Applying
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