fastlane: 2FA 6 digit when entered does not proceed

Its been a while so my login seems to have expired. When pushing to testflight for Apple i get the following:

[15:54:23]: Starting login with user 'myemailhere@domain.com'
Available session is not valid any more. Continuing with normal login.
Two-factor Authentication (6 digits code) is enabled for account 'myemailhere@domain.com'
More information about Two-factor Authentication: https://support.apple.com/en-us/HT204915

If you're running this in a non-interactive session (e.g. server or CI)
check out https://github.com/fastlane/fastlane/tree/master/spaceship#2-step-verification

(Input `sms` to escape this prompt and select a trusted phone number to send the code as a text message)
Please enter the 6 digit code:

Naturally i enter the code that was sent by SMS. Nothing happens, the build/submission never proceeds, just hangs there.

Anyone else facing this? I’m running on latest fastlane.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 23 (11 by maintainers)

Most upvoted comments

So I just tried out both ways (2 Step via device and SMS) with the latest fastlane version 2.122.0 and it worked both ways.

Steps to reproduce:

  1. Make sure you are on latest version
  2. bundle exec irb
  3. Spaceship::Tunes.login("your@email.com", "password") 4a. Accept on Mac or iOS device and enter code in console 4b. Type sms in the console and confirm phone number with 1 etc. Enter code from SMS

Responses in console should look something like:

Two-factor Authentication (6 digits code) is enabled for account '•••••@•••••.com'
More information about Two-factor Authentication: https://support.apple.com/en-us/HT204915

If you're running this in a non-interactive session (e.g. server or CI)
check out https://github.com/fastlane/fastlane/tree/master/spaceship#2-step-verification

(Input `sms` to escape this prompt and select a trusted phone number to send the code as a text message)

(You can also set the environment variable `SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER` to automate this)
(Read more at: https://github.com/fastlane/fastlane/blob/master/spaceship/docs/Authentication.md#auto-select-sms-via-spaceship-2fa-sms-default-phone-number)

Please enter the 6 digit code:
sms
Please select a trusted phone number to send code to:
1. +49 ••••• •••••12
?  1

Successfully requested text message to +49 ••••• •••••12
Please enter the 6 digit code you received at +49 ••••• •••••12:
701122
Requesting session...

If you enter the “push” code, the part after sms won’t be there and you should get the Requesting session...

Hi, sorry for the late response. We have solved our issue. The problem for us was that we have started fastlande as another process from a node script and we didn’t forward the standard input from our node process to the fastlane process. It looked like we had entered the 2FA successfully but actually the code never reached fastlane. After forwarding stdio to fastlane we don’t have problems anymore.

SMS works 100% for me test with multiple accounts. Please let us know your complete setup.