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
73.63k stars 30.78k forks source link

Synology DSM fails setup when user is (intentionally) not granted Surveillance Station permission #106026

Closed 6twenty closed 7 months ago

6twenty commented 10 months ago

The problem

I have Surveillance Station set up on DSM, but I don't want to pull those into HA. The docs seem to suggest that this should be fine:

If you want to add cameras from Surveillance Station, the user needs application permission for Surveillance Station.

I don't want to add cameras, so I didn't give the user permission for Surveillance Station. However the device setup fails with an error trying to read Surveillance Station's Home Mode:

Unexpected error fetching [IP REDACTED] SynologyDSMSwitchUpdateCoordinator data: {'api': 'SYNO.SurveillanceStation.HomeMode', 'code': 160, 'reason': 'Insufficient application privilege', 'details': None}

What version of Home Assistant Core has the issue?

core-2023.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Synology DSM

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.synology_dsm.coordinator
Source: helpers/update_coordinator.py:290
Integration: Synology DSM (documentation, issues)
First occurred: 2:22:11 PM (14 occurrences)
Last logged: 2:35:51 PM

Unexpected error fetching [IP REDACTED] SynologyDSMSwitchUpdateCoordinator data: {'api': 'SYNO.SurveillanceStation.HomeMode', 'code': 160, 'reason': 'Insufficient application privilege', 'details': None}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/coordinator.py", line 73, in _async_update_data
    "switches": {"home_mode": await surveillance_station.get_home_mode_status()}
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/synology_dsm/api/surveillance_station/__init__.py", line 153, in get_home_mode_status
    raw_data = await self._dsm.get(self.HOME_MODE_API_KEY, "GetInfo")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/synology_dsm/synology_dsm.py", line 207, in get
    return await self._request("GET", api, method, params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/synology_dsm/synology_dsm.py", line 296, in _request
    raise SynologyDSMAPIErrorException(
synology_dsm.exceptions.SynologyDSMAPIErrorException: {'api': 'SYNO.SurveillanceStation.HomeMode', 'code': 160, 'reason': 'Insufficient application privilege', 'details': None}

Additional information

No response

home-assistant[bot] commented 10 months ago

Hey there @hacf-fr, @quentame, @mib1185, mind taking a look at this issue as it has been labeled with an integration (synology_dsm) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `synology_dsm` 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 synology_dsm` 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)


synology_dsm documentation synology_dsm source (message by IssueLinks)

issue-triage-workflows[bot] commented 7 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

6twenty commented 7 months ago

Can confirm the issue still occurs on core-2024.3.0