core: HA InfluxDB integration fails with Read-only file system error following upgrade to Docker 25.0.x
The problem
Following an upgrade from docker-ce 24.0.7 to 25.0.1 the InfluxDB integration fails with the error message,
ERROR (influxdb) [homeassistant.components.influxdb] 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.
No data is received in InfluxDB from HA after the upgrade from docker-ce 24.0.7 to 25.0.1.
The ‘[Errno 30] Read-only file system’ error message appears to be coming from a influx.write_api call in this code block of the InfluxDB integration.
The error may be caused by a change in mounting behavior introduced in moby v25.0.x that prevents multiprocessing from creating a /dev/shm file, as reported in this moby/issues/47158 issue. The influxdb python client uses multiprocessing.
If the issue is python multiprocessing and docker-ce 25.0.x related, other HA integrations that use multiprocessing may be impacted
Downgrading from docker-ce 25.0.1 to 24.0.7 restores the HA InfluxDB integration functionality, suggesting it is an issue brought about by a change introduced in docker-ce 25.0.x.
What version of Home Assistant Core has the issue?
core-2024.1.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
InfluxDB
Link to integration documentation on our website
https://www.home-assistant.io/integrations/influxdb/
Diagnostics information
No response
Example YAML snippet
# influxdb section from configuration.yaml
influxdb:
api_version: 2
host: 192.168.1.2
port: 8086
ssl: false
token: REDACTED
organization: REDACTED
bucket: home_assistant
override_measurement: sensor
default_measurement: state
Anything in the logs that might be useful for us?
grep -i influxdb /usr/share/hassio/homeassistant/home-assistant.log.*
/usr/share/hassio/homeassistant/home-assistant.log.1:2024-01-24 17:46:44.641 ERROR (influxdb) [homeassistant.components.influxdb] 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.
Additional information
The commands used to downgrade and upgrade docker-ce on debian 12 bookworm.
Install docker-ce v24.0.7
sudo apt install \
docker-ce=5:24.0.7-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-compose-plugin=2.21.0-1~debian.12~bookworm \
docker-ce-rootless-extras=5:24.0.7-1~debian.12~bookworm
Install docker-ce v25.0.1
sudo apt install \
docker-ce=5:25.0.1-1~debian.12~bookworm \
docker-ce-cli=5:25.0.1-1~debian.12~bookworm \
docker-buildx-plugin=0.12.1-1~debian.12~bookworm \
docker-compose-plugin=2.24.2-1~debian.12~bookworm \
docker-ce-rootless-extras=5:25.0.1-1~debian.12~bookworm
InfluxDB host
The InfluxDB instance used during testing is on a separate server to the one that hosts HA. No changes were made to the InfluxDB host environment. The InfluxDB version is v2.7.5
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 14
- Comments: 34 (12 by maintainers)
The issue was caused by this Supervisor issue, resolved in Supervisor 2024.04.0 (currently in beta channel). Make sure to run
ha core rebuildafter upgrading Supervisor (unless you update HA Core at the same time).If the token was working before the updates with problems is shall working after update HA or rebuilding the HA. Have 3 sup system start working OK after rebuild and original token is not changed.
Sorry i am not a developer but this configuration should be somewhere in the code of this add-on. At least i hope. Or how does it work? Could somebody search for it. I can not find it. it’s been 3 months after it’s failed and it should be marked as unsupported ( with no hope to fix it and make it usable ) or fixed.
Ping @mdegat01 !! We need little brain help here then its being some problems with latest docker updates that is braking this integration (ans some other but they looks being fixed now). If you have time throwing one eye what is going on in the code side then we can only debug what we see and is nothing more is not trying communicating with the server and no logs on that side of trying anything from the client.
That’s fine. But with Docker 25+, you need to adjust it to one of:
/dev/shmas writable, or better, mount atmpfsto that mountpoint (if container<->host[<->container] shared memory access is not desired). Doing the same for/dev/ptsmight be also desirable./devnon-recursively (not sure if it’s possible to specify in Compose syntax, almost surely not with the shorthand one)./devwith recursive mounts writable. With the same note as the previous option.It’s a line, it’s a line that I added to have access to external devices.
Solved and working. Thank you so much.
Its only fixing the IO problem then using core then its miss configured the IO that is making it can connecting to Influx.
I using sup and have the Influx on one separate AMD64 Ubuntu machine and saving data from other systems like RTL433 and so on, plus sensor data from (Z)HA.
This worked for me. Unfortunately for @edudele it doesn’t help him fix his issue.
Order of execution that worked for me.
So far the HA -> Infuxdb connection is working fine. I see recent data arriving in the DB.
Supervisor 2024.04.0 looks to have resolved the Docker file system mount handling issue introduced in Docker 25.
After upgrade… ha core rebuild
Works! Thank you all!
Also did an upgrade to Supervisor 2023.04.0 and Core 2024.4.2 (in that order). Still have the same error after upgrading Docker.
HA Core 2024.3.3 HA Supervisor 2024.03.0 Docker: 26.0.0 Influx DB: influxdb:2.7.5 and influxdb:2.7.5-alpine
Will this ever by fixed?
Same issue here
Same issue here
Same issue here…
Same issue here, hoping for a fix 😃