Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pilot] App Upload via altool Can Sometimes Exit Early With No Exit Code Or Stdout #21535

Closed
4 tasks done
TheMetalCode opened this issue Sep 27, 2023 · 9 comments · Fixed by #21536
Closed
4 tasks done

Comments

@TheMetalCode
Copy link
Contributor

New Issue Checklist

Issue Description

I've only noticed this occurring since upgrading to Xcode 15 - it would appear that when pilot runs altool to upload an app to Testflight, it's possible for altool to exit prematurely, without an exit code or stdout to even begin to diagnose what might have gone wrong.

/Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane_core/lib/fastlane_core/itunes_transporter.rb:246:in `execute': \e[31m[!] undefined method `zero?' for nil:NilClass (NoMethodError)

      @errors << "The call to the altool completed with a non-zero exit status: #{exit_status}. This indicates a failure." unless exit_status.zero?
Command executed

bundle exec fastlane publish_testflight - see fastlane env output, this is the action in which I wrap the call to pilot.

Complete output when running fastlane, including the stack trace and command used
[✔] 🚀 
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                                                                                                            Used plugins                                                                                                                                                             |
+-------------------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Plugin                                    | Version | Action                                                                                                                                                                                                                                                                        |
+-------------------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| fastlane-plugin-doximity_xcode_installer  | 0.2.0   | install_and_select_xcode, install_runtimes, select_supported_runtime                                                                                                                                                                                                          |
| fastlane-plugin-firebase_app_distribution | 0.7.3   | firebase_app_distribution, firebase_app_distribution_add_testers, firebase_app_distribution_create_group, firebase_app_distribution_delete_group, firebase_app_distribution_get_latest_release, firebase_app_distribution_get_udids, firebase_app_distribution_remove_testers |
| fastlane-plugin-bugsnag                   | 2.3.0   | find_info_plist_path, send_build_to_bugsnag, upload_symbols_to_bugsnag                                                                                                                                                                                                        |
+-------------------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: ----------------------------------------
[16:32:46]: --- Step: Verifying fastlane version ---
[16:32:46]: ----------------------------------------
[16:32:46]: Your fastlane version 2.216.0 matches the minimum requirement of 2.121.1 ✅
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: ------------------------------
[16:32:46]: --- Step: default_platform ---
[16:32:46]: ------------------------------
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: --------------------
[16:32:46]: --- Step: whoami ---
[16:32:46]: --------------------
[16:32:46]: $ whoami
[16:32:46]: ▸ ec2-user
[16:32:46]: Driving the lane 'ios publish_testflight' 🚀
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: -------------------------------------------------------------
[16:32:46]: --- Step: Switch to ios set_appstore_connect_api_key lane ---
[16:32:46]: -------------------------------------------------------------
[16:32:46]: Cruising over to lane 'ios set_appstore_connect_api_key' 🚖
[16:32:46]: Cruising back to lane 'ios publish_testflight' 🚘
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: -----------------------------------------------------------------
[16:32:46]: --- Step: Switch to ios generate_release_build_changelog lane ---
[16:32:46]: -----------------------------------------------------------------
[16:32:46]: Cruising over to lane 'ios generate_release_build_changelog' 🚖
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: ----------------------------------------
[16:32:46]: --- Step: changelog_from_git_commits ---
[16:32:46]: ----------------------------------------
[16:32:46]: Collecting the last 1 Git commits

REDACTED

tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: ------------------------
[16:32:46]: --- Step: git_branch ---
[16:32:46]: ------------------------
[16:32:46]: Cruising back to lane 'ios publish_testflight' 🚘
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:32:46]: -------------------
[16:32:46]: --- Step: pilot ---
[16:32:46]: -------------------
[16:32:46]: Creating authorization token for App Store Connect API
[16:32:46]: Ready to upload new build to TestFlight (App: REDACTED)...
[16:32:48]: Going to upload updated app to App Store Connect
[16:32:48]: This might take a few minutes. Please don't interrupt the script.
tput: unknown terminal "unknown"
tput: unknown terminal "unknown"
[16:35:47]: -------------------
[16:35:47]: --- Step: is_ci ---
[16:35:47]: -------------------
+----------------------------------------------------------------+
| Lane Context |
+------------------+---------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios publish_testflight |
| FL_CHANGELOG | REDACTED |
+------------------+---------------------------------------------+

