Influxdb 1.8.9 grafana bad gateway

Hi,
I’ve been running influxdb for about 6months without any issue on a raspberry pi. And then, about 1 month ago, I failed to connect to influxdb server from a my usual remote grafana.
I have read this posthttps://community.influxdata.com/t/influxdb-1-8-7-will-not-start/20965, but I can’t find where problem is.

  • ping is responding with 204 answer (good)
    journalctl -xe give me that:
-- The job identifier is 17711 and the job result is done.
Sep 14 17:43:33 raspberrypi systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
-- Subject: A start job for unit influxdb.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit influxdb.service has begun execution.
-- 
-- The job identifier is 17711.
Sep 14 17:43:33 raspberrypi influxd-systemd-start.sh[20988]: Merging with configuration at: /etc/influxdb/influxdb.conf
Sep 14 17:43:33 raspberrypi influxd-systemd-start.sh[20988]: ts=2021-09-14T15:43:33.127750Z lvl=info msg="InfluxDB starting" log_id=0WaFUi1l000 version=1.8.9 branch=1.8 commit=d9b56321d579
Sep 14 17:43:33 raspberrypi influxd-systemd-start.sh[20988]: ts=2021-09-14T15:43:33.128205Z lvl=info msg="Go runtime" log_id=0WaFUi1l000 version=go1.13.8 maxprocs=4
Sep 14 17:43:33 raspberrypi influxd-systemd-start.sh[20988]: Merging with configuration at: /etc/influxdb/influxdb.conf
Sep 14 17:43:33 raspberrypi influxd-systemd-start.sh[20988]: run: create server: mkdir all: mkdir /root/.influxdb: permission denied

I have this right on /etc/influxdb/influxdb.conf

-rw-r–r-- 1 root root 3547 Aug 31 21:03 influxdb.conf

and this on /usr/lib/influxdb/

-rw-r–r-- 1 root root 533 Aug 5 00:50 influxdb.service
-rwxr-xr-x 1 root root 1116 Aug 5 00:50 influxd-systemd-start.sh
-rw-r–r-- 1 root root 5702 Aug 5 00:50 init.sh

Can anyone give me an advice to fix this, please
Thanks,
Claude

When you start influxdb, do you start it as a service? That’s important and not clear from your notes.

If so, the service likely is running as a user other than root, e.g. as influxdb. (On my rhel system the start up script is in /etc/systemd/system/influxd.service, you list /usr/lib/influxdb/influxdb.service. The user listed is typically influxdb.) If that’s the case, the service startup script is trying to create or write to that directory as that user. And can’t.

It’s very odd that it would attempt to write to /root as a non-root users. Suggestive that they way you have installed it, have run it, or are starting is odd. Or a bug.

A quick workaround would be to (recursively) change the ownership of the /root/.influxdb to match the user in the start up script. Fully expect that you are kicking the proverbial can, though.

I have installed it with systemd. In my /etc/systemd/system/influxd.service, I have found:

[Service]
User=influxdb
Group=influxdb
LimitNOFILE=65536
EnvironmentFile=-/etc/default/influxdb
ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh

So, I have tried the quick workaround

sudo chown -R influxdb /root/.influxdb

and restarted, unfortunately with same result

Sorry, I can’t be of much more help then.