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
72.18k stars 30.2k forks source link

SmartThing non working afert update Core and SO #115800

Open Freitag29 opened 5 months ago

Freitag29 commented 5 months ago

The problem

Hi, afert update CORE and SO of HA SmartThing was stop working. Afeter remove the integration when i try to reinstall, recive the error: " Impossibile caricare il flusso di configurazione: 500 Internal Server Error Server got itself in trouble " thi is the record of the error: Registratore: aiohttp.server Fonte: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421 Prima occorrenza: 11:47:35 (1 occorrenze) Ultima registrazione: 11:47:35

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post return await self._post_impl(request, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl return await super()._post_impl(request, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl result = await self._flow_mgr.async_init( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1267, in async_init flow, result = await self._async_init(flow_id, handler, context, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1297, in _async_init result = await self._async_handle_step(flow, flow.init_step, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 64, in async_step_user await setup_smartapp_endpoint( File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 274, in setup_smartapp_endpoint else webhook.async_generate_url(hass, config[CONF_WEBHOOK_ID]), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/webhook/init.py", line 100, in async_generate_url f"{get_url( ^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 212, in get_url raise NoURLAvailableError homeassistant.helpers.network.NoURLAvailableError

Can enyone help me?

What version of Home Assistant Core has the issue?

2024.4.3

What was the last working version of Home Assistant Core?

2024.4.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SmartThing

Link to integration documentation on our website

No response

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 5 months ago

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

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


smartthings documentation smartthings source (message by IssueLinks)

cast-hdmu commented 5 months ago

The problem

Hi, afert update CORE and SO of HA SmartThing was stop working. Afeter remove the integration when i try to reinstall, recive the error: " Impossibile caricare il flusso di configurazione: 500 Internal Server Error Server got itself in trouble " Can enyone help me?

What version of Home Assistant Core has the issue?

2024.4.3

What was the last working version of Home Assistant Core?

2024.4.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SmartThing

Link to integration documentation on our website

No response

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

Hey, had the same problem. I created a new smartthings token and mine works. Maybe it helps you too.

Freitag29 commented 5 months ago

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

I've try but it is not working

Freitag29 commented 5 months ago

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

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

smartthings documentation smartthings source (message by IssueLinks)

sorry but i don't understand what you talk

DrBlokmeister commented 3 months ago

I'm having the same issue since a few weeks. Likely also after the last update. This is my log entry:

2024-06-09 20:20:11.320 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry My home for smartthings
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 134, in async_setup_entry
    token = await api.generate_tokens(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/smartthings.py", line 209, in generate_tokens
    result = await self._service.generate_tokens(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 424, in generate_tokens
    raise APIInvalidGrant(data.get("error_description"))
pysmartthings.errors.APIInvalidGrant: Invalid refresh token: <refresh_token> requested by clientId: <client_id> with grantType: refresh_token, e.cause: no cause

I have tried manually creating a new token and copy-pasting it to my core.config_entries file, but this also fails.

Update: I removed the configuration and re-added. Now it works again.

Freitag29 commented 3 months ago

Great!!! But i dont know haw i do for remove the configuration. I've removed the integration but when i try tu reinstall i recevid the error

I'm having the same issue since a few weeks. Likely also after the last update. This is my log entry:

2024-06-09 20:20:11.320 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry My home for smartthings
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 134, in async_setup_entry
    token = await api.generate_tokens(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/smartthings.py", line 209, in generate_tokens
    result = await self._service.generate_tokens(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 424, in generate_tokens
    raise APIInvalidGrant(data.get("error_description"))
pysmartthings.errors.APIInvalidGrant: Invalid refresh token: <refresh_token> requested by clientId: <client_id> with grantType: refresh_token, e.cause: no cause

I have tried manually creating a new token and copy-pasting it to my core.config_entries file, but this also fails.

Update: I removed the configuration and re-added. Now it works again.

issue-triage-workflows[bot] commented 4 days 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.