Is there anyway to have two folder watcher components looking at two separate folders?
Try:
folder_watcher:
- folder: /folder1
- folder: /folder2
Hi. Same problem here just like Marcos_Felipe. I can watch any folder except /backup.
Both /config and /share work fine, but when I add /backup I get:
2018-11-27 16:59:37 ERROR (MainThread) [homeassistant.config] Invalid config for [folder_watcher]: not a directory for dictionary value @ data['folder_watcher'][2]['folder']. Got '/backup'. (See /config/configuration.yaml, line 98). Please check the docs at https://home-assistant.io/components/folder_watcher/
Hereās my config:
homeassistant:
whitelist_external_dirs:
- /config
- /share
- /backup
folder_watcher:
- folder: /config
- folder: /share
- folder: /backup
And Iāve done all kind of possible reboots, reloads and even shutdown. Running Hass.io in Raspberry Pi. If I add it to folder_watcher it also prevents homeassistant from starting up and I get:
2018-11-27 17:10:44 ERROR (MainThread) [homeassistant.config] Invalid config for [homeassistant]: not a directory @ data['whitelist_external_dirs'][2]. Got '/backup'. (See /config/configuration.yaml, line 2).
ls -la shows backup w/o problems, at same level as /config and /share. Even tried /root/backup to avoid the symlink, but no luck.
Any help would be appreciated. Thank you!!
Permissions? Ownership? What is the output of ls -la ?
I was browsing filesystem from SSH & Web Terminal Add-on, and this is what I got with ls -la
:
drwxrwxrwx 1 root root 4096 Nov 28 09:49 .
drwxr-xr-x 1 root root 4096 Nov 28 09:46 ..
drwxr-xr-x 11 root root 4096 Nov 4 11:15 .oh-my-zsh
lrwxrwxrwx 1 root root 10 Nov 28 09:47 .ssh -> /data/.ssh
-rw-rw-rw- 1 root root 1003 Sep 29 13:24 .tmux.conf
-rw-r--r-- 1 root root 30740 Nov 28 09:49 .zcompdump-a0d7b954-ssh-5.5.1
-rw-rw-rw- 1 root root 65 Jul 30 11:35 .zprofile
lrwxrwxrwx 1 root root 18 Nov 28 09:47 .zsh_history -> /data/.zsh_history
-rw-r--r-- 1 root root 87 Nov 28 09:47 .zshenv
-rwxrwxrwx 1 root root 3101 Jul 21 21:34 .zshrc
lrwxrwxrwx 1 root root 7 Nov 28 09:47 addons -> /addons
lrwxrwxrwx 1 root root 7 Nov 28 09:47 backup -> /backup
lrwxrwxrwx 1 root root 7 Nov 28 09:47 config -> /config
lrwxrwxrwx 1 root root 6 Nov 28 09:47 share -> /share
lrwxrwxrwx 1 root root 4 Nov 28 09:47 ssl -> /ssl
BUT if I enter the container from Raspbian: sudo docker exec -it homeassistant /bin/bash
I get this:
drwxr-xr-x 1 root root 4096 Nov 27 18:18 .
drwxr-xr-x 1 root root 4096 Nov 27 18:18 ..
-rwxr-xr-x 1 root root 0 Nov 27 18:18 .dockerenv
drwxr-xr-x 1 root root 4096 Nov 15 00:14 bin
drwxr-xr-x 7 root root 4096 Nov 28 09:39 config
drwxr-xr-x 15 root root 3340 Nov 27 18:18 dev
drwxr-xr-x 1 root root 4096 Nov 27 18:18 etc
drwxr-xr-x 2 root root 4096 Sep 11 16:04 home
drwxr-xr-x 1 root root 4096 Nov 16 09:43 lib
drwxr-xr-x 5 root root 4096 Sep 11 16:04 media
drwxr-xr-x 2 root root 4096 Sep 11 16:04 mnt
drwxr-xr-x 1 root root 4096 Nov 16 09:41 opt
dr-xr-xr-x 179 root root 0 Nov 27 18:18 proc
drwx------ 1 root root 4096 Nov 28 09:30 root
drwxr-xr-x 1 root root 4096 Nov 27 18:18 run
drwxr-xr-x 1 root root 4096 Nov 14 23:36 sbin
drwxr-xr-x 3 root root 4096 Nov 27 16:45 share
drwxr-xr-x 2 root root 4096 Sep 11 16:04 srv
drwxr-xr-x 2 root root 4096 Nov 19 12:47 ssl
dr-xr-xr-x 12 root root 0 Jan 1 1970 sys
drwxrwxrwt 1 root root 4096 Nov 16 09:44 tmp
drwxr-xr-x 1 root root 4096 Nov 16 09:44 usr
drwxr-xr-x 1 root root 4096 Nov 16 09:44 var
/config and /share are there, but no traces of /backup. Also using find / -iname 'backup'
or whatever file I know is inside reports no results. That clarifies why /backup is not considered a folder.
Iām a docker newbie, so I donāt know how works the logic that allows homeassistant container to āseeā and interact with the /backup folder.
I also have Samba Add-on installed, and entering the container I can see and browse /backup:
-rwxr-xr-x 1 root root 0 Nov 27 18:11 .dockerenv
drwxr-xr-x 2 root root 4096 Nov 19 10:46 addons
drwxr-xr-x 2 root root 4096 Nov 27 18:14 backup
drwxr-xr-x 1 root root 4096 Sep 28 11:44 bin
drwxr-xr-x 7 root root 4096 Nov 28 09:55 config
...
I suspect some mapping is missing. Any clues?
Iām afraid my docker-fu isnāt up to it either. I guess backup may be in a different container?
Dockered if I know!
So I found every add-on that can access /backup folder has a mapping for "backup:rw"
in its docker config. For instance: Samba share and SSH & Web Terminal
Also found that ārealā backup folder in raspbian is /usr/share/hassio/backup
, but the installation method I used doesnāt bind /backup, therefore homeassistant container -and core components- cannot access it.
I opened an issue to ask: https://github.com/home-assistant/hassio-build/issues/129
I also just realized that the folder mentioned in whitelist_external_dir is representing folder structures inside your homeassisstant containerā¦ so you need to double check using ādocker exec -it homeassistant bashā command to look inside your container, and make sure your whitelisted folder is there. It has something to do with how the docker maps folder inside container to your host system. For example, default installation will map volume like this :
/usr/share/hassio/homeassistant in your host system is mapped to /config folder in the containerā¦ So if you want to whitelist a new folder called āsnapā for example in /usr/share/hassio/homeassistant/snap (host system folder structure), then you need to use /config/snap entry in the configuration.yaml whitelist_external_dirs