No Access to Path

Hello Community.

I’m new to HA and Ubuntu, so please excuse the noobiness. I have HASSIO 0.93.2 running in docker on Ubuntu 18.04 and I’m struggling with folder permissions.

I’m trying to create a camera snapshot and I keep getting the error:

Can’t write ‘/photos/doorbird.jpg’, no access to path!

I’ve tried giving everyone full control to the folder inside the container and added it to the whitelist_external_dirs (although its not external, it is in the config folder).

I’ve also tried using the www folder to no avail.

Can anybody offer any guidance?

The / at the beginning usually denotes trying to access a directory at /photos/

Does that directory exist?

Are you mounting a directory on the host at that path?

How about you share the config yaml snippets that involve said path?

I just created the folder in /usr/share/hassio/homeassistant using mkdir photos. I removed the whitelist from configuration.yaml because the way I understood it, that is only necessary if you want to include folders that aren’t inside the config folder.

Here is my automation (using the UI):

Action Type: Call Service
Service: camera.snapshot
Service Data:

{
  "entity_id": "camera.front_doorbell_live",
  "filename": "'/photos/doorbird.jpg'"
}

Appreciate your help!

Try this:
“filename”: “‘photos/doorbird.jpg’”

The leading “/” refers to the root, not the HomeAssistant folder. And since root owns the root folder, user homeassistant can’t access it.

There are 2 things wrong with this.

The path, as I mentioned, cannot start with a / unless it actually resides on the root path /

You shouldn’t have double and single quotes on the path.

Thanks for the help. I actually tried both those variations already, and I get the same error:

Can’t write photos/doorbird.jpg, no access to path!

Really stumped here.

If photos is in the config folder then try
“filename”: “photos/doorbird.jpg”

If that doesn’t work you may need to whitelist photos folder
or “filename”: “/config/photos/doorbird.jpg” as the config folder is in the root of the Home Assistant container…

Thanks David! Adding /config/photos/ to the whitelist got it working!

1 Like

@ jwilliams could you please paste your configuration on both, the whitelist and the automation, i’m having the same problem but nothing is working, tried everything, thanks

Hi peteonus,

Sure. Here you go:

- id: frontyard_doorbell
  alias: Front Doorbell
  trigger:
  - event_data: {}
    event_type: doorbird_front_doorbell_button
    platform: event
  condition: []
  action:
  - data:
      message: There is somebody at the Front Door!
      target: '-396173007'
    service: telegram_bot.send_message
  - alias: ''
    data:
      entity_id: camera.front_doorbell_live
      filename: photos/doorbird.jpg
    service: camera.snapshot
  - data:
      caption: Doorbell
      file: photos/doorbird.jpg
      target: '-396173007'
    service: telegram_bot.send_photo
  - data: {}
    service: script.frontyard_doorbell
  initial_state: true

Here is the whitelist entry:

  # Whitelist Folders
  whitelist_external_dirs:
    - /config/photos/

Hope this helps!

2 Likes

thanks for your help, it finally worked

Thank you! It solved also my problem. I find it weird HA can’t write in its own folder while it is able to modify its config files, log file, zwave config file etc. But well, glad this trick with whitelist worked for me!

Hi Dears,
I have similar problem having the images in location1: usr/share/hassio/share/motioneye
creating a shell_command to move the images from location1 to /config/www/ the script fail with code 127.

Adding usr/share/hassio/share/motioneye in the whitelist_external_dirs report an error in the configuration verification:
‘’‘not a directory @ data[‘whitelist_external_dirs’][0]’’’

any idea on how to access dirs outside /config?
My hassio is installed in docker in ubuntu 19

Thanks in advance.
Marcos.

1 Like