home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.98k stars 29.63k forks source link

File notifications stopped working in latest release #120175

Open AndySymons opened 2 months ago

AndySymons commented 2 months ago

The problem

After upgrade to 2024.6.4 I got errors for all automations that use logfile notifications, saying that the automation is calling a service that is not available.

The File integration gives errors for every file saying that it is "not allowed to write to the file". I have not changed the permissions and can access the files from Studio Code Server normally.

I had to revert to 2024.5.5 to get the system working again.

What version of Home Assistant Core has the issue?

2024.6.4

What was the last working version of Home Assistant Core?

2024.5.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

File

Link to integration documentation on our website

https://www.home-assistant.io/integrations/file/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @fabaff, mind taking a look at this issue as it has been labeled with an integration (file) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `file` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign file` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


file documentation file source (message by IssueLinks)

gjohansson-ST commented 2 months ago

Are the paths of the files you're trying to write to listed in the allow-list https://www.home-assistant.io/integrations/homeassistant/#allowlist_external_dirs

0101binary0101 commented 2 months ago

Yep I have the same issue and it was broke in 2024.6.2 , but I didn't spot it until after a platform reboot.

And yes I have my allow-list , because it WAS working before hand.

This is what is shown in the system config section .. image

homeassistant:
  customize: !include customize.yaml
  allowlist_external_dirs:
    - /share/tuyapower
    - /share/
    - /tmp/
    - /share

sensor:

  - platform: file
    name: esxi_pi401_temp
    value_template: "{{ value_json.temp }}"
    unit_of_measurement: °C
    file_path: /share/esxi_pi401_temp.json
    scan_interval: 70
kaijk commented 2 months ago

Try commenting out the scan_interval from your sensor.

0101binary0101 commented 2 months ago

Try commenting out the scan_interval from your sensor.

Try ??? What's the qualification that this 'try' would have resolved the issue ?

It did not change the outcome - The sensor still remains broken and still notifications of the 'File' exist after an HA restart. image

yuremboo commented 2 weeks ago

Are there any updates on this? It's still not working in version 2024.8.1.

gjohansson-ST commented 2 weeks ago

Honestly did you even check the integrations in the UI if it now provides and entity from a configuration entry and thereby you changes your automations and scripts to use that one instead. It says so per the instructions in the repairs you have. One that the yaml can be removed and one that you need to update your automations and scripts.

Just saying it doesn't work gives nothing to work with and if it doesn't you should have something in the log explaining what the issue is.

yuremboo commented 2 weeks ago

Honestly did you even check the integrations in the UI if it now provides and entity from a configuration entry and thereby you changes your automations and scripts to use that one instead. It says so per the instructions in the repairs you have. One that the yaml can be removed and one that you need to update your automations and scripts.

Just saying it doesn't work gives nothing to work with and if it doesn't you should have something in the log explaining what the issue is.

So it was moved from the yaml to ui, got it. But imho it became not usable, I need to create 48 entities from one json file, so I'd rather add them via yaml than via ui clik one by one, and rename every entity.

gjohansson-ST commented 2 weeks ago

So it seems I need some more information from the original issue here. The rest are not an issue as it's per design and you're not following the instructions in the repair notifications e.g. remove yaml and change the notify entity in automations/scripts.

I get you might have opinions about moving from yaml to UI but that's not an issue in itself so if you need to express your opinion and concerns with that I would refer you to our community forum.

0101binary0101 commented 1 week ago

Yeah the GUI does work.

So I guess the problem has gone away via the entity migration steps to get it looking the same: - To get it looking the same instead of 'file [] ' (when you create it using the gui) etc you then have to delete the original entity, create the new entity via the gui, rename the entity etc..

I have quite a few file entities hence why it was easier for me to write a script to generate yaml and paste it when the old way worked. So with the GUI after several repetitive strain injuries you can get it back looking the same, well that's progress I guess. As you said - that's for the community forum I guess :)

The gui - adds the entries to the .storage/core.config_entries - and I don't fancy modifying that on the file directly

0101binary0101 commented 1 week ago

Also now that the gui is the preferred new method is this documentation page now obsolete, apart from the allowlist_external_dirs bit ?

https://www.home-assistant.io/integrations/file/

I think this is what threw me was that I couldn't see any mention in the sensor files section to the new gui configuration.