Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login with SMS 2FA code fails with "The data couldn’t be read because it is missing" #96

Closed
bonkey opened this issue Jul 10, 2020 · 15 comments · Fixed by #107
Closed
Labels
bug Something isn't working

Comments

@bonkey
Copy link

bonkey commented Jul 10, 2020

Can't get the list of Xcodes from Apple when login with 2FA account.

$ xcodes list
Apple ID: foo@bar.com
Apple ID Password:
Enter the code:
000000
The data couldn’t be read because it is missing.

Second try is the same:

$ xcodes list
Enter the code:
000001
The data couldn’t be read because it is missing.
@interstateone interstateone added the bug Something isn't working label Jul 16, 2020
@interstateone
Copy link
Contributor

interstateone commented Jul 16, 2020

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.

@bonkey
Copy link
Author

bonkey commented Jul 16, 2020

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.

@paulthorsteinson
Copy link

@interstateone I am also getting this today

@paulthorsteinson
Copy link

@interstateone must have been an issue with the apple site, working for me today

@bonkey
Copy link
Author

bonkey commented Jul 28, 2020

@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.

@aerickson14
Copy link

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.

@interstateone
Copy link
Contributor

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...

@bonkey
Copy link
Author

bonkey commented Sep 21, 2020

@interstateone This goes along my case as I'm using SMS on that account.

@interstateone
Copy link
Contributor

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 interstateone changed the title Login with 2FA code fails with "The data couldn’t be read because it is missing" Login with SMS 2FA code fails with "The data couldn’t be read because it is missing" Sep 21, 2020
@paulthorsteinson
Copy link

paulthorsteinson commented Oct 6, 2020

@interstateone same issue for me again today doing xcodes update right after inputting MFA code

@interstateone
Copy link
Contributor

@paulthorsteinson Do you use SMS or the device-based 2FA codes (or both, I guess)?

@paulthorsteinson
Copy link

Using SMS

@interstateone
Copy link
Contributor

👍 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.

@interstateone
Copy link
Contributor

@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.

@bonkey
Copy link
Author

bonkey commented Oct 18, 2020

@interstateone Worked like a charm. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants