picklepete / pyicloud

A Python + iCloud wrapper to access iPhone and Calendar data.
MIT License
2.57k stars 452 forks source link

ubiquity - pyicloud.exceptions.PyiCloudAPIResponseError: Service Unavailable (503) #195

Open miloskv opened 6 years ago

miloskv commented 6 years ago

Hi there

I'm receiving a traceback after exception is hit when I try to use "api.files" service (ubiquity). I am able to use successfully other service that I tested (api.devices)

I'm not sure if something changed in iCloud Drive that is causing this.

Traceback (most recent call last):
  File "./icloud.py", line 39, in <module>
    main()
  File "./icloud.py", line 35, in main
    print(dir(api.files.root))
  File "/Users/xxx/virtualenvs/icloud_attempt/lib/python3.6/site-packages/pyicloud/services/ubiquity.py", line 44, in root
    self._root = self.get_node(0)
  File "/Users/xxx/virtualenvs/icloud_attempt/lib/python3.6/site-packages/pyicloud/services/ubiquity.py", line 24, in get_node
    request = self.session.get(self.get_node_url(id))
  File "/Users/xxx/virtualenvs/icloud_attempt/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/Users/xxx/virtualenvs/icloud_attempt/lib/python3.6/site-packages/pyicloud/base.py", line 74, in request
    self._raise_error(response.status_code, response.reason)
  File "/Users/xxx/virtualenvs/icloud_attempt/lib/python3.6/site-packages/pyicloud/base.py", line 122, in _raise_error
    raise api_error
pyicloud.exceptions.PyiCloudAPIResponseError: Service Unavailable (503)
dsouzarc commented 5 years ago

It looks like this is all the way down when you first try to make a request to log-in (PyiCloudAPIResponseError); I'm wondering if this is because of some Internet error or VirtualEnv setting where the script can't make a request to iCloud --> if it was a PyiCloudFailedLoginException, I'd say it was because of incorrect login information.

miloskv commented 5 years ago

Hi,

Thanks for your reply. The same script works when I query other services. It’s just icloud service that’s failing for me

I will send you some outputs later if you want to show you what works and what does not

Milos

Sent from my iPhone

On 7 Dec 2018, at 7:06 AM, dsouzarc notifications@github.com wrote:

It looks like this is all the way down when you first try to make a request to log-in (PyiCloudAPIResponseError); I'm wondering if this is because of some Internet error or VirtualEnv setting where the script can't make a request to iCloud --> if it was a PyiCloudFailedLoginException, I'd say it was because of incorrect login information.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Vinz87 commented 5 years ago

Hi, I experience the same error.

Quentame commented 4 years ago

Hi !

Is the issue still there with the new version of the lib ?

Thanks

landall commented 4 years ago

Hi !

Is the issue still there with the new version of the lib ?

Thanks

I get the same error in 0.9.6.1. How can I add proxy to fiddler and close ssl cert verify?

ixs commented 4 years ago

@landall Have a look at https://github.com/picklepete/pyicloud/blob/master/CODE_SAMPLES.md#debug-build-of-pyicloud which explains how to disable SSL verification for use with fiddler. But it also shows, how to get dumps of what requests are sent on the wire, which might mean you do not even need fiddler.

miku commented 2 years ago

If I'm printing out the URL of the request that yields a 503 I get something like:

https://p09-ubiquityws.icloud.com:443/ws/123123123/item/0

The Content-Length is 23 bytes and says:

Account migrated