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.68k stars 30.81k forks source link

Smartthings 500 error #84086

Closed Riperro closed 1 year ago

Riperro commented 1 year ago

The problem

Keep getting this error when I try to add Smartthings on integrations.

image

What version of Home Assistant Core has the issue?

2022.12.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Smartthings

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Anything in the logs that might be useful for us?

Logger: aiohttp.server
Source: components/webhook/__init__.py:46
First occurred: 8:43:25 PM (1 occurrences)
Last logged: 8:43:25 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 148, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 226, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 253, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 60, in async_step_user
    await setup_smartapp_endpoint(self.hass)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 226, in setup_smartapp_endpoint
    webhook.async_register(
  File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 46, in async_register
    raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!

Additional information

No response

home-assistant[bot] commented 1 year 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` Change the title of 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.

(message by CodeOwnersMention)


smartthings documentation smartthings source (message by IssueLinks)

davokr commented 1 year ago

Same issue, fresh install on Generic x86-x64

dreyerfamily commented 1 year ago

Same issue.

Home Assistant 2022.12.8 Supervisor 2022.12.1 Operating System 9.4 Frontend 20221213.1 - latest

pedromrg commented 1 year ago

Same issue here:

Home Assistant 2022.12.9 (same issue with 2022.12.8) Supervisor 2022.12.1 Operating System 9.4 Frontend 20221213.1 - latest

Riperro commented 1 year ago

FYI updated everything to current and still no fix. current build is now

Home Assistant 2022.12.9 Supervisor 2022.12.1 Operating System 9.4 Frontend 20221213.1 - latest

previous was 2022.12.8

Still same issue

Riperro commented 1 year ago

Figured it out

Open your terminal and ssh

cd/config/.storage then type ls this should list all the files in that hidden folder. there should be one that says smartthings type (mv smartthings smartthings.sav) then hit enter then type ls again and smartthings file should be renamed to smarttthings.sav. that's it. you can exit the terminal and reboot then run the integration and it should work now

dreyerfamily commented 1 year ago

@Riperro thank you for figuring it out. Would you mind helping out a guy with very limited knowledge of Terminal commands? When I type in the command: ssh cd/config/.storage I get: Could not resolve host name cd/config/.storage: Name does not resolve.

What am I doing wrong?

image
Riperro commented 1 year ago

@dreyerfamily Hey ssh is just what you're doing not part of the cmd ... you do not need to type that .. remove ssh cmd should be
cd/config/.storage

pedromrg commented 1 year ago

Did not solved it for me, still get "Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble" :(

Riperro commented 1 year ago

did you reboot?

dreyerfamily commented 1 year ago

@Riperro YOU ROCK!! That solved the problem.

A quick clarification to fellow newbies: There should be a space after the "cd" command. It should read: cd /config/.storage

pedromrg commented 1 year ago

@dreyerfamily Hey ssh is just what you're doing not part of the cmd ... you do not need to type that .. remove ssh cmd should be cd/config/.storage

I can rename this file OK, I reboot HA and then when I add the integration the same error appears and I can see the file got re-created :/

Riperro commented 1 year ago

@Riperro YOU ROCK!! That solved the problem.

A quick clarification to fellow newbies: There should be a space after the "cd" command. It should read: cd /config/.storage

Glad that helped!

pedromrg commented 1 year ago

Found my solution, and it was my mistake....

forgot to set the Home Assistant URL in HA settings - Network to my external URL, setting this solved the issue.

Riperro commented 1 year ago

Found my solution, and it was my mistake....

forgot to set the Home Assistant URL in HA settings - Network to my external URL, setting this solved the issue.

Great! Glad to help