Closed bonkey closed 3 years ago
Thanks for filing this @bonkey, and sorry that xcodes isn't working for you.
In addition to fixing this, I think the "Enter the code:" message and this error message could both be improved.
I'll have to see if I can reproduce this particular failure. Is it correct that this occurred the first time you were using xcodes, and you haven't successfully used it before?
Note to self: this sounds similar to #52, but with a worse error message in this case.
Thanks for filing this @bonkey, and sorry that xcodes isn't working for you.
My pleasure I could help somehow :)
In addition to fixing this, I think the "Enter the code:" message and this error message could both be improved.
Yes, could be better. For me, however, it wasn't an issue as I'm used to 2FA, so I knew instantly what kind of code it was.
Is it correct that this occurred the first time you were using xcodes, and you haven't successfully used it before?
Yes, correct. First time ever and no earlier sukcesem.
@interstateone I am also getting this today
@interstateone must have been an issue with the apple site, working for me today
@interstateone must have been an issue with the apple site, working for me today
For me still the "second" case holds, alas:
$ xcodes list
Enter the code:
123123
The data couldn’t be read because it is missing.
I encountered this error as well today. Having 2fa set up on my account I was prompted to "Enter the code:". I received the code via text message and entered it when prompted resulting in "The data couldn't be read because it isn't in the correct format."
I am on VPN as well that is known to sometimes block apple sites and paths intermittently, but did a test to temporarily disable VPN and reissue the xcodes list
command resulting in the same error.
What I did observe is that the codes being sent by text message seemed significantly delayed (5 minutes or so). Almost to the point where I may have been entering in an expired code and the "new" auth code still hadn't been delivered to my phone.
I was able to get around this issue by switching my developer account using export XCODES_USERNAME=another.account@example.com
after which I was prompted to login with that account. The difference between these two accounts were that the second account delivered the 2fa code directly to my Mac instantaneously. Using that code I was able to get a successful response from xcodes list
and subsequently start the install of the Xcode version I was looking for. Worth noting that I was still on VPN throughout this whole process.
The difference between these two accounts were that the second account delivered the 2fa code directly to my Mac instantaneously.
If I recall correctly this is an important distinction, and I might have only implemented the latter path when I first started xcodes because it's the one I needed. I, uh, never revisited that 😬. fastlane handles both of these cases, so we have something to reference.
This might explain at least the auth-related errors. It probably doesn't explain the intermittent ones, but it's hard to say that certainly because "The data couldn’t be read because it isn’t in the correct format." is such a bad error message...
@interstateone This goes along my case as I'm using SMS on that account.
Thanks for confirming that @bonkey! I'm going to use this issue to track support for accounts with SMS 2FA, and I've started work on it.
@interstateone same issue for me again today doing xcodes update
right after inputting MFA code
@paulthorsteinson Do you use SMS or the device-based 2FA codes (or both, I guess)?
Using SMS
👍 Okay, that fits with this comment then. I'm not sure it's 100% baked yet, but if you feel like testing out a fix, I've implemented the SMS flow in this PR.
@bonkey @paulthorsteinson This was auto-closed by merging #107, but try out the newly released 0.12.0 version and let me know if SMS 2FA works any better for you now.
@interstateone Worked like a charm. Thank you!
Can't get the list of Xcodes from Apple when login with 2FA account.
Second try is the same: