推送到 Testflight 时适用于 iOS 的 Azure DevOps 超时
Posted
技术标签:
【中文标题】推送到 Testflight 时适用于 iOS 的 Azure DevOps 超时【英文标题】:Timeout in Azure DevOps for iOS when pushing to Testflight 【发布时间】:2021-03-21 20:12:15 【问题描述】:在 Azure DevOps 中,我们有一个发布管道,可以使用以下扩展插件将 ios 应用的 .ipa 推送到 Testflight: https://github.com/microsoft/app-store-vsts-extension
Apple 最近强制使用 App Store Connect API 密钥。
自从实施 App Store Connect API 密钥后,我们现在面临超时错误(日志如下):
....
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)
....
作业进程失败并出现以下 fastlane 错误:
2021-03-18T18:05:40.4539710Z ##[错误]错误:进程“/usr/local/lib/ruby/gems/2.7.0/bin/fastlane”失败,退出代码为 1
-
构建被推送到 Testflight。
未发布发行说明。
我拥有用户的应用管理员角色。
我错过了什么?
【问题讨论】:
错误令人困惑;它说这是一个超时,但文本说这是一个权限问题。我会查看分配给您的 api 密钥的权限。 我找到了这个帖子:github.com/fastlane/fastlane/issues/14372,看来将 fastlane 降级到 2.116.1 可以解决这个问题。 【参考方案1】:按照 Paulw11 的建议,我缺少 API 密钥上的 App Manager 角色。
使用此角色重新生成新的 API 密钥后,它可以工作。
注意:用户帐户上的 App Manager 角色是不够的,如果您要自动化发布部分(变更日志、发布说明等),它将无法工作
【讨论】:
【参考方案2】:很可能您拥有开发人员访问权限的密钥,这就是为什么 ->
Could not set changelog: This request is forbidden for security reasons - The API key in use does not allow this request (FastlaneCore::Interface::FastlaneError)
.
密钥与具有相同角色的普通用户具有相同的访问级别。作为具有开发人员角色的用户,您不能设置更改日志。见Program roles - Edit App Store details
【讨论】:
以上是关于推送到 Testflight 时适用于 iOS 的 Azure DevOps 超时的主要内容,如果未能解决你的问题,请参考以下文章
iTunes Connect、TestFlight 和 Jenkins
Meteor iOS 热代码推送在 testflight 和生产中被破坏,但在本地 xcode 构建中工作
是否有任何 iOS 实现 Bayeux 协议(COMET,服务器推送到客户端)?