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

Could not create another Development certificate, reached the maximum number. #17272

Closed
4 tasks done
LemonSpike opened this issue Sep 18, 2020 · 1 comment
Closed
4 tasks done

Comments

@LemonSpike
Copy link

LemonSpike commented Sep 18, 2020

New Issue Checklist

Issue Description

I tried running bundle exec fastlane match development without specifying the github url in the Matchfile a few times and now when I run bundle exec fastlane match development I get an error saying maximum number of development certificates reached. I get the same error when running for appstore too. I only have 3 development certificates on my company account, but I also have a personal App Store Connect account.

Command executed

bundle exec fastlane match development --verbose

Complete output when running fastlane, including the stack trace and command used
▶ bundle exec fastlane match development --verbose
[✔] 🚀
/usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/fastlane_core/lib/fastlane_core/ui/interface.rb:141: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/fastlane_core/lib/fastlane_core/ui/errors/fastlane_error.rb:9: warning: The called method `initialize' is defined here
INFO [2020-09-18 15:44:51.76]: Successfully loaded '/Users/user/Desktop/Work/app/fastlane/Matchfile' 📄

+----------------+--------------------------------------------+
|             Detected Values from './Matchfile'              |
+----------------+--------------------------------------------+
| git_url        | git@github.com:LemonSpike/certificates  |
|                | s.git                                      |
| storage_mode   | git                                        |
| type           | development                                |
| app_identifier | ["app_id"]              |
| username       | email@gmail.com                    |
| team_id        | team_id                                 |
| git_branch     | master                                     |
+----------------+--------------------------------------------+


+--------------------------------+--------------------------------------------+
|                          Summary for match 2.160.0                          |
+--------------------------------+--------------------------------------------+
| verbose                        | true                                       |
| type                           | development                                |
| readonly                       | false                                      |
| generate_apple_certs           | true                                       |
| skip_provisioning_profiles     | false                                      |
| app_identifier                 | ["app_id"]              |
| username                       | email@gmail.com                    |
| team_id                        | team_id                                 |
| storage_mode                   | git                                        |
| git_url                        | git@github.com:LemonSpike/certificates  |
|                                | s.git                                      |
| git_branch                     | master                                     |
| shallow_clone                  | false                                      |
| clone_branch_directly          | false                                      |
| keychain_name                  | login.keychain                             |
| force                          | false                                      |
| force_for_new_devices          | false                                      |
| skip_confirmation              | false                                      |
| skip_docs                      | false                                      |
| platform                       | ios                                        |
| derive_catalyst_app_identifier | false                                      |
| fail_on_name_taken             | false                                      |
+--------------------------------+--------------------------------------------+

INFO [2020-09-18 15:44:51.77]: Cloning remote git repo...
INFO [2020-09-18 15:44:51.77]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
INFO [2020-09-18 15:44:51.77]: $ git clone git@github.com:LemonSpike/certificates.git /var/folders/c4/c8xhhjp97d7391gz1m7s7xhw0000gn/T/d20200918-78592-7cbbxk
INFO [2020-09-18 15:44:51.81]: ▸ Cloning into '/var/folders/c4/c8xhhjp97d7391gz1m7s7xhw0000gn/T/d20200918-78592-7cbbxk'...
INFO [2020-09-18 15:44:53.05]: ▸ warning: You appear to have cloned an empty repository.
INFO [2020-09-18 15:44:53.25]: $ git --no-pager branch --list origin/master --no-color -r
INFO [2020-09-18 15:44:53.27]: Checking out branch master...
INFO [2020-09-18 15:44:53.27]: $ git checkout --orphan master
INFO [2020-09-18 15:44:53.29]: ▸ Switched to a new branch 'master'
INFO [2020-09-18 15:44:53.29]: $ git reset --hard
INFO [2020-09-18 15:44:53.31]: 🔓  Successfully decrypted certificates repo
INFO [2020-09-18 15:44:53.35]: Verifying that the certificate and profile are still valid on the Dev Portal...
Reading keychain entry, because either user or password were empty
Loading session from '/Users/user/.fastlane/spaceship/email@gmail.com/cookie'
Available session is not valid any more. Continuing with normal login.
WARN [2020-09-18 15:44:57.25]: Couldn't find a valid code signing identity for development... creating one for you now

+----------------------+--------------------------------------------+
|                     Summary for cert 2.160.0                      |
+----------------------+--------------------------------------------+
| platform             | ios                                        |
| development          | true                                       |
| generate_apple_certs | true                                       |
| force                | true                                       |
| username             | pranavkasetti@gmail.com                    |
| team_id              | 9478TRD43F                                 |
| keychain_path        | /Users/user/Library/Keychains/log  |
|                      | in.keychain-db                             |
+----------------------+--------------------------------------------+

INFO [2020-09-18 15:44:57.26]: Starting login with user 'email@gmail.com'
Reading keychain entry, because either user or password were empty
Loading session from '/Users/user/.fastlane/spaceship/email@gmail.com/cookie'
Available session is not valid any more. Continuing with normal login.
INFO [2020-09-18 15:45:00.63]: Successfully logged in

Looking for related GitHub issues on fastlane/fastlane...
Search query: Could not create another Development certificate, reached the maximum number of available Development certificates.

URL: https://api.github.com/search/issues?q=Could%20not%20create%20another%20Development%20certificate%2C%20reached%20the%20maximum%20number%20of%20available%20Development%20certificates.+repo:fastlane/fastlane
➡️  Fastlane match + multiple apps + git branches
    https://github.com/fastlane/fastlane/issues/16311 [closed] 5 💬
    6 weeks ago

➡️  match fails to create Development certificate, claims that it reached maximum
    https://github.com/fastlane/fastlane/issues/14998 [closed] 10 💬
    08 Mar 2020

➡️  Unable to `cert` within circleci, There are no local code signing identities found
    https://github.com/fastlane/fastlane/issues/15432 [closed] 3 💬
    04 Jan 2020

and 33 more at: https://github.com/fastlane/fastlane/search?q=Could%20not%20create%20another%20Development%20certificate%2C%20reached%20the%20maximum%20number%20of%20available%20Development%20certificates.&type=Issues&utf8=✓

🔗  You can ⌘ + double-click on links to open them directly in your browser.
bundler: failed to load command: fastlane (/usr/local/lib/ruby/gems/2.7.0/bin/fastlane)
FastlaneCore::Interface::FastlaneError: [!] Could not create another Development certificate, reached the maximum number of available Development certificates.
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/fastlane_core/lib/fastlane_core/ui/interface.rb:141:in `user_error!'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/cert/lib/cert/runner.rb:181:in `rescue in create_certificate'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/cert/lib/cert/runner.rb:176:in `create_certificate'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/cert/lib/cert/runner.rb:44:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/cert/lib/cert/runner.rb:13:in `launch'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/match/lib/match/generator.rb:39:in `generate_certificate'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/match/lib/match/runner.rb:161:in `fetch_certificate'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/match/lib/match/runner.rb:94:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/match/lib/match/commands_generator.rb:68:in `block (3 levels) in run'
  /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
  /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
  /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/match/lib/match/commands_generator.rb:187:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/match/lib/match/commands_generator.rb:25:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
  /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.160.0/bin/fastlane:23:in `<top (required)>'
  /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in `load'
  /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in `<top (required)>'

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.15.6
Ruby 2.7.1
Bundler? true
Git git version 2.24.3 (Apple Git-128)
Installation Source /usr/local/lib/ruby/gems/2.7.0/bin/fastlane
Host Mac OS X 10.15.6 (19G2021)
Ruby Lib Dir /usr/local/Cellar/ruby/2.7.1_2/lib
OpenSSL Version OpenSSL 1.1.1f 31 Mar 2020
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.7

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./Fastfile`
fastlane_version "2.9.0"
default_platform :ios


