Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda test fails! Log showing incomplete domain name! #226

Open
iosoft opened this issue Oct 10, 2021 · 4 comments
Open

Lambda test fails! Log showing incomplete domain name! #226

iosoft opened this issue Oct 10, 2021 · 4 comments

Comments

@iosoft
Copy link

iosoft commented Oct 10, 2021

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.

@TheEric0802
Copy link

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.

@iosoft
Copy link
Author

iosoft commented Oct 15, 2021

This Bug must be fixed in future release.

@kerryland
Copy link

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.

@pippo73
Copy link

pippo73 commented Dec 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants