InfluxDB 2.0 storage-engine files with read-only filesystem error

Hello everyone,
I’m using influxDB 2.0 in an Odroid-C2 board with ArchLinuxARM.

With InfluxDB 1.6 i used to store data in an external disk (to avoid too much write operations in my SD card).
I tried to do the same with InfluxDB 2.0, but after upgrading InfluxBD to v2.0 (with a new clean installation), every time i’m tring to write something to the bucket I got the error:

'0U4E~swW000 service=storage-engine service=write shard=3 error="mkdir /mnt/homeautomation/influxdb/engine/data/17365afaaf38ef5a: read-only file system'.

I’m using systemd to run the service, and this is the influxdb.service file:

[Unit]
Description=InfluxDB is an open-source, distributed, time series database
Documentation=https://docs.influxdata.com/influxdb/
After=network.target

[Service]
User=influxdb
Group=influxdb
DynamicUser=yes
LimitNOFILE=65536
EnvironmentFile=-/etc/default/influxdb
StateDirectory=influxdb
Environment="INFLUXD_CONFIG_PATH=/etc/influxdb"
ExecStart=/usr/bin/influxd --bolt-path /var/lib/influxdb/influxd.bolt --engine-path /mnt/homeautomation/influxdb/engine
KillMode=control-group
Restart=on-failure

[Install]
WantedBy=multi-user.target
Alias=influxd.service

Here, from the default configuration, I only changed the –engine-path to point to the external disk directory. If I keep the default location for the engine-path everything works, but I don’t want to have this directory in the sd card.
I checked the permission and everithing seems fine:

$ ls -la /mnt/homeautomation/influxdb/engine/
total 16
drwxr-xr-x 4 influxdb influxdb 4096 May 12 11:40 .
drwxr-xr-x 3 influxdb influxdb 4096 May 12 11:39 ..
drwxr-xr-x 4 influxdb influxdb 4096 May 12 16:38 data
drwxr-xr-x 4 influxdb influxdb 4096 May 12 11:40 wal

If i log in with influxdb user i’m able to create directories and files in that folder.

I don’t know if i’m doing something wrong or if there is a bug or something.

Someone can help me?
Thanks in advance

@lucabat does mkdir -p /mnt/homeautomation/influxdb/engine/data/17365afaaf38ef5a work for you when logged in as influxdb? What are the permissions on /mnt, /mnt/homeautomation, /mnt/homeautomation/influxdb?

Nothing obvious jumps out at me when reading through the code and Googling for similar issues. The only maybe-helpful thing I saw is that Go’s os.MkdirAll isn’t expected to have the same behavior as the shell’s mkdir. I’m wondering if there’s a tight set of permissions in a parent directory that the shell can deal with, but Go can’t.

Sorry @dan-moran, I know it’s been a year since your reply but work has caused me to abandon this project due to lack of time. I simply gave up and continued to use the default engine location. However, recently I have upgraded my home server to an intel one (x86_64, no more ARM) but I still have the same problem: if I set the engine location to an external location, I have the ‘read-only file system’ error. I agree with you about a permission problem. A year ago I started to go deep to the problem by following your path but nothing helped.
Checking all permissions I found that the folders permissions were as follows:
drwxr-xr-x 4 root root 4096 20 apr 16.31 /mnt
drwxrwxrwx 9 1001 100 4096 9 mag 22.58 /mnt/homeautomation

I was doubtful about the permissions of /mnt/homeautomation so i gave a

chown mycurrentuser:mycurrentuser /mnt/homeautomation

I restarted influxdb service and the magic happened! Now it’s working. I wasted tons of time for such a stupid problem. Anyway, thanks for putting me in the right path.

The problem appears again. Then I changed the disk to be sure it was not a disk problem but no luck. Then I tried to delete the DynamicUser=yes line in influxdb.service file for systemd and I created a new user influxdb.
Now influxdb runs (the service is active) but I got the error Error: failed to check if already set up: Get http://localhost:8086/api/v2/setup: dial tcp: lookup localhost on [::1]:53: read udp [::1]:41654->[::1]:53: read: connection refused when I try to access to influxdb with the cli (for example using influx setup). Any ideas?

I was finally able to fix all the errors. The last one of missing localhost was caused by the /etc/hosts file missing the line for the localhost. I added the line 127.0.0.1 localhost and now everything works!