fastlane: Undefined method `status' for nil:NilClass (NoMethodError)

New Issue Checklist

Issue Description

I am using a fastlane API Key JSON to upload our builds to TestFlight as a way around 2FA that is being required by Apple by Feb 2021. The build successfully uploads, then the build step will fail afterwards with this error: [!] undefined method `status’ for nil:NilClass (NoMethodError)

Command executed

fastlane pilot upload --api_key_path /5FF9D7A7M3.json

API JSON looks like: { "key_id": "Our key id", "issuer_id": "Our issuer ID", "key": "-----BEGIN PRIVATE KEY-----\nOur key\n-----END PRIVATE KEY-----" }

Complete output when running fastlane, including the stack trace and command used
 
[21:12:58]The build is removed from the queue to be prepared for the start
[21:12:58]Collecting changes in 1 VCS root (1s)
[21:12:59]Starting the build on the agent "MAC AGENT"
[21:12:59]Updating tools for build
[21:12:59]Clearing temporary directory: /Applications/buildAgent/temp/buildTmp
[21:12:59]Publishing internal artifacts (3s)
[21:12:59]Full checkout enforced. Reason: [Checkout directory is empty or doesn't exist]
[21:12:59]Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[21:12:59]Checkout directory: /Applications/buildAgent/work/23b883b82c08ec30
[21:12:59]Updating sources: auto checkout (on agent) (11s)
[21:13:11]Step 1/8: Restore Nuget Packages (Command Line) (12s)
[21:13:24]Step 2/8: Update Fastlane (Command Line) (5s)
[21:13:30]Step 3/8: Change plist to Staging Test (Command Line)
[21:13:30]Step 4/8: Change entitlements to staging test (Command Line)
[21:13:30]Step 5/8: Update Version Number Staging Test (Command Line)
[21:13:30]Step 6/8: Update Build Number Staging Test (Command Line)
[21:13:30]Step 7/8: Build IPA MSBUILD Staging Test (Command Line) (11m:08s)
[21:24:39]Step 8/8: Upload to itunesconnect Staging Test (Command Line) (9m:45s)
[21:24:39][Step 8/8] Starting: /Applications/buildAgent/temp/agentTmp/custom_script6716754616110169124
[21:24:39][Step 8/8] in directory: /Applications/buildAgent/work/23b883b82c08ec30
[21:24:41][Step 8/8] [16:24:41]: fastlane detected a Gemfile in the current directory
[21:24:41][Step 8/8] [16:24:41]: However, it seems like you didn't use `bundle exec`
[21:24:41][Step 8/8] [16:24:41]: To launch fastlane faster, please use
[21:24:41][Step 8/8] [16:24:41]: 
[21:24:41][Step 8/8] [16:24:41]: $ bundle exec fastlane pilot upload --api_key_path 5FF9D7A7M3.json
[21:24:41][Step 8/8] [16:24:41]: 
[21:24:41][Step 8/8] [16:24:41]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[21:24:43][Step 8/8] [16:24:43]: Creating authorization token for App Store Connect API
[21:24:46][Step 8/8] [16:24:46]: Ready to upload new build to TestFlight (App: 1281741835)...
[21:24:46][Step 8/8] [16:24:46]: Going to upload updated app to App Store Connect
[21:24:46][Step 8/8] [16:24:46]: This might take a few minutes. Please don't interrupt the script.
[21:25:36][Step 8/8] [16:25:36]: iTunes Transporter successfully finished its job
[21:25:36][Step 8/8] [16:25:36]: --------------------------------------------------------------------
[21:25:36][Step 8/8] [16:25:36]: Successfully uploaded package to App Store Connect. It might take a few minutes until it's visible online.
[21:25:36][Step 8/8] [16:25:36]: --------------------------------------------------------------------
[21:25:36][Step 8/8] [16:25:36]: Successfully uploaded the new binary to App Store Connect
[21:25:36][Step 8/8] [16:25:36]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option
[21:25:36][Step 8/8] [16:25:36]: 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.
[21:25:36][Step 8/8] [16:25:36]: Waiting for processing on... app_id: 1281741835, app_version: 2.45, build_version: 1959, platform: IOS
[21:25:37][Step 8/8] [16:25:37]: Read more information on why this build isn't showing up yet - https://github.com/fastlane/fastlane/issues/14997
[21:25:37][Step 8/8] [16:25:37]: 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)
[21:26:07][Step 8/8] [16:26:07]: 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)
[21:26:37][Step 8/8] [16:26:37]: 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)
[21:27:07][Step 8/8] [16:27:07]: 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)
[21:27:40][Step 8/8] [16:27:40]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:28:10][Step 8/8] [16:28:10]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:28:40][Step 8/8] [16:28:40]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:29:12][Step 8/8] [16:29:12]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:29:42][Step 8/8] [16:29:42]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:30:12][Step 8/8] [16:30:12]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:30:43][Step 8/8] [16:30:43]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:31:13][Step 8/8] [16:31:13]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:31:44][Step 8/8] [16:31:44]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:32:15][Step 8/8] [16:32:14]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:32:46][Step 8/8] [16:32:46]: Waiting for App Store Connect to finish processing the new build (2.45 - 1959) for IOS
[21:33:16][Step 8/8] [16:33:16]: Successfully finished processing the build 2.45 - 1959 for IOS
[21:34:23][Step 8/8] 
[21:34:23][Step 8/8] Looking for related GitHub issues on fastlane/fastlane...
[21:34:23][Step 8/8] 
[21:34:24][Step 8/8] ➡️  undefined method `id' for nil
[21:34:24][Step 8/8]     https://github.com/fastlane/fastlane/issues/17818 [open] 0   
[21:34:24][Step 8/8]     2 weeks ago
[21:34:24][Step 8/8] 
[21:34:24][Step 8/8] ➡️  Scan action fails due to slack notifications even though tests succeed
[21:34:24][Step 8/8]     https://github.com/fastlane/fastlane/issues/17898 [open] 6   
[21:34:24][Step 8/8]     20 hours ago
[21:34:24][Step 8/8] 
[21:34:24][Step 8/8] ➡️  set_changelog failing to update and ends in error: handle_response': [!] undefined method `status' for nil:NilClass
[21:34:24][Step 8/8]     https://github.com/fastlane/fastlane/issues/17071 [open] 7   
/Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/api_client.rb:181:in `handle_response': [!] undefined method `status' for nil:NilClass (NoMethodError)
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/api_client.rb:135:in `patch'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/testflight/testflight.rb:88:in `patch_beta_app_review_detail'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `patch_beta_app_review_detail'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:445:in `update_review_detail'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:223:in `update_beta_app_meta'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:153:in `distribute'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:61:in `upload'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/commands_generator.rb:66:in `block (2 levels) in run'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/commands_generator.rb:166:in `run'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/commands_generator.rb:18:in `start'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/bin/fastlane:23:in `<top (required)>'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/bin/fastlane:23:in `load'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/bin/fastlane:23:in `<main>'
[21:34:24]/Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/api_client.rb:181:in `handle_response': undefined method `status' for nil:NilClass (NoMethodError)
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/api_client.rb:135:in `patch'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/testflight/testflight.rb:88:in `patch_beta_app_review_detail'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `patch_beta_app_review_detail'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:445:in `update_review_detail'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:223:in `update_beta_app_meta'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:153:in `distribute'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/build_manager.rb:61:in `upload'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/commands_generator.rb:66:in `block (2 levels) in run'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/commands_generator.rb:166:in `run'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/pilot/lib/pilot/commands_generator.rb:18:in `start'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.171.0/bin/fastlane:23:in `<top (required)>'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/bin/fastlane:23:in `load'
[21:34:24]  from /Users/.rbenv/versions/2.6.5/bin/fastlane:23:in `<main>'
[21:34:24]Process exited with code 1

Environment

 
✅ fastlane environment ✅ ### Stack | Key | Value | | --------------------------- | ------------------------------------------- | | OS | 10.14.5 | | Ruby | 2.6.5 | | Bundler? | false | | Git | git version 2.21.1 (Apple Git-122.3) | | Installation Source | ~/.rbenv/versions/2.6.5/bin/fastlane | | Host | Mac OS X 10.14.5 (18F132) | | Ruby Lib Dir | ~/.rbenv/versions/2.6.5/lib | | OpenSSL Version | OpenSSL 1.1.1d 10 Sep 2019 | | Is contained | false | | Is homebrew | false | | Is installed via Fabric.app | false | | Xcode Path | /Applications/Xcode.app/Contents/Developer/ | | Xcode Version | 11.3.1 | ### System Locale | Variable | Value | | | -------- | ----------- | - | | LANG | en_US.UTF-8 | ✅ | | LC_ALL | en_US.UTF-8 | ✅ | | LANGUAGE | | | ### fastlane files: **No Fastfile found** **No Appfile found** ### fastlane gems | Gem | Version | Update-Status | | -------- | ------- | ------------- | | fastlane | 2.171.0 | ✅ Up-To-Date | ### Loaded fastlane plugins: **No plugins Loaded**
Loaded gems | Gem | Version | | ------------------------- | ------------ | | did_you_mean | 1.3.0 | | slack-notifier | 2.3.2 | | atomos | 0.1.3 | | CFPropertyList | 3.0.2 | | claide | 1.0.3 | | colored2 | 3.1.2 | | nanaimo | 0.2.6 | | xcodeproj | 1.15.0 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | terminal-notifier | 2.0.0 | | unicode-display_width | 1.6.1 | | terminal-table | 1.8.0 | | plist | 3.5.0 | | public_suffix | 2.0.5 | | addressable | 2.7.0 | | multipart-post | 2.0.0 | | word_wrap | 1.0.0 | | tty-screen | 0.7.1 | | tty-cursor | 0.7.1 | | tty-spinner | 0.9.3 | | babosa | 1.0.3 | | colored | 1.2 | | highline | 1.7.10 | | commander-fastlane | 4.4.6 | | excon | 0.72.0 | | unf_ext | 0.0.7.6 | | unf | 0.1.4 | | domain_name | 0.5.20190701 | | http-cookie | 1.0.3 | | faraday-cookie_jar | 0.0.6 | | faraday | 1.0.1 | | faraday_middleware | 1.0.0 | | fastimage | 2.1.7 | | gh_inspector | 1.1.3 | | json | 2.1.0 | | mini_magick | 4.10.1 | | rubyzip | 2.3.0 | | security | 0.1.3 | | xcpretty-travis-formatter | 1.0.0 | | dotenv | 2.7.5 | | bundler | 1.17.2 | | naturally | 2.2.0 | | simctl | 1.6.8 | | jwt | 2.1.0 | | uber | 0.1.0 | | declarative | 0.0.10 | | declarative-option | 0.1.0 | | representable | 3.0.4 | | retriable | 3.1.2 | | mini_mime | 1.0.2 | | httpclient | 2.8.3 | | google-api-client | 0.38.0 | | google-cloud-errors | 1.0.0 | | google-cloud-core | 1.5.0 | | digest-crc | 0.4.1 | | google-cloud-storage | 1.25.1 | | emoji_regex | 1.0.1 | | jmespath | 1.4.0 | | aws-partitions | 1.286.0 | | aws-eventstream | 1.0.3 | | aws-sigv4 | 1.1.1 | | aws-sdk-core | 3.92.0 | | aws-sdk-kms | 1.30.0 | | aws-sdk-s3 | 1.61.1 | | multi_json | 1.14.1 | | signet | 0.14.0 | | os | 1.0.1 | | memoist | 0.16.2 | | googleauth | 0.13.1 | | google-cloud-env | 1.3.3 | | forwardable | 1.2.0 | | logger | 1.3.0 | | stringio | 0.0.2 | | ipaddr | 1.2.2 | | openssl | 2.1.2 | | ostruct | 0.1.0 | | strscan | 1.0.0 | | date | 2.0.0 | | fileutils | 1.1.0 | | etc | 1.0.1 | | io-console | 0.4.7 | | zlib | 1.0.0 | | rexml | 3.1.9 | | psych | 3.1.0 | | mutex_m | 0.1.0 | | webrick | 1.4.2 |
*generated on:* **2021-01-06**

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 40
  • Comments: 39 (10 by maintainers)

Most upvoted comments

We were running into the same issue. Can you make sure that App Store Connect Key has at least the role App-Manager? This resolved the issue for us.

We see this issue when there’s a build in state ‘WAITING_FOR_REVIEW’. In this state, Fastlane attempts to cancel the build using DELETE https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions/{id} but this fails. It returns:

{ “errors”: [ { “id”: “1234”, “status”: “403”, “code”: “FORBIDDEN_ERROR”, “title”: “The given operation is not allowed”, “detail”: “The resource ‘betaAppReviewSubmissions’ does not allow ‘DELETE’. Allowed operations are: GET_COLLECTION, GET_INSTANCE, CREATE” } ] }

I have checked and double checked that my keys are correct. I’ve used admin permissions and this seems to work fine for everything else but this action.

For now we are going to manually remove the current build from review and we’ll then use distribute_only. However it would be good to know if there’s an actual fix here rather than a workaround. I couldn’t find a reference to the DELETE action performed above in the App Store Connect API docs. Was this relying on undocumented functionality?

Failing also for me with the upupload_to_testflight command. The build is uploaded correctly, it fails after finishing processing, not sure what the lane tries to do afterwards.

Thought I would share my issue and how I fixed it:

I started getting this error because there was a new Program License Agreement on the Developer Portal that had to be accepted by the account holder.

so open your developer portal and see if there’s a big red banner at the top saying that the account holder must accept it.

We have the same issue when trying to use api key with register_devices and most likely the core issue is not in the fastlane itself but in the spaceship which every command mentioned here uses. Our key is AppManager and with password auth it was enough to register devices in the portal. https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/register_devices.rb#L53

The error comes from handle_response trying to access response.status while response itself being nil https://github.com/fastlane/fastlane/blob/master/spaceship/lib/spaceship/connect_api/api_client.rb#L181

I briefly looked into spaceship’s source code, and I couldn’t find anywhere up to the actual creation of the client where response could be set explicitly to nil, so it’s maybe that Apple APIs respond with something, which http client cannot recognise via a set of its configured middlewares (pure speculation) https://github.com/fastlane/fastlane/blob/832e3e4a19d9cff5d5a14a61e9614b5659327427/spaceship/lib/spaceship/client.rb#L211

To properly debug this one needs run fastlane locally with SPACESHIP_DEBUG and see the details of those requests. Can’t promise anything, but maybe it will help someone else to dig into this.

Ah, changelog also requires app manager role, removing that would probably solve the issue for us.

@stigi I’m afraid this might be a different issue from what I see in that comment, our case was just fastlane failing after waiting for Apple to process the build due to some unexpected API calls that needed App Manager permissions, now those not needed API calls are not made and the upload finishes in a clean way,

I added some debug output in a few places

----1-----

https://github.com/fastlane/fastlane/blob/77f0e1ad15aac123f3d2100a84fb18bc5a6ef16d/spaceship/lib/spaceship/connect_api/api_client.rb#L42-L65

@client = Faraday.new(hostname, options) do |c|
            c.response(:json, content_type: /\bjson$/)
            c.response(:plist, content_type: /\bplist$/)
            c.use(FaradayMiddleware::RelsMiddleware)
            c.use(Spaceship::StatsMiddleware)
            c.use(Spaceship::TokenRefreshMiddleware, token)
            c.adapter(Faraday.default_adapter)
            puts "------------"
            puts options
            puts "<<<<<<<<<<<<"
            if ENV['SPACESHIP_DEBUG']
              # for debugging only
              # This enables tracking of networking requests using Charles Web Proxy
              c.proxy = "https://127.0.0.1:8888"
              c.ssl[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
            elsif ENV["SPACESHIP_PROXY"]
              c.proxy = ENV["SPACESHIP_PROXY"]
              c.ssl[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if ENV["SPACESHIP_PROXY_SSL_VERIFY_NONE"]
            end

            if ENV["DEBUG"]
              puts("To run spaceship through a local proxy, use SPACESHIP_DEBUG")
            end
          end
----2-----

https://github.com/fastlane/fastlane/blob/77f0e1ad15aac123f3d2100a84fb18bc5a6ef16d/spaceship/lib/spaceship/connect_api/api_client.rb#L104-L112

      def get(url_or_path, params = nil)
        response = with_asc_retry do
          request(:get) do |req|
            req.url(url_or_path)
            req.options.params_encoder = Faraday::NestedParamsEncoder
            req.params = params if params
            req.headers['Content-Type'] = 'application/json'
          end
        end
        puts "================"
        puts url_or_path
        puts response
        puts "<<<<<<<<<<<<<<<<"
        handle_response(response)
      end

output message:

[09:51:38]: Cloning remote git repo...
[09:51:39]: Checking out branch master...
[09:51:39]: 🔓  Successfully decrypted certificates repo
[09:51:39]: Verifying that the certificate and profile are still valid on the Dev Portal...
[09:51:39]: Creating authorization token for App Store Connect API
------------
{:request=>{:timeout=>300, :open_timeout=>300}}
<<<<<<<<<<<<
------------
{:request=>{:timeout=>300, :open_timeout=>300}}
<<<<<<<<<<<<
------------
{:request=>{:timeout=>300, :open_timeout=>300}}
<<<<<<<<<<<<
------------
{:request=>{:timeout=>300, :open_timeout=>300}}
<<<<<<<<<<<<
================
bundleIds
#<Faraday::Response:0x00007fa64da15220>
<<<<<<<<<<<<<<<<
[09:51:42]: Installing certificate...

+-------------------+-----------------------------------------------------------------------------------+
|                                         Installed Certificate                                         |
+-------------------+-----------------------------------------------------------------------------------+
| User ID           | 8B4Cxxx                                                                        |
| Common Name       | Apple Distribution: Beijing xxxx Network Technology Co., LTD. (8B4xxx) |
| Organisation Unit | 8B4Cxxx                                                                        |
| Organisation      | Beijing xxx Technology Co., LTD.                                  |
| Country           | CN                                                                                |
| Start Datetime    | 2021-03-03 07:39:13 UTC                                                           |
| End Datetime      | 2022-03-03 07:39:12 UTC                                                           |
+-------------------+-----------------------------------------------------------------------------------+

================
certificates
#<Faraday::Response:0x00007fa65d99cea0>
<<<<<<<<<<<<<<<<
================
profiles

<<<<<<<<<<<<<<<<
+----------------+-------+
|      Lane Context      |
+----------------+-------+
| ENVIRONMENT    | adhoc |
| LANE_NAME      | ipa   |
| VERSION_NUMBER | 2.2.0 |
| BUILD_NUMBER   | 783   |
+----------------+-------+
[09:54:20]: undefined method `status' for nil:NilClass

