[Camera snapshot] Error : Can't write '/tmp/xxxx.jpg', no access to path!

Hello, :wink:

I can not configure camera snapshots :frowning:
I use HA v 0.65 on hassio (Raspberry pi 3)

Here is the configuration :

homeassistant:
...
whitelist_external_dirs:
- /tmp     

When I test the service using :

{
ā€œentity_idā€: ā€œcamera.dlinkā€,
ā€œfilenameā€: ā€œā€˜/tmp/dlink.jpgā€™ā€
}

I have this error :

Can’t write ā€˜/tmp/dlink.jpg’, no access to path!

I restarted, but I still have the same problem

I’m having exactly the same problem since updating to 0.65.2 this morning.

camera.snapshot was working fine until the update (previous version 0.64), now I’m also getting the ā€˜no access to path!’ error.

Checked permissions to see if something had changed, also tried creating a new folder, but I can;t seem to get it to work.

Try reverting to 0.64 to check. If you can confirm, this might be something to report on github.

hmmm, I tried reverting. All seems to go well, ends with ā€˜Successfully installed homeassistant-0.64.0’ but the HomeAssistant info page is still showing 0.65.2

Tried clearing cache, using a different browser etc. Is there something else I can do to make sure I have the previous version? The problem persists after reverting, so I’d like to be sure which version is running.

Edit: Forgot to add that I also rebooted the RaspberryPi, to make suren everything was reset.

Look if you can rename entity directly in the UI ? If yes, you’re in 0.65

I tried again this morning and it worked first try, I must have done something wrong yesterday. (I was really tired…) I first updted to 0.65.3 to see if that fixed the ā€˜no access to path’ problem, but no go.

Anyway, reverting to version 0.64.0 fixed the problem, camera.snapshot is working again. Will report on github.

Some more info, after testing with 0.64.0 I upgraded to 0.64.3 and the problem returned. After downgrading again to 0.64.2 it worked again.

Seem to be related to a fix in the 0.64.3 release: (is_allowed_path: Also test folder #12788 #12807 (@kellerza - #12810)

Hello,

Thank you for the issue reporting mvdarend.

Kellerza has just answered but I admit I don’t understand… To be continued :slight_smile:

Also experiencing this issue. Was working fine in 0.59.2 for me.
It stopped working for me when I upgraded from 0.59.2 to 0.63.1
I’m now at 0.65.3 and still have the issue ā€œno access to pathā€.

:thinking:

Do you have any other solution to send camera snapshot to a telegram notification ?

@luca-angemi posted a workaround:

Found a workaround while it gets fixed: create a file with the same name of the snapshot in the same folder.
The camera.snapshot service won’t throw an error and your file will be overwritten.

Hello,

@mvdarend I’m not lucky, this tip doesn’t work for me :frowning:
Am I wrong somewhere ?

Manually created file :

/tmp/dlink.jpg

Whitelist :

  whitelist_external_dirs:
    - /tmp

Service :

{
  "entity_id": "camera.dlink",
  "filename": "'/tmp/dlink.jpg'"
}  

Error :

Can’t write ā€˜/tmp/dlink.jpg’, no access to path!

I’m not sure, I haven’t tried it myself yet. Two small things that may help:

My whitelist_external_dirs looks like this: (with trailing slash)

whitelist_external_dirs: /tmp/

I’m probably wrong, but do you need the double and single quotes in this line?

"filename": "'/tmp/dlink.jpg'"

I have changed my ā€˜whitelist_external_dirs’ like yours, same effect.

In the ā€œservices testā€ for dev :
If I don’t mark double quotes : I have an json editor error.
If I and don’t mark single quotes, the service hasn’t any effects.

Here is my automation :

- data:
      entity_id: camera.dlink
      filename: '/tmp/dlink.jpg'
    service: camera.snapshot

But I have the same error " can’t access to path" :frowning:

I have just upgraded to 0.65.4 and the workaround works for me. After creating the files as mentioned by @luca-angemi it works, if I remove them I get the ā€˜No access to path!’ error.

Have you checked your permissions? I have given the HomeAssistant user full acces to the /tmp/ folder, and also the files that need to be overwritten.

I don’t know how to edit permissions :anguished:

It is on samba share plugin settings ?

Edit : I use hassio on Raspberry pi 3

Thank you @mvdarend

I’m not sure how it works with Hassio. I have Hassbian running and use WinSCP to manage the files on the Raspberry Pi.

If you’re also using WinSCP all you have to do is navigate to the folder right-click → Options and give the HomeAssistant user sufficient privileges.

I’m not well versed in Linux, so I can’t really explain it well. If it doesn’t work then hopefully someone more knowledgeable can help .

Ok, thank you.

The subject to slightly derived, I will create a new topic.

The workaround is useless to some of us.

I have an automation that saves a snapshot from 2 different security cameras when motion is detected.
Saving the files to:
www/motion/front_porch_yyyymmdd_hhmmss.png
www/motion/driveway_yyyymmdd_hhmmss.png

Is there a workaround for variable filenames?
Is there an ETA for a full fix?
I’m at 0.65.3 currently.

Same problem here with 0.69
Anyone has figured this out and could you post your working scripts?

2 Likes