Closed Brett-StrayThought closed 8 months ago
Does your password have a -B in it by any chance?
Good question! But it does not. It doesn't contain anything other than letters/numbers. Same for username.
I did some Googling, and the "Error: No such option: -B" is odd and I could only find one other person who mentioned it.
To the best of my knowledge, the ever-repeating misleading message
Usage: icloudpd |
Try 'icloudpd -h' for help. |
---|---|
Error: No such option: -B |
appears on Apple Silicon machines (only?) and has no other negative effects
It is somehow caused by the interaction of the Python runtime system (multiprocessing libraries) and Apple's Rosetta machine code translation. The Python runtime system seems to believe the program has crashed and tries to restart it with some strange arguments "-B" and a few others others.
Interesting. I'm on an Intel MacBook Pro so I don't think in this case it could be that.
Last time I saw option -B
mentioned was in the context of ADP in #687 . In general, ADP & icloudpd do not work together.
not related to ADP - as it is not in use here .--------------------------------- you can work around the issue in your main() like this:
def main(): try:
# the multiprocessing.resource_tracker kicks in after every download
# and tries to start a second instance with several (unknown) arguments
# possibly due to a leak of some sort
# this code will detect the arguments and terminate the secondary instance when it starts
for a in sys.argv:
if 'multiprocessing.resource_tracker' in a:
sys.exit(1)
finally:
pass
.# followed by your code
.------------------------------------ The second instance will receive a series of arguments including a string ... multiprocessing.resource_tracker ... originating from: https://github.com/python/cpython/blob/main/Lib/multiprocessing/resource_tracker.py (see line 131)
I went back to the original repo for pyicloud and found it works fine with no errors or the strange "not option -B" error. So before moving on, summary is:
I have had the same problem for a while (icloudpd, version 1.14.5 on Apple M2 Pro, Python 3.11.5)
$ icloudpd --directory 'Photos' --username 'xxx@xxx.xxx' --auto-delete
2023-10-04 12:57:08 DEBUG Authenticating...
iCloud Password:
2023-10-04 12:57:18 DEBUG Looking up all photos and videos from album All Photos...
2023-10-04 12:57:18 INFO Downloading 5002 original photos and videos to Photos ...
0%| | 0/5002 [00:00<?, ?it/s]Usage: icloudpd <options>
Try 'icloudpd -h' for help.
Error: No such option: -B
Photos/2014/12/24/IMG_0062.JPG already exists.: 100%|#######################################| 5002/5002 [05:22<00:00, 15.53it/s]2023-10-04 13:02:41 INFO All photos have been downloaded!
2023-10-04 13:02:41 INFO Deleting any files found in 'Recently Deleted'...
multiprocessing/resource_tracker.py:104: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.
Usage: icloudpd <options>
Try 'icloudpd -h' for help.
Error: No such option: -B
I should clarify that icloudpd still works, the pictures are downloaded as expected, but the output is all mangled and unreadable.
Happens both with zsh and bash.
I also tried : different --log-level
s, passing password as an argument, --no-progress-bar but these errors still get printed to stdout.
Resource leak was noticed on mac before (#668), although symptoms were different.
Thanks @AndreyNikiforov, just tested icloudpd==1.14.2 and the problem is not present.
I think it has to do with the existence of security keys in the apple-id. I had a similar error and after removing both security keys from my apple-id icloudpd worked again.
+1 with this issue (icloudpd, version 1.16.2), Apple M2
I think it has to do with the existence of security keys in the apple-id. I had a similar error and after removing both security keys from my apple-id icloudpd worked again.
Any plan to support security keys (FIDO2/webauthn)? It seems that when configured, OTP is not available anymore. Also security keys configuration remove existing MFA sessions. Tested with icloudpd 1.16.2. Need to remove them to use OTP again.
https://support.apple.com/en-ca/guide/iphone/iph5acc5b28c/ios "Note: If you remove all security keys from a device, the device reverts to using six-digit verification codes for two-factor authentication."
If this error is caused by FIDO security keys being enabled as the 2FA method on the icloud account, then we can close this issue in favor of #583
It’s not linked. I have never had FIDO 2FA enabled on my account.
I have the same issue on my Intel Mac mini, v 1.16.2, no FIDO security key.
I have the same issue on my Intel Mac mini, v 1.16.2, no FIDO security key.
Upgrade to 1.17.1. Versions prior to 1.17.0 stoped working recently due to changes in Apple API, See #729
Overview
I previously used icloudpd without issue. I copied/pasted the command I used last time (don't know which version) that worked but it doesn't work this time in 1.16.2. It fails trying to login with 2FA. I tried many times, and manually logged into iCloud to be sure username and password are indeed correct.
Note in the error it says "Failed to send two-factor authentication code" however I received the SMS and also every one of my Apple devices prompted me asking to Allow/Deny too.
Steps to Reproduce
Error: No such option: -B
2023-10-03 10:31:59 ERROR Failed to send two-factor authentication code multiprocessing/resource_tracker.py:104: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak. MBP iPhone Import$ Usage: icloudpd
Try 'icloudpd -h' for help.
Error: No such option: -B
MBP iPhone Import$