haaska icon indicating copy to clipboard operation
haaska copied to clipboard

Lambda test fails! Log showing incomplete domain name!

Open iosoft opened this issue 3 years ago • 4 comments

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.

iosoft avatar Oct 10 '21 06:10 iosoft

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.

TheEric0802 avatar Oct 14 '21 19:10 TheEric0802

This Bug must be fixed in future release.

iosoft avatar Oct 15 '21 04:10 iosoft

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.

kerryland avatar Dec 01 '21 10:12 kerryland

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

pippo73 avatar Dec 15 '23 20:12 pippo73