Closed kideg20 closed 3 weeks 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!
(message by CodeOwnersMention)
smartthings documentation smartthings source (message by IssueLinks)
Logger: homeassistant.components.smartthings.config_flow Source: components/smartthings/config_flow.py:131 integration: SmartThings (documentation, issues) First occurred: 12:10:28 PM (2 occurrences) Last logged: 12:10:54 PM
API error setting up the SmartApp: {'requestId': '1178667507691754528', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://homeassistant.xxx.com:8123/api/webhook/', 'message': 'Upstream target timed out', 'details': []}]}}
API error setting up the SmartApp: {'requestId': '4235978607217639635', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://homeassistant.xxx.com:8123/api/webhook/
', 'message': 'Upstream target timed out', 'details': []}]}}
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 131, in async_step_pat
app, client = await create_app(self.hass, self.api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 145, in create_app
app, client = await api.create_app(app)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pysmartthings/smartthings.py", line 110, in create_app
entity = await self._service.create_app(app.to_data())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 171, in create_app
return await self.post(API_APPS, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 395, in post
return await self.request("post", self._api_base + resource, data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 368, in request
raise APIResponseError(
pysmartthings.errors.APIResponseError: Unprocessable Entity (422): {"requestId": "1178667507691754528", "error": {"code": "ConstraintViolationError", "message": "The request is malformed.", "details": [{"code": "TargetTimeoutError", "target": "https://homeassistant.xxx.com:8123/api/webhook/
", "message": "Upstream target timed out", "details": []}]}}
No its not my firewall I have modified it to pass the required IP addresses.
Hello, same error here. with HA 2024.3.3
2024-03-29 12:12:01.931 DEBUG (MainThread) [homeassistant.components.smartthings.smartapp] Setup endpoint for https://home.xxxx.it:8123/api/webhook/xxxxxxx 2024-03-29 12:12:11.648 ERROR (MainThread) [homeassistant.components.smartthings.config_flow] API error setting up the SmartApp: {'requestId': '8809644606287907393', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://home.xxxx.it:8123/api/webhook/xxxxxxx', 'message': 'Upstream target timed out', 'details': []}]}} Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 131, in async_step_pat app, client = await create_app(self.hass, self.api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 145, in create_app app, client = await api.create_app(app) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysmartthings/smartthings.py", line 110, in create_app entity = await self._service.create_app(app.to_data()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 171, in create_app return await self.post(API_APPS, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 395, in post return await self.request("post", self._api_base + resource, data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 368, in request raise APIResponseError( pysmartthings.errors.APIResponseError: Unprocessable Entity (422): {"requestId": "8809644606287907393", "error": {"code": "ConstraintViolationError", "message": "The request is malformed.", "details": [{"code": "TargetTimeoutError", "target": "https://home.xxxx.it:8123/api/webhook/xxxxxxx", "message": "Upstream target timed out", "details": []}]}}
I solved my problem reported above. In my cause it was caused by TLS/SSL validation issue.
First I checked on https://www.digicert.com/help/. It said my TLS chain could be not totally trusted by everyone
I found this https://phoenixnap.com/kb/install-ssl-certificate-nginx which pointed me out to the right direction: creating a crt bundle, merging SSL domain certificate and intermediate + CA certificate in a single fullchain.pem cert file
I updated fullchain.pem file on my HA and rebooted
Smarthings registration could be finally be completed!
Hope it could help someone else.
hey, i had the exact same issue. My HA setup is protected by Cloudflare with full TLS Offloading. I solved the issue by "downgrading" the security from TLS 1.3 only to TLS 1.2 accepted. It solved the issue.
It seems that the TLS implementation is to be explicited quite a bit : fully trusted certification chain, and TLS 1.2 compatibility. Might be related to samsung service i guess ...
hope this will help
I checked my website on n https://www.digicert.com/help/. I
All green check boxes.
Same error as reported above, request is malformed
Edit: Found the problem for anyone also using Cloudflare. CF security was blocking every request that was being made to webhook and classifying the requests as Bots. This explains why I was able to make requests to it manually.
CF security was blocking every request that was being made to webhook and classifying the requests as Bots. This explains why I was able to make requests to it manually.
I also confirm the issue was Cloudflare Bot fight mode turned on under Security > Bots. Disabling it fixed the issue
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.
The problem
SmartThings could not validate the webhook URL. Please ensure the webhook URL is reachable from the internet and try again.
I'm using Cloudflare to open my homeassistant to the internet. The URL is available from the internet. SSL/TLS is valid (generated by cloudflare)
This command:
works with EXTERNAL URL output:
What version of Home Assistant Core has the issue?
core-2024.2.2
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
smarthings
Link to integration documentation on our website
https://www.home-assistant.io/integrations/smartthings
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response