mhg_firebase_app_id = "fir Id"


platform :ios do

  before_all do
    ENV["DELIVER_USERNAME"] = "email@gmail.com"
    ENV["CERTS_URL"] = "git@github.com:LemonSpike/certificates.git"

  end

  lane :nuke_certs do
    nuke(identifier: "app_id", team: "team_id")
  end

  lane :nuke do |options|
    nuke_command(type: "development", app_identifier: options[:identifier], team_id: options[:team], git_branch: options[:team])
    nuke_command(type: "distribution", app_identifier: options[:identifier], team_id: options[:team], git_branch: options[:team])
  end

  lane :nuke_command do |options|
    cli = "fastlane match nuke #{options[:type]} --git_url #{ENV["CERTS_URL"]} --git_branch #{options[:team_id]} -u #{ENV["DELIVER_USERNAME"]} -b #{options[:team_id]} --force"
    sh(cli)
  end

  lane :devices do
      register_devices(devices_file: "fastlane/devices.txt", team_id: 'team_id', username: ENV["DELIVER_USERNAME"])
      refresh_certs(type: "adhoc", new_devices: true, readonly: false)
      refresh_certs(type: "development", new_devices: true, readonly: false)
  end

  lane :refresh_all_certs do | options |
    refresh_certs(type: "development", new_devices: false, force: true, readonly: false)
    refresh_certs(type: "adhoc", new_devices: false, force: true, readonly: false)
    refresh_certs(type: "appstore", new_devices: false, force: true, readonly: false)
  end

  lane :refresh_certs do |options|
    certificates(type: options[:type], identifier: "app_id", team: 'team_id', new_devices: options[:new_devices], force: options[:force], readonly: options[:readonly])

  end

  lane :certificates do |options|
    match(git_url: ENV["CERTS_URL"],
      type: options[:type],
      app_identifier: options[:identifier], team_id: options[:team], git_branch: "master", username: ENV["DELIVER_USERNAME"], force_for_new_devices: options[:new_devices], readonly: options[:readonly])
  end


  lane :firebase do 
       gym(
      workspace: "app.xcworkspace",
      scheme: "app",
      export_method: "ad-hoc",
      silent: true,
      clean: true
    )

    firebase_app_distribution( 
      app: firebase_app_id,
      release_notes: "Staging Build",
      groups: "team-ios",
      firebase_cli_token: ENV["MHG_FIREBASE_TOKEN"]
    )

  end


  lane :mhg_appstore do |options| 
    send_appstore(team: 'team_no', team_id: 'team_id', identifier: 'app_id', scheme: options[:scheme], ipa: 'app.ipa')
  end

  lane :send_appstore do |options|
    cocoapods

    #retrieve distribution certificate
    certificates(type: "appstore", identifier: options[:identifier], team: options[:team], new_devices: true, force: true)

    #build app using the certificate
    gym(scheme: options[:scheme], export_method: 'app-store')

    deliver(team_id: options[:team_id], skip_screenshots: true, skip_metadata: true)
  end

