mandarons / icloud-drive-docker

Dockerized iCloud Client - make a local copy of your iCloud documents and photos, and keep it automatically up-to-date.
BSD 3-Clause "New" or "Revised" License
962 stars 46 forks source link

[BUG] Bad username or password #212

Closed ArjanAssink closed 3 weeks ago

ArjanAssink commented 1 month ago

Describe the bug I have 2 docker containers running for 2 iCloud accounts, both have been working fine for weeks/months. However since the last time I've had to reauthenticate for 2FA, one of them is giving me a Bad username or password error. The login used matches the one in the config yaml and the password is correct (verified by logging in to iCloud.com). I've updated to the latest version but the issue persists.

A clear and concise description of what the bug is.

The error I get after the 3rd login attempt:

Enter iCloud password for [xxx]: Traceback (most recent call last): File "/app/venv/lib/python3.10/site-packages/icloudpy/base.py", line 362, in _authenticate_with_token req = self.session.post( File "/app/venv/lib/python3.10/site-packages/requests/sessions.py", line 635, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/app/venv/lib/python3.10/site-packages/icloudpy/base.py", line 158, in request self._raise_error(code, reason) File "/app/venv/lib/python3.10/site-packages/icloudpy/base.py", line 187, in _raise_error raise api_error icloudpy.exceptions.ICloudPyAPIResponseException: Missing apple_id field

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/app/venv/lib/python3.10/site-packages/icloudpy/cmdline.py", line 223, in main else ICloudPyService( File "/app/venv/lib/python3.10/site-packages/icloudpy/base.py", line 277, in init self.authenticate() File "/app/venv/lib/python3.10/site-packages/icloudpy/base.py", line 346, in authenticate self._authenticate_with_token() File "/app/venv/lib/python3.10/site-packages/icloudpy/base.py", line 368, in _authenticate_with_token raise ICloudPyFailedLoginException(msg, error) from error icloudpy.exceptions.ICloudPyFailedLoginException: ('Invalid authentication token.', ICloudPyAPIResponseException('Missing apple_id field'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/app/venv/bin//icloud", line 8, in sys.exit(main()) File "/app/venv/lib/python3.10/site-packages/icloudpy/cmdline.py", line 292, in main raise RuntimeError(message) from error RuntimeError: Bad username or password for [xxx]

To Reproduce I realise this will be hard for you to reproduce, so if there's any additional information I could gather for you please let me know.

ArjanAssink commented 3 weeks ago

Tried again just now, same flow as before, but it works now, even on the same version of the docker image. Issue seems to have resolved itself.

Thanks for the great tool, awesome to have local backups of my files and photos! :)