ERROR (SyncWorker_2) [homeassistant.components.filesize.sensor] Filepath /var/lib/homeassistant/.homeassistant/home-assistant_v2.db is not valid or allowed
The file is 100% there, as HASS is writing to it:
# ls -la /var/lib/homeassistant/.homeassistant/home-assistant_v2.db
-rw-r----- 1 homeassistant homeassistant 97591296 Jan 6 19:35 /var/lib/homeassistant/.homeassistant/home-assistant_v2.db
I am more interested in “not allowed” hint of error message… What I did wrong to configure this sensor?
Thanks, unfortunately it didn’t help. I have added above lines to the config, but it had no effect (the error is still logged at HASS startup).
P.S. I am not running HASS in a docker.
No , I am not running under docker. I am running on Debian Linux.
I have created this symlink myself, and it has confused HASS. However the way it check file paths seems to be inconsistent: directory seems to be resolved, but file location is not. Hence they don’t match.
I don’t get your question. If you have a symlink somewhere in your full path to your file, then the solution is to add the full path to this file (with symlink resolved) to homeassistant.whitelist_external_dirs configuration variable.
After restarting HA, I can’t find the entity. I go to Developer-States and inspect all the entities and I can’t find anything. I was expecting to see something like sensor.filesize.XXX
How do you have Home Assistant installed? On my RPI4 I have exactly what you have and it works fine. Depending on how you installed (i.e. mine runs under Docker) the path will be different.
I also added:
scan_interval: 1800
So it only checks the size every 30 minutes (1800 seconds) so my database does not get huge.
I have HA installed on “bare Linux” (so not Docker) via pip3 install homeassistant
So the path is absolutely correct.
How do you test? What is your configuration? What is the file location?
I’m running under docker, so the paths are different. If you are running bare metal, then I’d think that the paths would be the actual / physical path to the file.
It does not matter. Just tell me your setup and probably I get the difference. Your .homeassistant directory is inside Docker, right? Or you submount it as a volume? I see from above posts that typically the configuration directory is /config, so is /config a symlink in your case (the answer should be yes)? Where it points to?
I think you’re mixing SQL database (which is enabled within recorder) and file storage. This topic is about a sensor that measures size of file database, namely home-assistant_v2.db.
Fair enough, but isn’t the .db file the size of the database ? I was just suggesting a different way of monitoring its size, I dont have a home-assistant_v2.db as use MariaDB