+--------------------------------------------------------------------------+
| fastlane summary |
+------+-----------------------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+-----------------------------------------------------+-------------+
| 1 | Verifying fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | whoami | 0 |
| 4 | Switch to ios set_appstore_connect_api_key lane | 0 |
| 5 | Switch to ios generate_release_build_changelog lane | 0 |
| 6 | changelog_from_git_commits | 0 |
| 7 | git_branch | 0 |
| 💥 | pilot | 181 |
| 9 | is_ci | 0 |
+------+-----------------------------------------------------+-------------+

[16:35:47]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

bundler: failed to load command: fastlane (/Users/ec2-user/project/vendor/bundle/ruby/3.1.0/bin/fastlane)
/Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane_core/lib/fastlane_core/itunes_transporter.rb:246:in execute': \e[31m[!] undefined method zero?' for nil:NilClass (NoMethodError)

  @errors << "The call to the altool completed with a non-zero exit status: #{exit_status}. This indicates a failure." unless exit_status.zero?
                                                                                                                                         ^^^^^^\e[0m
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane_core/lib/fastlane_core/itunes_transporter.rb:791:in `upload'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/pilot/lib/pilot/build_manager.rb:50:in `upload'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/actions/upload_to_testflight.rb:34:in `run'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
    from Fastfile:281:in `block (2 levels) in parsing_binding'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/lane.rb:33:in `call'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/gems/fastlane-2.216.0/bin/fastlane:23:in `<top (required)>'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/bin/fastlane:25:in `load'
    from /Users/ec2-user/project/vendor/bundle/ruby/3.1.0/bin/fastlane:25:in `<top (required)>'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:58:in `load'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:58:in `kernel_load'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:23:in `run'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/cli.rb:492:in `exec'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/cli.rb:34:in `dispatch'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/cli.rb:28:in `start'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/exe/bundle:37:in `block in <top (required)>'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /Users/ec2-user/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.4.19/exe/bundle:29:in `<top (required)>'
    from /Users/ec2-user/.rbenv/versions/3.1.4/bin/bundle:25:in `load'
    from /Users/ec2-user/.rbenv/versions/3.1.4/bin/bundle:25:in `<main>'

Exited with code exit status 1

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 13.5.2
Ruby 3.1.4
Bundler? true
Git git version 2.42.0
Installation Source ~/project/vendor/bundle/ruby/3.1.0/bin/fastlane
Host macOS 13.5.2 (22G91)
Ruby Lib Dir ~/.rbenv/versions/3.1.4/lib
OpenSSL Version OpenSSL 3.1.2 1 Aug 2023
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode-15.0.0.app/Contents/Developer/
Xcode Version 15.0
Swift Version 5.9

System Locale

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

fastlane files:

`./fastlane/Fastfile`
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command

# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`

# If you want to automatically update fastlane if a new version is available:
# update_fastlane

# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.121.1"

default_platform :ios

[REDACTED]

platform :ios do
  [REDACTED]

  desc "Submit a new Release Build to Apple TestFlight"
  desc "- Upload and distribute to Apple iTunes Connect TestFlight for one-click submission to AppStore"
  lane :publish_testflight do
    set_appstore_connect_api_key

    pilot(
      api_key_path: "/tmp/appstore_connect/doximity_appstore_connect.json",
      skip_submission: false,
      distribute_external: false,
      skip_waiting_for_build_processing: true,
      apple_id: ENV.fetch("FASTLANE_APPLE_ID"),
      ipa: "build/REDACTED.ipa",
      reject_build_waiting_for_review: true,
      changelog: generate_release_build_changelog
    )
  end

  [REDACTED]
end

# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

# fastlane reports which actions are used
# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer
`./fastlane/Appfile`
app_identifier "REDACTED" # The bundle identifier of your app

team_id "REDACTED"  # Developer Portal Team ID

# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-doximity_xcode_installer 0.2.0 💥 Check failed
fastlane-plugin-firebase_app_distribution 0.7.3 ✅ Up-To-Date
fastlane-plugin-bugsnag 2.3.0 ✅ Up-To-Date
Loaded gems
Gem Version
error_highlight 0.3.0
did_you_mean 1.6.1
bundler 2.4.19
pathname 0.2.0
rake 13.0.6
rexml 3.2.6
CFPropertyList 3.0.6
public_suffix 5.0.3
addressable 2.8.5
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.2.0
aws-partitions 1.828.0
aws-sigv4 1.6.0
jmespath 1.6.2
aws-sdk-core 3.183.1
aws-sdk-kms 1.71.0
aws-sdk-s3 1.136.0
babosa 1.0.4
claide 1.1.0
climate_control 0.2.0
colored 1.2
colored2 3.1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.5
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.103.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.3.0
faraday-multipart 1.0.4
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.3
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.7
gh_inspector 1.1.3
jwt 2.7.1
multi_json 1.15.0
os 1.1.4
signet 0.18.0
googleauth 1.8.1
httpclient 2.8.3
mini_mime 1.1.5
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
webrick 1.8.1
google-apis-core 0.11.1
google-apis-androidpublisher_v3 0.50.0
google-apis-playcustomapp_v1 0.13.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.19.0
google-cloud-env 1.6.0
google-cloud-errors 1.3.1
google-cloud-core 1.6.0
google-cloud-storage 1.44.0
json 2.6.3
mini_magick 4.12.0
naturally 2.2.1
optparse 0.1.1
plist 3.7.0
rubyzip 2.3.2
security 0.1.3
simctl 1.6.10
terminal-notifier 2.0.0
unicode-display_width 2.4.2
terminal-table 3.0.2
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.23.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
rchardet 1.8.0
git 1.18.0
xml-simple 1.1.9
fastlane-plugin-bugsnag 2.3.0
options 2.3.2
progress_bar 1.3.3
terrapin 0.6.0
fastlane-plugin-doximity_xcode_installer 0.2.0
google-apis-firebaseappdistribution_v1 0.3.0
fastlane-plugin-firebase_app_distribution 0.7.3
table_print 1.5.7

generated on: 2023-09-26

@TheMetalCode
Copy link
Contributor Author

In case this helps anybody else: given the changes in #21536 to force an error when altool exits prematurely, I'm able to implement an automatic retry in my CI configuration, which so far has always succeeded.

export DELIVER_ALTOOL_ADDITIONAL_UPLOAD_PARAMETERS="--verbose"
EXIT_CODE=0
bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output.log || EXIT_CODE=$?
ALTOOL_RETRY=$(grep "The call to the altool completed with a non-zero exit status: -1. This indicates a failure." build_logs/testflight_upload_output.log)
if [[ -n "$ALTOOL_RETRY" ]]; then
  EXIT_CODE=0
  bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output-retry.log || EXIT_CODE=$?
fi
exit $EXIT_CODE

@TheMetalCode
Copy link
Contributor Author

Addendum: here's what the failure looks like when --verbose flag is added to altool command via DELIVER_ALTOOL_ADDITIONAL_UPLOAD_PARAMETERS:

[14:39:12]: �[32m-------------------�[0m
[14:39:12]: �[32m--- Step: pilot ---�[0m
[14:39:12]: �[32m-------------------�[0m
[14:39:12]: Creating authorization token for App Store Connect API
[14:39:12]: �[32mReady to upload new build to TestFlight (App: REDACTED)...�[0m
[14:39:15]: Going to upload updated app to App Store Connect
[14:39:15]: �[32mThis might take a few minutes. Please don't interrupt the script.�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.521 DEBUG: [ContentDelivery.Uploader] COMPLETED - PART 4 - 064d7cd6-0f87-41d3-b5ab-1c9be3c7f14c.ipa - eTag: "1CB469EC474939C3011FC7457809463F"
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.522 DEBUG: [ContentDelivery.Uploader] Removed temporary part file '/private/var/folders/6j/z_jm_fbd1rb44rx_9513tbk40000gn/T/com.apple.cds.vbtx/com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5/Part-4.tmp'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.523 DEBUG: [ContentDelivery.Uploader] Saving uploader state (CDUploaderStateCreateAssetChunksForUpload) for identifier 'com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.527 DEBUG: [ContentDelivery.Uploader] There are 30 parts remaining to upload.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.528 DEBUG: [ContentDelivery.Uploader] Uploading part 5 COMPLETE.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.529 DEBUG: [ContentDelivery.Uploader] COMPLETED - PART 5 - 064d7cd6-0f87-41d3-b5ab-1c9be3c7f14c.ipa - eTag: "C04838C4F7F8938002CC1F499C652E69"
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.530 DEBUG: [ContentDelivery.Uploader] Removed temporary part file '/private/var/folders/6j/z_jm_fbd1rb44rx_9513tbk40000gn/T/com.apple.cds.vbtx/com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5/Part-5.tmp'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.531 DEBUG: [ContentDelivery.Uploader] Adding upload task 23 for part 18.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.532 DEBUG: [ContentDelivery.Uploader] Saving uploader state (CDUploaderStateCreateAssetChunksForUpload) for identifier 'com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.533 DEBUG: [ContentDelivery.Uploader] Saving uploader state (CDUploaderStateCreateAssetChunksForUpload) for identifier 'com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.544 DEBUG: [ContentDelivery.Uploader] There are 29 parts remaining to upload.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.548 DEBUG: [ContentDelivery.Uploader] PROGRESS - PART 10 (5242880) - '064d7cd6-0f87-41d3-b5ab-1c9be3c7f14c.ipa' 100.00% (5242880/5242880)
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.551 DEBUG: [ContentDelivery.Uploader] PROGRESS - PART 11 (5242880) - '064d7cd6-0f87-41d3-b5ab-1c9be3c7f14c.ipa' 100.00% (5242880/5242880)
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.552 DEBUG: [ContentDelivery.Uploader] Wrote part 19 to a temp file '/private/var/folders/6j/z_jm_fbd1rb44rx_9513tbk40000gn/T/com.apple.cds.vbtx/com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5/Part-19.tmp'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.563 DEBUG: [ContentDelivery.Uploader] Adding upload task 24 for part 19.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.564 DEBUG: [ContentDelivery.Uploader] Uploading part 6 COMPLETE.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.565 DEBUG: [ContentDelivery.Uploader] COMPLETED - PART 6 - 064d7cd6-0f87-41d3-b5ab-1c9be3c7f14c.ipa - eTag: "DCA3EDF7341A8534E582AAB981C76952"
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.566 DEBUG: [ContentDelivery.Uploader] Saving uploader state (CDUploaderStateCreateAssetChunksForUpload) for identifier 'com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.567 DEBUG: [ContentDelivery.Uploader] Removed temporary part file '/private/var/folders/6j/z_jm_fbd1rb44rx_9513tbk40000gn/T/com.apple.cds.vbtx/com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5/Part-6.tmp'.
�[0m
[14:40:38]: �[33m[altool] 2023-09-27 14:40:38.568 DEBUG: [ContentDelivery.Uploader] Saving uploader state (CDUploaderStateCreateAssetChunksForUpload) for identifier 'com.apple.cds_795CE584-24D6-4C25-974B-5FEB5E4E5AB5'.
�[0m
[14:40:38]: Application Loader output above ^
[14:40:38]: �[31mThe call to the altool completed with a non-zero exit status: -1. This indicates a failure.�[0m
[14:40:38]: �[31mCould not download/upload from App Store Connect!�[0m

It appears to...just quit, with no obvious error messaging, in the middle of the upload process. 😕

This makes me think about some kind of timeout threshold being exceeded on the command, but it's not obvious to me how to configure any sort of timeout via Fastlane.Pty so I'm not quite sure how to test this theory.

I notice there is a hardcoded value of 100000 being passed as an upload speed throttle to the altool upload command: https://github.com/fastlane/fastlane/blob/master/fastlane_core/lib/fastlane_core/itunes_transporter.rb#L288

I'm not sure what removing or altering that arg would do, but 100000 Kbps / 100 Mbps as a throttle doesn't seem like it should seriously impede the upload progress of a (in my case) 178 MB .ipa.

@Dmitry-Pliushchai
Copy link

In case this helps anybody else: given the changes in #21536 to force an error when altool exits prematurely, I'm able to implement an automatic retry in my CI configuration, which so far has always succeeded.

export DELIVER_ALTOOL_ADDITIONAL_UPLOAD_PARAMETERS="--verbose"
EXIT_CODE=0
bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output.log || EXIT_CODE=$?
ALTOOL_RETRY=$(grep "The call to the altool completed with a non-zero exit status: -1. This indicates a failure." build_logs/testflight_upload_output.log)
if [[ -n "$ALTOOL_RETRY" ]]; then
  EXIT_CODE=0
  bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output-retry.log || EXIT_CODE=$?
fi
exit $EXIT_CODE

@TheMetalCode Unfortunately, it doesn't help me. After the retry I still get the same error " The call to the altool completed with a non-zero exit status: -1. This indicates a failure" .

@RobertDresler
Copy link

Hello, I have the same problem on 2.216.0.

@TheMetalCode
Copy link
Contributor Author

In case this helps anybody else: given the changes in #21536 to force an error when altool exits prematurely, I'm able to implement an automatic retry in my CI configuration, which so far has always succeeded.

export DELIVER_ALTOOL_ADDITIONAL_UPLOAD_PARAMETERS="--verbose"
EXIT_CODE=0
bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output.log || EXIT_CODE=$?
ALTOOL_RETRY=$(grep "The call to the altool completed with a non-zero exit status: -1. This indicates a failure." build_logs/testflight_upload_output.log)
if [[ -n "$ALTOOL_RETRY" ]]; then
  EXIT_CODE=0
  bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output-retry.log || EXIT_CODE=$?
fi
exit $EXIT_CODE

@TheMetalCode Unfortunately, it doesn't help me. After the retry I still get the same error " The call to the altool completed with a non-zero exit status: -1. This indicates a failure" .

This occurred on one of my builds this morning where even with an automatic retry it still failed with two -1 exit codes. I was able to rerun the CI job itself and it succeeded then. So whatever is going on with this altool failure, it does seem to eventually succeed if you retry enough times.

@Dmitry-Pliushchai
Copy link

Dmitry-Pliushchai commented Oct 9, 2023

In case this helps anybody else: given the changes in #21536 to force an error when altool exits prematurely, I'm able to implement an automatic retry in my CI configuration, which so far has always succeeded.

export DELIVER_ALTOOL_ADDITIONAL_UPLOAD_PARAMETERS="--verbose"
EXIT_CODE=0
bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output.log || EXIT_CODE=$?
ALTOOL_RETRY=$(grep "The call to the altool completed with a non-zero exit status: -1. This indicates a failure." build_logs/testflight_upload_output.log)
if [[ -n "$ALTOOL_RETRY" ]]; then
  EXIT_CODE=0
  bundle exec fastlane publish_testflight | tee build_logs/testflight_upload_output-retry.log || EXIT_CODE=$?
fi
exit $EXIT_CODE

@TheMetalCode Unfortunately, it doesn't help me. After the retry I still get the same error " The call to the altool completed with a non-zero exit status: -1. This indicates a failure" .

This occurred on one of my builds this morning where even with an automatic retry it still failed with two -1 exit codes. I was able to rerun the CI job itself and it succeeded then. So whatever is going on with this altool failure, it does seem to eventually succeed if you retry enough times.

Seems that it somehow depends on ipa size. The error occurs from time to time for ipa ~3gb or so but any amount of retries doesn't help when ipa is 10GB+

@Baza207
Copy link

Baza207 commented Oct 16, 2023

I've started seeing this on IPA just ~180MB. Seems to have started either last Friday (13th 🙈) and/or after moving to Xcode 15. Anyone have any ideas on what is causing this? Because it sounds like the fix here would mean it still errors, but just doesn't crash. 🤔

@TheMetalCode
Copy link
Contributor Author

Update: while I don't see anything in the release notes that would implicate this issue, I've stopped seeing altool uploads crash since upgrading to Xcode 15.0.1.

#21618 includes enhancements to the underlying FastlanePty code and should ensure that a nil exit status is never returned.

#21536 has been adjusted as a result, but still implements a specific error message when an altool crash is suspected.

@Baza207
Copy link

Baza207 commented Nov 28, 2023

We've seen it a few times in Xcode 15.0.1 still but it seems to lend to the argument it was a bad response from the server which was fixed around the same time.

Really nice to see these fixes though, thanks for sharing the links. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants