fastlane: Server error got 500, but IPA file still success in TestFlight

New Issue Checklist

Issue Description

I run my lane (fastlane beta) which builds and pushes up to TestFlight. Used to work fine, now ends with:

[11:23:22]: fastlane finished with errors
Looking for related GitHub issues on fastlane/fastlane...
...
(Shows some issues which are closed and appear different/unrelated)
...
[!] The request could not be completed because:
	Server error got 500

Interestingly, the app is still pushed successfully to TestFlight and can be run as usual. I can essentially ignore this error and go about business as usual.

My Fastfile

default_platform(:ios)

platform :ios do

  desc "Increment Build Number"
  lane :increment do
    increment_build_number(xcodeproj: "CmsMmobileAapp.xcodeproj")
  end

  desc "Remove NSExceptionDomains"
  lane :NSExceptionDomains do
  update_info_plist(
    plist_path: "CmsMmobileAapp/Info.plist",
    block: proc do |plist|
      plist[:NSAppTransportSecurity] = {}
    end
  )
  end

  desc "Push a new beta build to TestFlight"
  lane :beta do
    NSExceptionDomains()
    build_app(scheme: "CmsMmobileAapp", configuration: "Release")
    upload_to_testflight
  end

end
Complete output when running fastlane, including the stack trace and command used

With --capture_output it ends with this:

INFO [2018-09-27 11:49:37.13]: Successfully finished processing the build 1.2 - 46
INFO [2018-09-27 11:49:37.13]: Distributing new build to testers: 1.2 - 46
WARN [2018-09-27 11:49:37.63]: Lane Context:
INFO [2018-09-27 11:49:37.63]: {:DEFAULT_PLATFORM=>:ios, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios beta", :IPA_OUTPUT_PATH=>"/Users/lancedolan/sourcecode/CmsMmobileAapp/ios/CmsMmobileAapp.ipa", :DSYM_OUTPUT_PATH=>"/Users/lancedolan/sourcecode/CmsMmobileAapp/ios/CmsMmobileAapp.app.dSYM.zip", :XCODEBUILD_ARCHIVE=>"/Users/lancedolan/Library/Developer/Xcode/Archives/2018-09-27/CmsMmobileAapp 2018-09-27 11.43.36.xcarchive"}
ERROR [2018-09-27 11:49:37.63]: Server error got 500
INFO [2018-09-27 11:49:37.63]: Successfully generated documentation at path '/Users/lancedolan/sourcecode/CmsMmobileAapp/ios/fastlane/README.md'
ERROR [2018-09-27 11:49:37.64]: fastlane finished with errors

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.13.3
Ruby 2.2.4
Bundler? false
Git git version 2.16.1
Installation Source ~/.fastlane/bin/bundle/bin/fastlane
Host Mac OS X 10.13.3 (17D47)
Ruby Lib Dir ~/.fastlane/bin/bundle/lib
OpenSSL Version OpenSSL 1.0.2g 1 Mar 2016
Is contained false
Is homebrew true
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 9.4.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE en_US.UTF-8

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do

  desc "Increment Build Number"
  lane :increment do
    increment_build_number(xcodeproj: "CmsMmobileAapp.xcodeproj")
  end

  desc "Remove NSExceptionDomains"
  lane :NSExceptionDomains do
  update_info_plist(
    plist_path: "CmsMmobileAapp/Info.plist",
    block: proc do |plist|
      plist[:NSAppTransportSecurity] = {}
    end
  )
  end

  desc "Push a new beta build to TestFlight"
  lane :beta do
    NSExceptionDomains()
    build_app(scheme: "CmsMmobileAapp", configuration: "Release")
    upload_to_testflight
  end

end
`./fastlane/Appfile`
app_identifier("CHANGED.CHANGED.CHANGED") # The bundle identifier of your app
apple_id("CHANGED@CHANGED.com") # Your Apple email address

itc_team_id("CHANGED") # iTunes Connect Team ID
team_id("CHANGED") # Developer Portal Team ID

# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.105.2 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
slack-notifier 2.3.2
atomos 0.1.3
CFPropertyList 3.0.0
claide 1.0.2
colored2 3.1.2
nanaimo 0.2.6
xcodeproj 1.6.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 1.8.0
unicode-display_width 1.1.3
terminal-table 1.7.3
plist 3.4.0
public_suffix 2.0.5
addressable 2.5.2
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.6.4
tty-cursor 0.5.0
tty-spinner 0.8.0
babosa 1.0.2
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.62.0
faraday 0.12.1
unf_ext 0.0.7.4
unf 0.1.4
domain_name 0.5.20170404
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.3
gh_inspector 1.1.3
json 1.8.1
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 0.0.4
dotenv 2.4.0
bundler 1.14.6
faraday_middleware 0.11.0.1
naturally 2.1.0
simctl 1.6.4
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.1
mime-types-data 3.2016.0521
mime-types 3.1
little-plugger 1.1.4
logging 2.2.2
jwt 1.5.6
memoist 0.16.0
os 0.9.6
signet 0.7.3
googleauth 0.5.1
httpclient 2.8.3
google-api-client 0.21.2
emoji_regex 0.1.1
libxml-ruby 3.0.0

generated on: 2018-09-27

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 24

Most upvoted comments

I fixed it with setting <key>ITSAppUsesNonExemptEncryption</key><false/> in my info p list. Probably problem with (not) providing export compliance. Fastlane doesn’t provide better solution because of missing support of providing export compliance.

I can now also report the <key>ITSAppUsesNonExemptEncryption</key><false/>

fixes the problem for us

Answering the encryption question with the ITSAppUsesNonExemptEncryption property does seem to solve the 500. However, it seems “normal” for a software like fastlane to handle this error more gracefully.

More than anything, it’s surprising that apple servers are even responding 500 in this circumstance; Prior to this issue surfacing, we could simply log in to iTunes Connect and answer the exemption question separately after uploading the ipa file. Furthermore, 500 isn’t an appropriate response status for successful transaction with the server in which the server expected some extra information… Maybe a 400 at worst would be appropriate from Apple👎

Anyhow, it’s something for fastlane folks to consider, how they want to handle this exceptional case.

I believe this is related to the compliance agreement you have to sign everytime you upload a new app to TestFlight (might be the same for appstore, but havent tried that yet).

By adding this key-value that is mentioned earlier in this issue, <key>ITSAppUsesNonExemptEncryption</key><false/> into Info.plist, solved the issue for me. 500 error is given as Fastlane tries to publish the app directly without signing the compliance - Probably just a missing step in their process, if the step can be automated at all.