title: Fastlane upload to App Store fails in non-interactive mode even with API key
body: <p>I am using Fastlane in a GitLab CI environment. I am using an API key and have successfully uploaded my app to TestFlight. However, it fails when uploading the app to the App Store. The build uploads successfully, but it fails when waiting for a response after sending the metadata. Here are the relevant snippets:</p>
  <pre class="lang-rb prettyprint-override"><code># Fastfile
  
  lane :get_app_store_connect_api_key do
    ensure_env_vars(
      env_vars: [
        'APP_STORE_CONNECT_API_KEY'
      ]
    ) 
    app_store_connect_api_key(
      key_id: &quot;**********&quot;,
      issuer_id: &quot;********-****-****-****-************&quot;,
      key_content: &quot;#{ENV[&quot;APP_STORE_CONNECT_API_KEY&quot;]}&quot;.gsub('\n', '\\n'),
      in_house: false,
    )
  end
  
  ...
  
  
    desc &quot;Push a new release channel build to the App Store.&quot;
    lane :release do
    
      build_release()
  
      appstore(
        api_key: get_app_store_connect_api_key
      )
  
    end
  </code></pre>
  <pre><code>LOG
  
  [17:22:47]: ----------------------
  [17:22:47]: --- Step: appstore ---
  [17:22:47]: ----------------------
  [17:22:47]: Successfully loaded '/Users/********/builds/qVPSw-s1/0/********/********/client/ios/fastlane/Deliverfile' 
  [17:22:47]: No values defined in './fastlane/Deliverfile'
  [17:22:47]: Creating authorization token for App Store Connect API
  +--------------------------------------+------------------------+
  |                    deliver 2.181.0 Summary                    |
  +--------------------------------------+------------------------+
  | api_key                              | ********               |
  | screenshots_path                     | ./fastlane/screenshots |
  | metadata_path                        | ./fastlane/metadata    |
  | app_version                          | 1.1.0                  |
  | username                             | ********        |
  | app_identifier                       | com.********.app       |
  | ipa                                  | Runner.ipa             |
  | platform                             | ios                    |
  | edit_live                            | false                  |
  | use_live_version                     | false                  |
  | skip_binary_upload                   | false                  |
  | skip_screenshots                     | false                  |
  | skip_metadata                        | false                  |
  | skip_app_version_update              | false                  |
  | force                                | false                  |
  | overwrite_screenshots                | false                  |
  | submit_for_review                    | false                  |
  | reject_if_possible                   | false                  |
  | phased_release                       | false                  |
  | reset_ratings                        | false                  |
  | team_id                              | ********|
  | dev_portal_team_id                   | ********|
  | run_precheck_before_submit           | true                   |
  | precheck_default_rule_level          | warn                   |
  | ignore_language_directory_validation | false                  |
  | precheck_include_in_app_purchases    | true                   |
  +--------------------------------------+------------------------+
  [17:22:52]: Making sure the latest version on App Store Connect matches '1.1.0'...
  [17:22:54]: Successfully set the version to '1.1.0'
  [17:22:54]: Loading './fastlane/metadata/en-US/description.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/keywords.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/release_notes.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/support_url.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/marketing_url.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/promotional_text.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/name.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/subtitle.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/privacy_url.txt'...
  [17:22:54]: Loading './fastlane/metadata/en-US/apple_tv_privacy_policy.txt'...
  [17:22:54]: Loading './fastlane/metadata/copyright.txt'...
  [17:22:54]: Loading './fastlane/metadata/primary_category.txt'...
  [17:22:54]: Loading './fastlane/metadata/secondary_category.txt'...
  [17:22:54]: Loading './fastlane/metadata/primary_first_sub_category.txt'...
  [17:22:54]: Loading './fastlane/metadata/primary_second_sub_category.txt'...
  [17:22:54]: Loading './fastlane/metadata/secondary_first_sub_category.txt'...
  [17:22:54]: Loading './fastlane/metadata/secondary_second_sub_category.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/first_name.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/last_name.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/phone_number.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/email_address.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/demo_user.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/demo_password.txt'...
  [17:22:54]: Loading './fastlane/metadata/review_information/notes.txt'...
  [17:22:54]: Verifying the upload via the HTML file can be disabled by either adding
  [17:22:54]: `force true` to your Deliverfile or using `fastlane deliver --force`
  [17:22:57]: Does the Preview on path './fastlane/Preview.html' look okay for you?
  +------------------------------------+-----------------------------------------------------------------------------------------------------+
  |                                                               Lane Context                                                               |
  +------------------------------------+-----------------------------------------------------------------------------------------------------+
  | DEFAULT_PLATFORM                   | ios                                                                                                 |
  | PLATFORM_NAME                      | ios                                                                                                 |
  | LANE_NAME                          | ios release                                                                                         |
  | SIGH_PROFILE_TYPE                  | app-store                                                                                           |
  | MATCH_PROVISIONING_PROFILE_MAPPING | {&quot;com.********.app&quot;=&gt;&quot;match AppStore com.********.app&quot;}                                             |
  | IPA_OUTPUT_PATH                    | /Users/********/builds/qVPSw-s1/0/********/********/client/ios/Runner.ipa                        |
  | XCODEBUILD_ARCHIVE                 | /Users/********/Library/Developer/Xcode/Archives/2021-04-21/Runner 2021-04-21 17.14.18.xcarchive |
  | DSYM_OUTPUT_PATH                   | /Users/********/builds/qVPSw-s1/0/********/********/client/ios/Runner.app.dSYM.zip               |
  +------------------------------------+-----------------------------------------------------------------------------------------------------+
  [17:22:57]: Could not retrieve response as fastlane runs in non-interactive mode
  +------+--------------------------------------------------+-------------+
  |                           fastlane summary                            |
  +------+--------------------------------------------------+-------------+
  | Step | Action                                           | Time (in s) |
  +------+--------------------------------------------------+-------------+
  | 1    | default_platform                                 | 0           |
  | 2    | Switch to ios build_release lane                 | 0           |
  | 3    | Switch to ios certificate_release lane           | 0           |
  | 4    | Switch to ios get_app_store_connect_api_key lane | 0           |
  | 5    | ensure_env_vars                                  | 0           |
  | 6    | app_store_connect_api_key                        | 0           |
  | 7    | match                                            | 2           |
  | 8    | gym                                              | 522         |
  | 9    | Switch to ios get_app_store_connect_api_key lane | 0           |
  | 10   | ensure_env_vars                                  | 0           |
  | 11   | app_store_connect_api_key                        | 0           |
  |    | appstore                                         | 9           |
  +------+--------------------------------------------------+-------------+
  [17:22:57]: fastlane finished with errors
  Looking for related GitHub issues on fastlane/fastlane...
  ➡️  Metadata Path is not considered
      https://github.com/fastlane/fastlane/issues/18321 [open] 4 
      2 weeks ago
  ➡️  GITLAB CI: Could not retrieve response as fastlane runs in non-interactive mode
      https://github.com/fastlane/fastlane/issues/17376 [closed] 18 
      17 Feb 2021
  ➡️  FastlaneCore::Interface::FastlaneCrash: [!] Could not retrieve response as fastlane runs in non-interactive mode
      https://github.com/fastlane/fastlane/issues/17488 [closed] 11 
      16 Jan 2021
  and 53 more at: https://github.com/fastlane/fastlane/search?q=Could%20not%20retrieve%20response%20as%20fastlane%20runs%20in%20non-interactive%20mode&amp;type=Issues&amp;utf8=✓
    You can ⌘ + double-click on links to open them directly in your browser.
  bundler: failed to load command: fastlane (/Users/********/builds/qVPSw-s1/0/********/********/client/ios/vendor/bundle/ruby/2.6.0/bin/fastlane)
  /Users/********/builds/qVPSw-s1/0/********/********/client/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.181.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in `crash!': [!] Could not retrieve response as fastlane runs in non-interactive mode (FastlaneCore::Interface::FastlaneCrash)
  </code></pre>