InfluxDB2 stopped working

Hi all,
I suspect that I’m missing something easy, but I just can’t find it.

I’m trying to write to an InfluxDB2 instance that is installed on the same machine as my Home Assistant installation, but I can’t write data to it.

I have Grafana installed in HA, and Grafana is connecting happily to InfluxDB2 using the same token, port, address and organization.

My setup used to work, but stopped working sometime in Jan. I’m struggling a bit to keep Debian12 updates and my Home Assistant updates synced.

Home Assistant log entry:

> Logger: homeassistant.components.influxdb
> Source: components/influxdb/__init__.py:587
> integration: InfluxDB (documentation, issues)
> First occurred: 22:27:45 (1 occurrences)
> Last logged: 22:27:45
> 
> Cannot connect to InfluxDB due to '[Errno 30] Read-only file system'. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible.

Output of sudo journalctl -u influxdb.service -f

> Mar 15 22:08:39 nico-debian influxd-systemd-start.sh[8460]: ts=2024-03-15T20:08:39.556732Z lvl=info msg=Unauthorized log_id=0nxvQrzG000 error="token required"
> Mar 15 22:19:14 nico-debian influxd-systemd-start.sh[8460]: ts=2024-03-15T20:19:14.496315Z lvl=info msg="Retention policy deletion check (start)" log_id=0nxvQrzG000 service=retention op_name=retention_delete_check op_event=start
> Mar 15 22:19:14 nico-debian influxd-systemd-start.sh[8460]: ts=2024-03-15T20:19:14.496638Z lvl=info msg="Retention policy deletion check (end)" log_id=0nxvQrzG000 service=retention op_name=retention_delete_check op_event=end op_elapsed=0.342ms
> Mar 15 22:22:49 nico-debian influxd-systemd-start.sh[8460]: ts=2024-03-15T20:22:49.852025Z lvl=info msg=Unauthorized log_id=0nxvQrzG000 error="token required"

yaml config:

> #influxDB settings
> influxdb:
>   api_version: 2
>   ssl: false
>   host: 10.0.1.220
>   port: 8086
>   token: w-3Q5r28PwWAWkB0B28102jGGpeWm9e7GpN8abmP2ZP06iLsEppymlvEjiNhCfJ1KmbJmo0uAAioaxvoAVNITA==
>   organization: cf3dba69d1a1d368
>   bucket: home_assistant
>   tags:
>     source: HA
>   tags_attributes:
>     - friendly_name
>     - device_class
>   default_measurement: units
>   include:
>     #      domains:
>     #        - sensor
>     entities:
>       - sensor.battery_soc
>       - sensor.ac_loads
>       - sensor.solar_yield
>       - sensor.ac_grid
>       - sensor.battery_power

System details:

> Debian12
> Home assistant via Docker installation
> InfluxDB running on the same machine
> Everything updated to the latest (I added the InfluxDB repository to APT)
> Cannot connect to InfluxDB due to '[Errno 30] Read-only file system'. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible.

Elephant in the room, but did you check InfluxDB is not configured to write to read-only FS?
Your FS might have becaome read-only due to corruption, by instance.

Thanks, but double-checking as well as I could seems to indicate that the influxdb user still seems to have all the necessary rights. I can create buckets, API keys etc.

//Edit - I’m using an plain old-fashioned HDD, not an SD card. No report of bad clusters upong boot.

nico@nico-debian:/var/lib$ sudo ls -lah ./influxdb/
total 260K
drwxr-x---  4 influxdb influxdb 4.0K Mar 15 21:49 .
drwxr-xr-x 57 root     root     4.0K Jan 20 20:07 ..
drwxr-x---  3 influxdb influxdb 4.0K Jan 20 20:07 .cache
drwxr-x---  5 influxdb influxdb 4.0K Jan 20 20:51 engine
-rw-------  1 influxdb influxdb 128K Mar 15 22:24 influxd.bolt
-rw-r-----  1 influxdb influxdb    5 Mar 15 21:49 influxd.pid
-rw-r-----  1 influxdb influxdb 120K Jan 20 20:07 influxd.sqlite
nico@nico-debian:/var/lib$

As expected, I was missing something silly. :see_no_evil:

The Docker upgrade back in Jan is causing the problem. I had the Docker version held to 24, but released the hold it when I saw that the Supervisor issues were resolved, without realizing that Grafana’s graphs are getting older and older…

Solution:

sudo apt install \
docker-compose-plugin=2.21.0-1~debian.12~bookworm \
docker-ce-cli=5:24.0.7-1~debian.12~bookworm \
docker-buildx-plugin=0.11.2-1~debian.12~bookworm \
docker-ce=5:24.0.7-1~debian.12~bookworm \
docker-ce-rootless-extras=5:24.0.7-1~debian.12~bookworm

Now I just have to see if downgrading Docker broke something else in turn. :sweat_smile:

I think I have the same problem. After a 2024.3 update I lost my Influx/Grafana data. Got the same error in the log but Ubuntu Server and the latest Docker packages.

You had to downgrade to fix it?

Yep, downgrading docker fixed it. Downgrading Docker didn’t seem to break anything else, so I currently have a hold on any Docker upgrades.

I’m seeing this too on 2024.4.3
But I run hassos and influx and grafana on a different machine?

I updated to hassos 12.2 and that seems to have broken it?

replying to myself.
running ‘core rebuild’ in the hassos console/shell fixed it.

2 Likes

Fixed for me as well, thanks!

How and where can i rebuild this?