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: Unable to authenticate. (-19209) #22013

Open
4 tasks done
SirCameron opened this issue May 11, 2024 · 2 comments
Open
4 tasks done

Pilot: Unable to authenticate. (-19209) #22013

SirCameron opened this issue May 11, 2024 · 2 comments

Comments

@SirCameron
Copy link

SirCameron commented May 11, 2024

New Issue Checklist

Issue Description

app_store_connect_api_key creates the key correctly and I can confirm that it works because latest_testflight_build_number is able to query the latest build number.

Later in the process, I call pilot

pilot(
      api_key: api_key,
      apple_id: "#{DEVELOPER_APP_ID}",
      app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
      skip_waiting_for_build_processing: true,
      skip_submission: true,
      distribute_external: false,
      notify_external_testers: false,
      ipa: "./dist/build.ipa"
    )

this fails with:

[!] Error uploading ipa file:
 [Application Loader Error Output]: ERROR: GET APP SETTINGS: failed to authenticate. The server response was: {
[Application Loader Error Output]: ERROR: GET APP SETTINGS: received status code 401, auth issue.
[Application Loader Error Output]: ERROR: [ContentDelivery.Uploader] REQUEST CREATE CONTAINER (ASSET_UPLOAD): failed to authenticate. The server response was: {
[Application Loader Error Output]: ERROR: [ContentDelivery.Uploader] REQUEST CREATE CONTAINER (ASSET_UPLOAD): received status code 401, auth issue.
[Application Loader Error Output]: Error uploading '/var/folders/66/10clwqc15m7f2831tj26j9n40000gn/T/c9bd7ff9-d23b-4ea2-907f-e34daccc2a1a.ipa'.
[Application Loader Error Output]: Unable to authenticate. (-19209)
[Application Loader Error Output]: The call to the altool completed with a non-zero exit status: 1. This indicates a failure.
Command executed

pilot

Complete output when running fastlane, including the stack trace and command used
 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

 
🚫 fastlane environment 🚫

Stack

Key Value
OS 13.3.1
Ruby 3.0.0
Bundler? true
Git git version 2.39.2 (Apple Git-143)
Installation Source ~/Web/spots/Baluu/vendor/bundle/ruby/3.0.0/bin/fastlane
Host macOS 13.3.1 ((a))
Ruby Lib Dir ~/.rvm/rubies/ruby-3.0.0/lib
OpenSSL Version OpenSSL 1.1.1t 7 Feb 2023
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 14.3
Swift Version 5.8

System Locale

Error
No Locale with UTF8 found 🚫

fastlane files:

`./fastlane/Fastfile`
DEVELOPER_APP_ID = ENV["DEVELOPER_APP_ID"]
DEVELOPER_APP_IDENTIFIER = ENV["DEVELOPER_APP_IDENTIFIER"]
PROVISIONING_PROFILE_SPECIFIER = ENV["PROVISIONING_PROFILE_SPECIFIER"]
TEMP_KEYCHAIN_USER = ENV["TEMP_KEYCHAIN_USER"]
TEMP_KEYCHAIN_PASSWORD = ENV["TEMP_KEYCHAIN_PASSWORD"]
APPLE_ISSUER_ID = ENV["APPLE_ISSUER_ID"]
APPLE_KEY_ID = ENV["APPLE_KEY_ID"]
APPLE_KEY_CONTENT = "#{ENV["APPLE_KEY_CONTENT"]}".gsub('\n', '\\n')
GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"]
APP_STORE_CONNECT_TEAM_ID = ENV["APP_STORE_CONNECT_TEAM_ID"]
FASTLANE_USER = '...'
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD = ENV["FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD"]

# before_all do |_lane, options|
  # ENV["FASTLANE_ITUNES_TRANSPORTER_USE_SHELL_SCRIPT"]="1"
  # ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"]="/Applications/Transporter.app/Contents/itms"
# end

def delete_temp_keychain(name)
  delete_keychain(
    name: name
  ) if File.exist? File.expand_path("~/Library/Keychains/#{name}-db")
end

def create_temp_keychain(name, password)
  create_keychain(
    name: name,
    password: password,
    unlock: false,
    timeout: 0
  )
end

def ensure_temp_keychain(name, password)
  delete_temp_keychain(name)
  create_temp_keychain(name, password)
end

platform :ios do
  lane :buildAndUpload do
    keychain_name = TEMP_KEYCHAIN_USER
    keychain_password = TEMP_KEYCHAIN_PASSWORD
    ensure_temp_keychain(keychain_name, keychain_password)

    api_key = app_store_connect_api_key(
      key_id: "#{APPLE_KEY_ID}",
      issuer_id: "#{APPLE_ISSUER_ID}",
      key_content: "#{APPLE_KEY_CONTENT}",
      # is_key_content_base64: true,
      in_house: false,
      duration: 500,
      # set_spaceship_token: true
    )

    last_build_number = latest_testflight_build_number(
      api_key: api_key,
      app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
      team_id: "#{APP_STORE_CONNECT_TEAM_ID}"
    )

    # cocoapods(
    #   clean_install: true,
    #   podfile: "./ios/Podfile"
    # )

    increment_version_number_in_xcodeproj(
      xcodeproj: "./ios/Baluu.xcodeproj",
      version_number: '1.2.5'
    )

    increment_build_number_in_xcodeproj(
      xcodeproj: "./ios/Baluu.xcodeproj",
      build_number: (last_build_number + 1).to_s,
    )
    
    increment_build_number(
      xcodeproj: "./ios/Baluu.xcodeproj",
      build_number: (last_build_number + 1).to_s,
    )

    increment_version_number(
      xcodeproj: "./ios/Baluu.xcodeproj",
      version_number: "1.2.5"
    )

    # match(
    #   type: 'appstore',
    #   git_basic_authorization: Base64.strict_encode64(GIT_AUTHORIZATION),
    #   # git_branch: "test",
    #   app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
    #   keychain_name: keychain_name,
    #   keychain_password: keychain_password,
    #   api_key: api_key,
    # )

    # build_app(
    #   workspace: "./ios/app.xcworkspace",
    #   scheme: "Baluu",
    #   configuration: "Release",
    #   clean: true,
    #   output_directory: "./dist",
    #   output_name: "app.ipa",
    # )

    pilot(
      api_key: api_key,
      apple_id: "#{DEVELOPER_APP_ID}",
      app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
      skip_waiting_for_build_processing: true,
      skip_submission: true,
      distribute_external: false,
      notify_external_testers: false,
      ipa: "./dist/app.ipa"
    )

    delete_temp_keychain(keychain_name)
  end
end
`./fastlane/Appfile`
app_identifier("com.autosequencestart.baluu")
apple_id("autosequencestart.ug@gmail.com")

itc_team_id("124200174")
team_id("5YR7ANVFST")

json_key_file("android/pc-api-5388509913275025230-80-564a431bd04e.json")
package_name("com.baluu")

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

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-versioning 0.5.2 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.5.0
bundler 2.3.17
tsort 0.1.0
set 1.0.1
uri 0.10.1
pathname 0.1.0
rake 13.2.1
base64 0.2.0
nkf 0.2.0
rexml 3.2.6
CFPropertyList 3.0.7
concurrent-ruby 1.2.2
i18n 1.14.1
minitest 5.20.0
tzinfo 2.0.6
activesupport 7.0.8
public_suffix 4.0.7
addressable 2.8.6
httpclient 2.8.3
json 2.7.2
algoliasearch 1.27.5
artifactory 3.0.17
atomos 0.1.3
aws-eventstream 1.3.0
aws-partitions 1.927.0
aws-sigv4 1.8.0
jmespath 1.6.2
aws-sdk-core 3.195.0
aws-sdk-kms 1.80.0
aws-sdk-s3 1.149.1
babosa 1.0.4
claide 1.1.0
fuzzy_match 2.0.4
nap 1.1.0
netrc 0.11.0
ffi 1.16.3
ethon 0.16.0
typhoeus 1.4.0
cocoapods-core 1.13.0
cocoapods-deintegrate 1.0.5
cocoapods-downloader 1.6.3
cocoapods-plugins 1.0.0
cocoapods-search 1.0.1
cocoapods-trunk 1.6.0
cocoapods-try 1.2.0
colored2 3.1.2
escape 0.0.4
fourflusher 2.3.1
gh_inspector 1.1.3
molinillo 0.8.0
ruby-macho 2.5.1
nanaimo 0.3.0
xcodeproj 1.24.0
cocoapods 1.13.0
colored 1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.5
domain_name 0.6.20240107
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.110.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.4.1
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.3.1
jwt 2.8.1
multi_json 1.15.0
os 1.1.4
signet 0.19.0
googleauth 1.8.1
mini_mime 1.1.5
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
google-apis-core 0.11.3
google-apis-androidpublisher_v3 0.54.0
google-apis-playcustomapp_v1 0.13.0
google-cloud-env 1.6.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.31.0
google-cloud-errors 1.4.0
google-cloud-core 1.7.0
google-cloud-storage 1.47.0
mini_magick 4.12.0
naturally 2.2.1
optparse 0.5.0
plist 3.7.1
rubyzip 2.3.2
security 0.1.5
simctl 1.6.10
terminal-notifier 2.0.0
unicode-display_width 2.5.0
terminal-table 3.0.2
tty-screen 0.8.2
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
fastlane-plugin-versioning 0.5.2

generated on: 2024-05-11

@SirCameron
Copy link
Author

Please can someone help with this?

@SirCameron
Copy link
Author

latest_testflight_build_number is able to login without they api_key.
But when pilot runs, it requires api_key.

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

No branches or pull requests

1 participant