Docker: ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup: (sqlite3.OperationalError) disk I/O error

Hi there,

I’ve been playing with homeassistant for a bit. I love the idea of it, but haven’t been able to get it working properly. I’m on reinstall number 4 and I always have this same issue. Please help!

I just did a complete reinstall. Here’s what that looked like in my case:

docker stop homeassistant
docker rm homeassistant
rm -rf /storage/data/homeassistant
docker run -d --name homeassistant --privileged \
 --restart=unless-stopped -e TZ=GB \
 -v /storage/data/homeassistant:/config \
 --network=host \ 
 ghcr.io/home-assistant/home-assistant:stable

Without running anything else, or even trying to connect to the interface, I peek into the /storage/data/homeassistant folder and see three things:

  1. It’s there. So it’s getting recreated by docker as part of the install
  2. The brand new structure contains corrupted db entries:
home-assistant_v2.db.corrupt.2022-11-10T15:30:24.399590+00:00
  1. The first line of the log is already indicating IO errors:
2022-11-10 15:30:21.382 ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup: (sqlite3.OperationalError) disk I/O error

As near as I can tell, I’m properly following the directions here: Linux - Home Assistant

Write location has appropriate permissions (docker is creating the folder) and loads of space (5.8TB free)

What am I missing?

Thanks!

Doubling this. Having the same issues (w/ docker compose)

Sorted it out. For me, it was because caching was turned on in my MergerFS pool where I was storing the database. I had to remove cache.files=off from my MergerFS configuration.

See https://github.com/trapexit/mergerfs#plex-doesnt-work-with-mergerfs for the full techincal explination

1 Like

Thanks, Jerry. I’d just worked out that my problem was MergerFS and fixed things by moving to a different folder. I came back to update this with my findings only to discover your more complete solution. Thank you!