@geisterfurz007 ah weird, I guess it didnt finish uploading. Fixed now.

Ok I managed to login in the apple developer portal and discovered this message which explains my issues:

Screen Shot 2021-02-12 at 3 06 25 PM

I’m running into the exact same issue with deliver. I’m not passing the api_key_path parameter, but I’m instead logging in beforehand just like the example in the documentation.

  app_store_connect_api_key(
    key_id: APP_STORE_CONNECT_API_KEY_ID,
    issuer_id: APP_STORE_CONNECT_API_ISSUER_ID,
    key_filepath: APP_STORE_CONNECT_API_KEY_FILEPATH,
  )
  
  ...
  
  deliver(
    automatic_release: false,
    force: true,
    ipa: file_path,
    skip_screenshots: true,
    submission_information: {
      add_id_info_uses_idfa: true,
      add_id_info_serves_ads: false,
      add_id_info_tracks_action: true,
      add_id_info_tracks_install: true,
      add_id_info_limits_tracking: true,
    },
    submit_for_review: true,
    reject_if_possible: true,
  )
NoMethodError: [!] undefined method `status' for nil:NilClass
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/api_client.rb:181:in `handle_response'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/api_client.rb:124:in `post'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/tunes/tunes.rb:871:in `post_app_store_version'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/spaceship/lib/spaceship/connect_api/models/app.rb:217:in `ensure_version!'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/deliver/lib/deliver/runner.rb:120:in `verify_version'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/deliver/lib/deliver/runner.rb:48:in `run'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/actions/upload_to_app_store.rb:18:in `run'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
  fastfiles/IosFastfile:39:in `block in parsing_binding'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/lane.rb:33:in `call'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
  fastfiles/IosFastfile:134:in `block in parsing_binding'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/lane.rb:33:in `call'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
  Fastfile:233:in `block in parsing_binding'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/lane.rb:33:in `call'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
  /Users/dev/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.171.0/bin/fastlane:23:in `<top (required)>'
  /Users/dev/.asdf/installs/ruby/2.5.3/bin/fastlane:23:in `load'
  /Users/dev/.asdf/installs/ruby/2.5.3/bin/fastlane:23:in `<top (required)>'