0

I have created an Apple App Store task, and created an Endpoint with username/passowrd/App-Specific password and Fastlane Session. My username has 2FA enabled (requirement for fastlane to upload the ipa)

enter image description here

When running the task I get the following:

enter image description here

As you can see it still asks for a 2FA code. It seems that the Fastlane Session is not being read. If I enter an invalid token in the Fastlane Session, I get the same result.

Do you know what could this be?

user1447414
  • 1,306
  • 2
  • 12
  • 25
  • Based on the log, the session cookie has been expired, when did you generate this session? Try to generate a new session and try again. [Support for CI machines](https://github.com/fastlane/fastlane/tree/master/spaceship#support-for-ci-machines) – starian chen-MSFT Nov 06 '17 at 06:06
  • This session was created in my machine minutes before running this task, and the task runs in an agent. Do you know how can I inspect the environment variables in the release definition? – user1447414 Nov 07 '17 at 08:56
  • You can read environment variables as general environment variables, such as PS: `Write-Host $env:fastlaneSessionEnvVar`, Shell: `echo $fastlaneSessionEnvVar`, NodeJS: `console.log(process.env[fastlaneSessionEnvVar])` – starian chen-MSFT Nov 07 '17 at 09:13
  • Did you check if there is any unexpected line break inserted in the session when you copy and paste it? – Eddie Chen - MSFT Nov 09 '17 at 06:59
  • Using Fastlane's new support for App Store Connect API no longer requires 2FA hoops for most scenarios; see https://stackoverflow.com/a/65416345/1836776 – Marc Durdin Dec 22 '20 at 23:40

1 Answers1

1

To me it looks like the CI system you are using might be escaping the \n in the fastlane session cookie incorrectly. Instead of using the environment variable, try copying over the ~/.fastlane/spaceship/[email]/cookie file from your main computer to your CI system

milch
  • 986
  • 8
  • 13