haaska
haaska copied to clipboard
Lambda test fails! Log showing incomplete domain name!
Hello,
I have my own Live server that is hosting multiple services in sub-domains. Like - ha.xx-cloud.ga for my Home Assistant next.xx-cloud.ga for my Nextcloud etc.
In the config.jason, I have this setting -
{
"url": "https://ha.my-cloud.ga",
"bearer_token": "eyJ0eXAiOiJKVXXXXXXXXXXXXXUzI1NiJ9.eyJpXXXXXXXXXXX4NzFmNTA0NjkyYjgyM2MwM2IyZWU3NmI2OSIsImXXXXXXXXXXXMzc3Mjc1NiwiZXhwIjoxOXXXXXXXXXXXXXXXNzU2fQ.2Ygw5LRlW3Rru-W0fxan-XXXXXXXXXXXXXXXXX-yo",
"debug": false,
"ssl_verify": false,
"ssl_client": []
}
But, when I run the Lambda Test, it is giving this error all the time -
{
"errorMessage": "HTTPSConnectionPool(host='ha.xx-cloud.g', port=443): Max retries exceeded with url: /api/alexa/smart_home (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f71af00f048>: Failed to establish a new connection: [Errno -2] Name or service not known',))",
"errorType": "ConnectionError",
"stackTrace": [
[
"/var/task/haaska.py",
111,
"event_handler",
"return ha.post('alexa/smart_home', event, wait=True)"
],
[
"/var/task/haaska.py",
65,
"post",
"timeout=(None, read_timeout))"
],
[
"/var/task/requests/sessions.py",
581,
"post",
"return self.request('POST', url, data=data, json=json, **kwargs)"
],
[
"/var/task/requests/sessions.py",
533,
"request",
"resp = self.send(prep, **send_kwargs)"
],
[
"/var/task/requests/sessions.py",
646,
"send",
"r = adapter.send(request, **kwargs)"
],
[
"/var/task/requests/adapters.py",
516,
"send",
"raise ConnectionError(e, request=request)"
]
]
}
Pls note that 1st line, instate of ha.xx-cloud.ga, it is trying to connect ha.xx-cloud.g! .g instate of .ga!
No code modification is done at my end. Pls suggest.
Hey,
i have the same issue with a .casa tld.
I get it to work by changing line 46 in haaska.py from
return f'{self.config.url}/api/{endpoint}'
to
return f'https://ha.myurl.casa/api/{endpoint}'
.
So you could try to change it to
return f'https://ha.my-cloud.ga/api/{endpoint}'
.
I hope this helped you.
This Bug must be fixed in future release.
Saving "config.json" isn't enough in the aws console isn't enough. You must also click the "Deploy" button, otherwise your change will be ignored.
Hi all, I can confirm the same problem and the "solution" proposed by @TheEric0802 "fixed" the test. Hope there is a way to fix it in a more definitive way in the future