picklepete / pyicloud

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

421 Authentication Error #441

Open fjshomeplate opened 9 months ago

fjshomeplate commented 9 months ago

The problem

Environment

Traceback/Error logs

Traceback (most recent call last):
  File "/Users/******/Documents/School/Schoology Automations/AutoAssign/AutoAssign.py", line 56, in <module>
    print(api.calendar.events())
  File "/Users/******/Library/Python/3.9/lib/python/site-packages/pyicloud/services/calendar.py", line 64, in events
    self.refresh_client(from_dt, to_dt)
  File "/Users/******/Library/Python/3.9/lib/python/site-packages/pyicloud/services/calendar.py", line 57, in refresh_client
    req = self.session.get(self._calendar_refresh_url, params=params)
  File "/Users/******/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
  File "/Users/******/Library/Python/3.9/lib/python/site-packages/pyicloud/base.py", line 131, in request
    return self.request(method, url, **kwargs)
  File "/Users/******/Library/Python/3.9/lib/python/site-packages/pyicloud/base.py", line 133, in request
    self._raise_error(response.status_code, response.reason)
  File "/Users/******/Library/Python/3.9/lib/python/site-packages/pyicloud/base.py", line 189, in _raise_error
    raise api_error
pyicloud.exceptions.PyiCloudAPIResponseException: Authentication required for Account. (421)

Checklist

Additional information

I've seen other posts about this issue for the calendar service, but not for the reminders event. I have 2fa turned on if it matters.

russinnes commented 7 months ago

See my fix in #406

It solves the auth issue, but leaves you with the iCloud reminders upgrade response. Apple made a change a few years back [will post a new issue]

mustache-commits commented 4 months ago

@russinnes, any luck here with reminders? I'm not getting the list of reminders, neither can I post anything.

404 errors and missing lists.