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

Fix 450 error #230

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Fix 450 error #230

merged 2 commits into from
Feb 12, 2020

Conversation

Quentame
Copy link
Collaborator

@Quentame Quentame commented Feb 12, 2020

  • while refreshing client after 20 min of non request

Fixes #156

- while refreshing client after 20 min of non request
@reedriley
Copy link

I patched this diff locally to try it out (from within Home Assistant). My logs now show retry attempts when I encounter error 450, so that's great!

But then after several hours I see this error in the logs:

ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <REDACTED> for icloud
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='setup.icloud.com', port=443): Max retries exceeded with url: <REDACTED> (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f849c7b9150>: Failed to establish a new connection: [Errno -3] Try again'))
  File "/usr/src/homeassistant/homeassistant/components/icloud/__init__.py", line 124, in async_setup_entry
  File "/usr/src/homeassistant/homeassistant/components/icloud/account.py", line 100, in setup
    self._username, self._password, self._icloud_dir.path
  File "/usr/local/lib/python3.7/site-packages/pyicloud/base.py", line 203, in __init__
  File "/usr/local/lib/python3.7/site-packages/pyicloud/base.py", line 222, in authenticate
  File "/usr/local/lib/python3.7/site-packages/pyicloud/base.py", line 69, in request

After this error happens; I no longer see any further attempts to authenticate; no [pyicloud.services.findmyiphone.http] (450). Retrying ... lines, no successes and no failures.

Restarting Home Assistant fixes things. I suspect there are maybe two necessary bugfixes here; the first in pyicloud involving MaxRetryError and also in Home Assistant if there's any error handling you'd recommend be added to the icloud component.

@Quentame
Copy link
Collaborator Author

Quentame commented Feb 18, 2020

Hi @reedriley !

Thanks a lot for testing.

I think this gonna be fixed by #227 (because less requests).

Now that I am aware I'll tests better with your test case.

Actually fixing a lot of things in iCloud in HA.

@reedriley
Copy link

In that case, I'll patch #227 locally as well and let you know if anything breaks. 😁

@Quentame
Copy link
Collaborator Author

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

Successfully merging this pull request may close these issues.

api.devices leads to PyiCloudAPIResponseError: (450)
2 participants