end

No Appfile found

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-firebase_app_distribution 0.2.1 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.4.0
bundler 2.1.2
uri 0.10.0
rake 13.0.1
CFPropertyList 3.0.2
concurrent-ruby 1.1.5
i18n 0.9.5
minitest 5.11.3
thread_safe 0.3.6
tzinfo 1.2.5
activesupport 4.2.11.1
public_suffix 4.0.6
addressable 2.7.0
atomos 0.1.3
aws-eventstream 1.1.0
aws-partitions 1.372.0
aws-sigv4 1.2.2
jmespath 1.4.0
aws-sdk-core 3.107.0
aws-sdk-kms 1.38.0
aws-sdk-s3 1.81.0
babosa 1.0.3
claide 1.0.3
fuzzy_match 2.0.4
nap 1.1.0
cocoapods-core 1.7.5
cocoapods-deintegrate 1.0.4
cocoapods-downloader 1.2.2
cocoapods-plugins 1.0.0
cocoapods-search 1.0.0
cocoapods-stats 1.1.0
netrc 0.11.0
cocoapods-trunk 1.4.1
cocoapods-try 1.1.0
colored2 3.1.2
escape 0.0.4
fourflusher 2.3.1
gh_inspector 1.1.3
molinillo 0.6.6
ruby-macho 1.4.0
nanaimo 0.3.0
xcodeproj 1.18.0
cocoapods 1.7.5
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
declarative 0.0.20
declarative-option 0.1.0
digest-crc 0.6.1
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.7.6
emoji_regex 3.0.0
excon 0.76.0
multipart-post 2.0.0
faraday 1.0.1
http-cookie 1.0.3
faraday-cookie_jar 0.0.7
faraday_middleware 1.0.0
fastimage 2.2.0
jwt 2.2.2
memoist 0.16.2
multi_json 1.15.0
os 1.1.1
signet 0.14.0
googleauth 0.13.1
httpclient 2.8.3
mini_mime 1.0.2
uber 0.1.0
representable 3.0.4
retriable 3.1.2
google-api-client 0.38.0
google-cloud-env 1.3.3
google-cloud-errors 1.0.1
google-cloud-core 1.5.0
google-cloud-storage 1.28.0
json 2.3.1
mini_magick 4.10.1
plist 3.5.0
rubyzip 2.3.0
security 0.1.3
naturally 2.2.0
simctl 1.6.8
slack-notifier 2.3.2
terminal-notifier 2.0.0
unicode-display_width 1.7.0
terminal-table 1.8.0
tty-screen 0.8.1
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.0
fastlane-plugin-firebase_app_distribution 0.2.1

generated on: 2020-09-18

@LemonSpike
Copy link
Author

I first nuked my certificates and provisioning profiles, since these were invalid, and started fresh with an empty GH repo to let fastlane generate the certs and profiles. I then cleared out the deliver password in Keychain Assistant, and the match password. Now everything works automagically. 🚀

@fastlane fastlane locked and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant