You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a check for this in home-assistant/core#110023 because the code in config entries assumes .state is an internal state does not handle it being changed out from under it (changing externally means we don't dispatch the state change to the UI, or update the retry count)
Reproduction steps
Have an invalid token
Debug logs
2024-03-01 11:26:44.322 ERROR (MainThread) [custom_components.hacs] HACS is disabled - invalid_token
2024-03-01 11:26:44.323 ERROR (MainThread) [custom_components.hacs] state cannot be changed
Traceback (most recent call last):
File "/Users/bdraco/home-assistant/config/custom_components/hacs/base.py", line 511, in async_github_api_method
return await method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bdraco/home-assistant/venv/lib/python3.12/site-packages/aiogithubapi/github.py", line 224, in rate_limit
response = await self._client.async_call_api(endpoint="/rate_limit", **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bdraco/home-assistant/venv/lib/python3.12/site-packages/aiogithubapi/client.py", line 146, in async_call_api
raise exception(message or response.data)
aiogithubapi.exceptions.GitHubAuthenticationException: Bad credentials
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/bdraco/home-assistant/config/custom_components/hacs/base.py", line 471, in async_can_update
response = await self.async_github_api_method(self.githubapi.rate_limit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bdraco/home-assistant/config/custom_components/hacs/base.py", line 513, in async_github_api_method
self.disable_hacs(HacsDisabledReason.INVALID_TOKEN)
File "/Users/bdraco/home-assistant/config/custom_components/hacs/base.py", line 408, in disable_hacs
self.configuration.config_entry.state = ConfigEntryState.SETUP_ERROR
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 413, in __setattr__
raise AttributeError(f"{key} cannot be changed")
AttributeError: state cannot be changed
### Diagnostics dump
_No response_
The text was updated successfully, but these errors were encountered:
Make sure you have read the issue guidelines and that you filled out the entire template.
If you have an issue identical to this, do not add comments like "same here", "i have this too", instead add a 👍 reaction to the issue description. Thanks! 👍
System Health details
n/a
Checklist
Describe the issue
integration/custom_components/hacs/base.py
Line 408 in a422090
I added a check for this in home-assistant/core#110023 because the code in config entries assumes
.state
is an internal state does not handle it being changed out from under it (changing externally means we don't dispatch the state change to the UI, or update the retry count)Reproduction steps
Have an invalid token
Debug logs
The text was updated successfully, but these errors were encountered: