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
69.7k stars 28.86k forks source link

Error on device update. Require user auth scope MODERATOR_READ_FOLLOWERS #120798

Open DHandspikerWade opened 2 days ago

DHandspikerWade commented 2 days ago

The problem

Installed Twitch integration via the UI, entered Client ID and Secret, and completed auth-flow. No sensors are created. Logs are complaining about API scope. There was no option to select scope during the connection.

What version of Home Assistant Core has the issue?

core-2024.6.4

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

twitch

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

twitch: Error on device update!

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 729, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1289, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/twitch/sensor.py", line 93, in async_update
    followers = await self._client.get_channel_followers(self._channel.id)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.12/site-packages/twitchAPI/twitch.py", line 1789, in get_channel_followers
    Minimum 1, Maximum 100 |default| :code:`20`
  File "/config/deps/lib/python3.12/site-packages/twitchAPI/twitch.py", line 535, in _build_iter_result
    if len(d) == 0:
  File "/config/deps/lib/python3.12/site-packages/twitchAPI/twitch.py", line 489, in __api_get_request
    'req': self._api_request,
          ^^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.12/site-packages/twitchAPI/twitch.py", line 310, in __generate_header
    has_auth, target, token, scope = self._get_used_either_auth(required_scope)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
twitchAPI.types.MissingScopeException: Require user auth scope MODERATOR_READ_FOLLOWERS

Additional information

Installed to migrate from ha_twitch_helix

home-assistant[bot] commented 2 days ago

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

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


twitch documentation twitch source (message by IssueLinks)