fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps

Home Page:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong upload_to_testflight teams available for account specified

liudasbar opened this issue · comments

New Issue Checklist

Issue Description

upload_to_testflight via CI/CD TestFlight distribution pipeline detects wrong Apple ID account available teams (not the Apple ID account itself) even though all CI/CD environment variables are set accordingly to correct account / team details.

But there is one twist - before everything, I ran fastlane spaceauth -u with wrong account set (by the way, it has its own teams that I don't need for now), updated FASTLANE_SESSION CI/CD variable and ran the TestFlight distribution pipeline. It failed, I noticed that it is wrong account. After that, I ran fastlane spaceauth -u with a correct account, updated the variable, and re-ran the pipeline.

❗️The issue is that it still searches for team within the previous account, not the new correct one, even though it displays correct account in line Login to App Store Connect ( and correct team ID in line Could not set team ID to 'Good team ID', only found the following available teams. How I know it shows the previous wrong account - by checking "available teams". Those available teams are related to previous account, not the updated correct new one.

Pipeline says:

--- Step: upload_to_testflight ---

Login to App Store Connect (

Could not set team ID to 'Good team ID', only found the following available teams:
 - XXXXXX (Team from wrong account)
 - XXXXXX (Another team from wrong account)
 - XXXXXX (And another team from wrong account)

For visual, please see this screenshot

  • I once again checked Apple Developer Account Membership page for team ID and email I want to use.
  • I once again checked all my CI/CD variables.
  • I once again checked what teams wrong and correct account have and I still confirm this issue is present.
  • I once again did CMD+F search throughout the project folder (with fastlane folder included) and CI/CD variables to make sure nothing from wrong account is left. Yes, nothing is left, only new needed account and team details.

🚫 fastlane environment 🚫


Key Value
OS 12.0.1
Ruby 2.6.5
Bundler? false
Git git version 2.32.0 (Apple Git-132)
Installation Source ~/.rbenv/versions/2.6.5/bin/fastlane
Host macOS 12.0.1 (21A559)
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 false
Xcode Path /Applications/
Xcode Version 13.2.1
Swift Version 5.5.2

System Locale

No Locale with UTF8 found 🚫

fastlane files:

# This file contains the configuration
# You can find the documentation at
# For a list of all available actions, check out
# For a list of all available plugins, check out


platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta_testflight do
    login_keychain_password = ENV["LOGIN_KEYCHAIN_PASSWORD"]
    new_keychain_name = ENV["NEW_KEYCHAIN_NAME"]
    new_keychain_password = ENV["NEW_KEYCHAIN_PASSWORD"]
    username = ENV["FASTLANE_USER"]
      path: "login.keychain",
      password: login_keychain_password
    sh "security set-keychain-settings -t 3600 -l ~/Library/Keychains/login.keychain"
      name: new_keychain_name,
      unlock: true,
      timeout: 0,
      lock_when_sleeps: false,
      password: new_keychain_password
      type: "adhoc",
      keychain_name: new_keychain_name,
      keychain_password: new_keychain_password,
      readonly: true
    sh "security set-key-partition-list -S apple-tool:,apple: -s -k \"#{new_keychain_password}\" \"#{new_keychain_name}\""
      workspace: "xxx.xcworkspace",
      scheme: "App-tst",
      configuration: "Release",
      export_method: "ad-hoc",
      export_options: {
        signingStyle: "manual",
        provisioningProfiles: { 
      clean: true,
      export_team_id: team_id
    release_notes = sh("../")
      skip_waiting_for_build_processing: true,
      changelog: release_notes,
      username: username,
      team_id: team_id
      dsym_path: "#{Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]}", 
      gsp_path: ENV["GSP_PATH"],
      app_id: ENV["FIREBASE_APP_ID"],
      debug: false,
      binary_path: './scripts/upload-symbols'
    delete_keychain(name: new_keychain_name)
app_identifier(ENV["APPLE_APP_IDENTIFIER"] || "correct_app_identifier")
team_id(ENV["APPLE_DEVELOPER_TEAM_ID"] || "correct_team_id")

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-firebase_app_distribution 0.3.4 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
terminal-table 1.8.0
plist 3.6.0
addressable 2.8.0
multipart-post 2.0.0
word_wrap 1.0.0
optparse 0.1.1
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
faraday-cookie_jar 0.0.7
gh_inspector 1.1.3
mini_magick 4.11.0
naturally 2.2.1
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.7.6
simctl 1.6.8
rexml 3.2.5
nanaimo 0.3.0
colored2 3.1.2
claide 1.1.0
CFPropertyList 3.0.5
atomos 0.1.3
xcodeproj 1.21.0
unicode-display_width 1.8.0
public_suffix 4.0.7
excon 0.92.2
ruby2_keywords 0.0.5
faraday-retry 1.0.3
faraday-rack 1.0.0
faraday-patron 1.0.0
faraday-net_http_persistent 1.2.0
faraday-net_http 1.0.1
faraday-multipart 1.0.3
faraday-httpclient 1.0.1
faraday-excon 1.1.0
faraday-em_synchrony 1.0.0
faraday-em_http 1.0.0
faraday 1.10.0
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.4
faraday_middleware 1.2.0
fastimage 2.2.6
json 2.6.1
rubyzip 2.3.2
bundler 2.2.14
jwt 2.3.0
webrick 1.7.0
httpclient 2.8.3
multi_json 1.15.0
signet 0.16.1
os 1.1.4
memoist 0.16.2
googleauth 1.1.3
mini_mime 1.1.2
retriable 3.1.2
trailblazer-option 0.1.2
declarative 0.0.20
uber 0.1.0
representable 3.1.1
google-apis-core 0.4.2
google-apis-playcustomapp_v1 0.7.0
google-apis-androidpublisher_v3 0.19.0
rake 13.0.6
digest-crc 0.6.4
google-apis-storage_v1 0.13.0
google-apis-iamcredentials_v1 0.10.0
google-cloud-errors 1.2.0
google-cloud-env 1.6.0
google-cloud-core 1.6.0
google-cloud-storage 1.36.2
emoji_regex 3.2.3
aws-eventstream 1.2.0
aws-sigv4 1.5.0
aws-partitions 1.579.0
jmespath 1.6.1
aws-sdk-core 3.130.1
aws-sdk-kms 1.56.0
aws-sdk-s3 1.113.0
forwardable 1.2.0
logger 1.3.0
date 2.0.0
stringio 0.0.2
ipaddr 1.2.2
openssl 2.1.2
zlib 1.0.0
mutex_m 0.1.0
ostruct 0.1.0
strscan 1.0.0
io-console 0.4.7
fileutils 1.1.0
etc 1.0.1
racc 1.5.2
nokogiri 1.11.7
psych 3.1.0
fastlane-plugin-firebase_app_distribution 0.3.4

generated on: 2022-05-25

CI/CD variables:

FASTLANE_ITC_TEAM_ID - checked, correct
FASTLANE_SESSION - regenerated for correct account, must be ok
FASTLANE_USER - correct account


By removing cookie files for both:/Users/admin/.fastlane/spaceship/ and /Users/admin/.fastlane/spaceship/ and re-generating new correct account session.

@Holthaus789 Thank you for your effort 😊 I have solved the problem by doing what I have mentioned in another comment 👍

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

ezoic increase your site revenue