Search code examples
iosazure-devopstestflightfastlaneazure-devops-extensions

Timeout in Azure DevOps for iOS when pushing to Testflight


In Azure DevOps, we have a Release pipeline to push our iOS app's .ipa to Testflight, using the following extension plugin: https://github.com/microsoft/app-store-vsts-extension

Apple enforced the use of the App Store Connect API key recently.

Since implementation of the App Store Connect API key, we are now faced with a timeout error (logs as follows):

.... 
2021-03-18T18:03:19.8161190Z INFO [2021-03-18 18:03:19.81]: iTunes Transporter successfully finished its job
2021-03-18T18:03:19.8162270Z DEBUG [2021-03-18 18:03:19.81]: [Transporter]: DBG-X: Returning 0
2021-03-18T18:03:19.9485520Z INFO [2021-03-18 18:03:19.94]: -----------------------------------------------------
2021-03-18T18:03:19.9486760Z INFO [2021-03-18 18:03:19.94]: Successfully uploaded package to App Store Connect. It might take a few minutes until it's visible online.
2021-03-18T18:03:19.9487720Z INFO [2021-03-18 18:03:19.94]: -----------------------------------------------------
2021-03-18T18:03:19.9516820Z INFO [2021-03-18 18:03:19.95]: Successfully uploaded the new binary to App Store Connect
2021-03-18T18:03:19.9517800Z INFO [2021-03-18 18:03:19.95]: Creating authorization token for App Store Connect API
2021-03-18T18:03:19.9551310Z INFO [2021-03-18 18:03:19.95]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option
2021-03-18T18:03:19.9552840Z INFO [2021-03-18 18:03:19.95]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps.
2021-03-18T18:03:19.9553980Z DEBUG [2021-03-18 18:03:19.95]: App Platform (ios)
2021-03-18T18:03:20.5095270Z INFO [2021-03-18 18:03:20.50]: Waiting for processing on... app_id: 1484478996, app_version: 1.4.0, build_version: 20210318.1844, platform: IOS
2021-03-18T18:03:20.8594870Z WARN [2021-03-18 18:03:20.85]: Read more information on why this build isn't showing up yet - https://github.com/fastlane/fastlane/issues/14997
2021-03-18T18:03:20.8596300Z INFO [2021-03-18 18:03:20.85]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues)
2021-03-18T18:03:51.2082280Z INFO [2021-03-18 18:03:51.20]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues)
2021-03-18T18:04:21.6151090Z INFO [2021-03-18 18:04:21.61]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues)
2021-03-18T18:04:51.9799690Z INFO [2021-03-18 18:04:51.97]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues)
2021-03-18T18:05:25.6750520Z INFO [2021-03-18 18:05:25.67]: Waiting for App Store Connect to finish processing the new build (1.4.0 - 20210318.1844) for IOS
2021-03-18T18:05:25.6753650Z WARN [2021-03-18 18:05:25.67]: Build did include information for app, build beta detail and pre release version
2021-03-18T18:05:25.6755640Z WARN [2021-03-18 18:05:25.67]: Fetching a new build with all the information needed
2021-03-18T18:05:27.0157640Z Timeout received: 'Spaceship::AccessForbiddenError', 'This request is forbidden for security reasons - The API key in use does not allow this request'. Retrying after 3 seconds (remaining: 4)...
2021-03-18T18:05:30.3941310Z Timeout received: 'Spaceship::AccessForbiddenError', 'This request is forbidden for security reasons - The API key in use does not allow this request'. Retrying after 3 seconds (remaining: 3)...
2021-03-18T18:05:33.6926250Z Timeout received: 'Spaceship::AccessForbiddenError', 'This request is forbidden for security reasons - The API key in use does not allow this request'. Retrying after 3 seconds (remaining: 2)...
2021-03-18T18:05:37.1249810Z Timeout received: 'Spaceship::AccessForbiddenError', 'This request is forbidden for security reasons - The API key in use does not allow this request'. Retrying after 3 seconds (remaining: 1)...
2021-03-18T18:05:40.4293300Z /Users/runner/.gem-cache/gems/fastlane-2.178.0/fastlane_core/lib/fastlane_core/ui/interface.rb:141:in `user_error!': [!] Could not set changelog: This request is forbidden for security reasons - The API key in use does not allow this request (FastlaneCore::Interface::FastlaneError)
....

The job process fails with the following fastlane error:

2021-03-18T18:05:40.4539710Z ##[error]Error: The process '/usr/local/lib/ruby/gems/2.7.0/bin/fastlane' failed with exit code 1

  1. The build is pushed to Testflight.
  2. Release notes are not published.
  3. I have the App manager role on the user.

What am I missing?


Solution

  • I was missing the App Manager role on the API key as suggested by Paulw11.

    App Manager role on API key

    After regenerating a new API key with this role, it worked.

    Note: App Manager role on the user account is not sufficient and it will not work if you are automating the release part (changelogs, release notes etc.)