Firebase iOS 分发法拉第服务器错误 403
Firebase iOS Distribution Faraday server error 403
我正在使用 Circle-Ci 和 Firebase App Distribution 进行持续分发
一切正常,直到今天我收到以下错误:
[10:52:11]: --- Step: firebase_app_distribution ---
[10:52:11]: ---------------------------------------
[10:52:11]: Authenticating with FIREBASE_TOKEN environment variable
[10:52:12]: Authenticated successfully.
[10:52:12]: ⌛ Uploading the IPA.
[10:52:13]: An error occurred while executing the `error` block:
[10:52:19]: undefined method `error_info' for #<Faraday::ForbiddenError:0x00007fe597865d38>
bundler: failed to load command: fastlane (/Users/distiller/project/vendor/bundle/ruby/2.7.0/bin/fastlane)
Faraday::ForbiddenError: [!] the server responded with status 403
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/response/raise_error.rb:20:in `on_complete'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/middleware.rb:19:in `block in call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/response.rb:59:in `on_complete'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/middleware.rb:18:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday_middleware-1.0.0/lib/faraday_middleware/response_middleware.rb:36:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/rack_builder.rb:154:in `build_response'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/connection.rb:492:in `run_request'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/connection.rb:279:in `post'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.5/lib/fastlane/plugin/firebase_app_distribution/client/firebase_app_distribution_api_client.rb:123:in `upload_binary'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.5/lib/fastlane/plugin/firebase_app_distribution/client/firebase_app_distribution_api_client.rb:153:in `upload'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.5/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb:31:in `run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
Fastfile:50:in `block (2 levels) in parsing_binding'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/lane.rb:33:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/bin/fastlane:23:in `<top (required)>'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `load'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `<top (required)>'
Exited with code exit status 1
我尝试更新以下内容:
捆绑包更新快车道
bundle exec fastlane update_plugins
但还是一样的错误
经过大量搜索,我找到了问题所在:
总而言之:FIREBASE_TOKEN 已过期或被撤销,所以我不得不再次刷新它,并且由于 Faraday 被 Firebase 使用,因此它需要使用 FIREBASE_TOKEN 上传 API.
我遵循了这个 link 的步骤:
Generating a CLI Token
Firebase requires a token to used during
authentication. To generate the token, we need to use the Firebase CLI
and a browser - as CircleCI is a headless environment, we will need to
generate this token locally, rather than at runtime, then add it to
CircleCI as an environment variable.
Download and install the Firebase CLI locally with the command curl
-sL https://firebase.tools | bash Trigger a login by using the command firebase login:ci Complete the sign in via the browser window, then
copy the token provided in the Terminal output Go to your project
settings in CircleCI and create a new environment variable named
FIREBASE_TOKEN with the value of the token.
我刚才遇到了同样的问题。我记得我在本地更改了我的 firebase 用户。
只需使用正确的帐户重新登录即可:
firebase logout
然后
firebase login
我正在使用 Circle-Ci 和 Firebase App Distribution 进行持续分发 一切正常,直到今天我收到以下错误:
[10:52:11]: --- Step: firebase_app_distribution ---
[10:52:11]: ---------------------------------------
[10:52:11]: Authenticating with FIREBASE_TOKEN environment variable
[10:52:12]: Authenticated successfully.
[10:52:12]: ⌛ Uploading the IPA.
[10:52:13]: An error occurred while executing the `error` block:
[10:52:19]: undefined method `error_info' for #<Faraday::ForbiddenError:0x00007fe597865d38>
bundler: failed to load command: fastlane (/Users/distiller/project/vendor/bundle/ruby/2.7.0/bin/fastlane)
Faraday::ForbiddenError: [!] the server responded with status 403
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/response/raise_error.rb:20:in `on_complete'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/middleware.rb:19:in `block in call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/response.rb:59:in `on_complete'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/middleware.rb:18:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday_middleware-1.0.0/lib/faraday_middleware/response_middleware.rb:36:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/rack_builder.rb:154:in `build_response'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/connection.rb:492:in `run_request'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/connection.rb:279:in `post'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.5/lib/fastlane/plugin/firebase_app_distribution/client/firebase_app_distribution_api_client.rb:123:in `upload_binary'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.5/lib/fastlane/plugin/firebase_app_distribution/client/firebase_app_distribution_api_client.rb:153:in `upload'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.5/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb:31:in `run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
Fastfile:50:in `block (2 levels) in parsing_binding'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/lane.rb:33:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/gems/fastlane-2.173.0/bin/fastlane:23:in `<top (required)>'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `load'
/Users/distiller/project/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `<top (required)>'
Exited with code exit status 1
我尝试更新以下内容:
捆绑包更新快车道 bundle exec fastlane update_plugins
但还是一样的错误
经过大量搜索,我找到了问题所在:
总而言之:FIREBASE_TOKEN 已过期或被撤销,所以我不得不再次刷新它,并且由于 Faraday 被 Firebase 使用,因此它需要使用 FIREBASE_TOKEN 上传 API.
我遵循了这个 link 的步骤:
Generating a CLI Token
Firebase requires a token to used during authentication. To generate the token, we need to use the Firebase CLI and a browser - as CircleCI is a headless environment, we will need to generate this token locally, rather than at runtime, then add it to CircleCI as an environment variable.Download and install the Firebase CLI locally with the command curl -sL https://firebase.tools | bash Trigger a login by using the command firebase login:ci Complete the sign in via the browser window, then copy the token provided in the Terminal output Go to your project settings in CircleCI and create a new environment variable named FIREBASE_TOKEN with the value of the token.
我刚才遇到了同样的问题。我记得我在本地更改了我的 firebase 用户。
只需使用正确的帐户重新登录即可:
firebase logout
然后
firebase login