Influx will not start

I have potentially several largish databases on a RaspberryPi4. After any reboot or manual restart I simply get this output:



● influxdb.service - InfluxDB is an open-source, distributed, time series database
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-12-15 15:52:49 EST; 32s ago
     Docs: https://docs.influxdata.com/influxdb/
 Main PID: 30443 (influxd-systemd)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/influxdb.service
           ├─30443 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
           └─30643 sleep 10

Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]:         /go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:754 +0x28c
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]: github.com/influxdata/influxdb/tsdb.(*Shard).Open.func1(0x47de840, 0x0, 0x0)
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]:         /go/src/github.com/influxdata/influxdb/tsdb/shard.go:344 +0x298
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]: github.com/influxdata/influxdb/tsdb.(*Shard).Open(0x47de840, 0x4304360, 0x5dfe7b0)
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]:         /go/src/github.com/influxdata/influxdb/tsdb/shard.go:355 +0x1c
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]: github.com/influxdata/influxdb/tsdb.(*Store).loadShards.func1(0x4197040, 0x4182140, 0x436cae0, 0x4197080, 0xfd51f0, 0x41727e0, 0x43ec240, 0x4356917, 0x9, 0x43a0861, ...)
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]:         /go/src/github.com/influxdata/influxdb/tsdb/store.go:404 +0x4c4
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]: created by github.com/influxdata/influxdb/tsdb.(*Store).loadShards
Dec 15 15:53:09 www2 influxd-systemd-start.sh[30443]:         /go/src/github.com/influxdata/influxdb/tsdb/store.go:362 +0xb64
Dec 15 15:53:10 www2 influxd-systemd-start.sh[30443]: InfluxDB API unavailable after 2 attempts...

This thread helped - Influx stopped writing data - #9 by moebius - General - Node-RED Forum

Specifically this section:

edje11

I had ones the the same problem, writing data without error, but Infux Admin didn’t show the new entry’s.
Rebuilding the influx index files helped me.

# Shutdown InfluxDB
systemctl stop influxdb

# Remove all TSI index files
rm -r /var/lib/influxdb/data/*/*/*/index

# Rebuild TSI index files
su --command "influx_inspect buildtsi -datadir /var/lib/influxdb/data -waldir /var/lib/influxdb/wal" influxdb

# Start InfluxDB again
systemctl start influxdb