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
71.72k stars 29.98k forks source link

Aladdin Connect "failed to set up" after working initially #118987

Closed patienttruth closed 3 months ago

patienttruth commented 3 months ago

The problem

After upgrading to 2024.6.0 yesterday The integration worked initially. I was able to control both doors.

This morning I saw errors about missing entities and investigated after one of my automations did not function.

I reloaded the Aladdin Connect integration, and I got the error "failed to set up, see logs".

Before I restarted there was a very similar error in the log in addition to the one below, the notable difference for me was that there was a different key where devices is listed here. Unfortunately I did not copy it.

As far as I can tell everything was working great last night after the update and initial configuration.

I want to add "thank you to everyone who brought this integration back online!".

What version of Home Assistant Core has the issue?

2024.6.1

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

Aladdin Connect

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 07:23:54 (4 occurrences)
Last logged: 07:38:52

Error setting up entry email@gmail.com for aladdin_connect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/aladdin_connect/__init__.py", line 36, in async_setup_entry
    await coordinator.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/aladdin_connect/coordinator.py", line 33, in async_setup
    self.doors = await self.acc.get_doors()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/genie_partner_sdk/client.py", line 21, in get_doors
    for device in data["devices"]:
                  ~~~~^^^^^^^^^^^
KeyError: 'devices'

Additional information

No response

home-assistant[bot] commented 3 months ago

Hey there @swcloudgenie, mind taking a look at this issue as it has been labeled with an integration (aladdin_connect) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `aladdin_connect` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign aladdin_connect` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


aladdin_connect documentation aladdin_connect source (message by IssueLinks)

reotto613 commented 3 months ago

Saw this issue, went and checked mine and it lost connection last night after working yesterday a couple of times in an automation.

To add context I deleted the integration, and reloaded. Everything worked fine as far as resetting it back up, but once I went and looked the same issue was present.

`Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 9:50:19 AM (1 occurrences) Last logged: 9:50:19 AM

Error setting up entry XXXXX@XXXX.com for aladdin_connect

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/aladdin_connect/init.py", line 36, in async_setup_entry await coordinator.async_setup() File "/usr/src/homeassistant/homeassistant/components/aladdin_connect/coordinator.py", line 33, in async_setup self.doors = await self.acc.get_doors() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/genie_partner_sdk/client.py", line 21, in get_doors for device in data["devices"]:


KeyError: 'devices'`

Changed my email address in the above log.
patienttruth commented 3 months ago

Same here, I tried deleting and reauthenticating as well.

dap35 commented 3 months ago

Tried setting this up today after upgrading to 2024.6, but getting similar errors. Then I rebooted HA, and then reloaded the integration. Might be working now.... a bit sketchy.

swcloudgenie commented 3 months ago

It looks like we started throttling requests at some point after the update. I have increased the quota and the number of throttled requests is reducing. It may take up to 15 minutes for the new settings to fully take effect. However, I was previously getting the same error, and now I am no longer having issues.

For anyone having this issue, please try uninstalling/reinstalling again and let me know if you continue to have issues.

swcloudgenie commented 3 months ago

Tried setting this up today after upgrading to 2024.6, but getting similar errors. Then I rebooted HA, and then reloaded the integration. Might be working now.... a bit sketchy.

It seems like you may have rebooted around the same time I adjusted our rate limit settings.

swcloudgenie commented 3 months ago

I have now seen the error rate drop to zero on our end. I have also tested on my own integration and it appears to be working fine now. @patienttruth let me know when you are able to test this again.

reotto613 commented 3 months ago

I did a simple reload on my end, and it is back and up and running.

patienttruth commented 3 months ago

Does this mean that more people are using the integration than expected? 😁

I have now seen the error rate drop to zero on our end. I have also tested on my own integration and it appears to be working fine now. @patienttruth let me know when you are able to test this again.

I just reloaded the integration and no error. Thank you for the quick repair!

swcloudgenie commented 3 months ago

Hello. Upon reinstalling it sends me through the oauth flow where the oauth authorize domain app.aladdinconnect.com defined in the constants does not resolve to an IP address. Is this integration currently unavailable? Thank you.

I have submitted a PR to fix this here: https://github.com/home-assistant/core/pull/119336

In the meantime, you can change .com to .net to fix the issue locally.