fastlane: upload_to_testflight failed with API forbidden error, though ipa sucessfully uploaded to TestFlight

New Issue Checklist

Issue Description

We tried to upload a successfully built ipa artifact to TestFlight using fastlane on the command line, but it failed with exit code 1 with below exception message.

We are able to see the build in the list on TestFlight though afterwards, and it can be downloaded and installed as well. We checked the source code and found this function that is trying to make some AppStore Connect API calls on app review details.

The fastlane version is up to date as of now at 2.117.1.

Command executed
fastlane pilot upload --username <USER_NAME> --app_identifier <APP_IDENTIFIER> --apple_id <APP_ID> --ipa ./xxx.ipa --skip_submission true --verbose
Complete output when running fastlane, including the stack trace and command used
INFO [2019-03-08 16:24:27.75]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option
INFO [2019-03-08 16:25:17.25]: Waiting for App Store Connect to finish processing the new build 
...
INFO [2019-03-08 16:26:50.00]: Build doesn't show up in the build list anymore, waiting for it to appear again (check your email for processing issues if this continues)
...
INFO [2019-03-08 16:29:23.84]: Successfully finished processing the build 0.0.43 - 1552032843

Looking for related GitHub issues on fastlane/fastlane...
Search query: This request is forbidden for security reasons - The API key in use does not allow this request

URL: https://api.github.com/search/issues?q=This%20request%20is%20forbidden%20for%20security%20reasons%20-%20The%20API%20key%20in%20use%20does%20not%20allow%20this%20request+repo:fastlane/fastlane
Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run `fastlane env` to append the fastlane environment to your issue
Traceback (most recent call last):
	17: from /Users/nhp/.rbenv/versions/2.5.0/bin/fastlane:23:in `<main>'
	16: from /Users/nhp/.rbenv/versions/2.5.0/bin/fastlane:23:in `load'
	15: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/bin/fastlane:23:in `<top (required)>'
	14: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
	13: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/commands_generator.rb:18:in `start'
	12: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/commands_generator.rb:166:in `run'
	11: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	10: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	 9: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	 8: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	 7: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	 6: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/commands_generator.rb:66:in `block (2 levels) in run'
	 5: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:61:in `upload'
	 4: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:81:in `distribute'
	 3: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:119:in `update_beta_app_meta'
	 2: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:268:in `update_review_detail'
	 1: from /Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/spaceship/lib/spaceship/connect_api/client.rb:62:in `patch_beta_app_review_detail'
/Users/nhp/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/fastlane-2.117.1/spaceship/lib/spaceship/connect_api/client.rb:274:in `handle_response': [!] This request is forbidden for security reasons - The API key in use does not allow this request (Spaceship::UnexpectedResponse)

Environment

| Gem      | Version | Update-Status |
| -------- | ------- | ------------- |
| fastlane | 2.117.1 | ✅ Up-To-Date  |

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.2.0
slack-notifier 2.3.2
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 1.8.0
terminal-table 1.8.0
CFPropertyList 3.0.0
multipart-post 2.0.0
word_wrap 1.0.0
public_suffix 2.0.5
babosa 1.0.2
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.62.0
unf_ext 0.0.7.5
unf 0.1.4
domain_name 0.5.20180417
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
gh_inspector 1.1.3
mini_magick 4.5.1
multi_json 1.13.1
multi_xml 0.6.0
rubyzip 1.2.2
security 0.1.3
xcpretty-travis-formatter 1.0.0
naturally 2.2.0
simctl 1.6.5
google-cloud-env 1.0.5
google-cloud-core 1.3.0
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
httpclient 2.8.3
google-api-client 0.23.9
digest-crc 0.4.1
google-cloud-storage 1.16.0
nanaimo 0.2.6
colored2 3.1.2
claide 1.0.2
atomos 0.1.3
xcodeproj 1.7.0
unicode-display_width 1.5.0
plist 3.5.0
addressable 2.6.0
tty-screen 0.6.5
tty-cursor 0.6.1
tty-spinner 0.9.0
faraday 0.15.4
fastimage 2.1.5
json 2.2.0
dotenv 2.7.1
bundler 1.17.1
faraday_middleware 0.13.1
mime-types-data 3.2018.0812
mime-types 3.2.2
jwt 2.1.0
signet 0.11.0
os 1.0.0
memoist 0.16.0
googleauth 0.6.7
emoji_regex 1.0.1
openssl 2.1.0
date 1.0.0
fileutils 1.0.2
ipaddr 1.2.0
psych 3.0.2

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 33 (5 by maintainers)

Most upvoted comments

@pehlert suggestion is sound, this used to work before. At some point some other feature that needed additional permissions was added, but we should be able to skip this additional feature and keep that user as a “Developer”, I don’t think a simple upload should need “App Manager” permissions

Just to second this, I am in a situation where I cannot give the uploading account “App Manager” permission. Could we maybe add a flag to skip this last step?

Looking into this!

Why was this issue closed? There is no solution in the current version of fastlane. This is related to the step to upload the changelog to Testflight. There should be a flag to just upload the app for developer permissions.

Any updates here?

@nihp

I’m in the exactly same situation: Issue #14372 forces me to use an older fastlane version (2.116.1). Issue #14521 would require the latest fastlane version.

This is a tricky situation.

I guess the only way out is that the issue #14372 can somehow be solved without downgrading fastlane, but using the latest version.

Honestly I did not get all the proposed solutions above completely.

Isn’t there a workaround/fix by changing the permissions of the used user? Or can this be solved on fastlane side and we can expect to have a fix available soon?

@stidch gem "fastlane", "=2.116.1" does the trick

@joshdholtz I just ran into this and “App Manager” worked for me 👍

@MaRuifeng It looks like @ohayon had a similar issue as yours and it was solved by changing his user’s role from “Developer” to “App Manager”. “Developer” only has read only for some of the things pilot needs. Can you see if this is the same issue that you are having? 😊

@MaRuifeng We do not currently have support for the private key and JWT token auth in fastlane yet as everything that we have been able to do we were able to use the same web session that is used on App Store Connect. We went this approach so that we did not require fastlane users yet another form of authentication 😬

It looks like this function / API call is still working from within the App Store Connect dashboard so doing testing on my end to see if I can replicate this error that you are seeing. The API call that we were using in fastlane still looks to be the one the App Store Connect dashboard is using so working on trying to pinpoint the exact cause of this error right now 💪