fastlane: Sigh doesn't find Provisioning Profile it created and tries to create a new one each time

New Issue Checklist

Issue Description

Sigh doesn’t find a Mobile Provisioning Profile after logging into the Dev Portal. It then tries to create a new provisioning profile using the ‘com.comp.appname AppStore’ pattern, which immediately fails because there already exists a profile with that name. I have tried including cert_id, provisioning_name, and ignore_profiles_with_different_name options without success. The behavior is the same whether sigh is run as part of a lane or stand alone.

Complete output when running fastlane, including the stack trace and command used
x@x:~/build-ios$ sigh -w

+-------------------------------------+---------------------------+
|                     Summary for sigh 1.6.1                      |
+-------------------------------------+---------------------------+
| skip_fetch_profiles                 | true                      |
| adhoc                               | false                     |
| skip_install                        | false                     |
| development                         | false                     |
| force                               | false                     |
| app_identifier                      | com.comp.appname          |
| username                            | x@gmail.com               |
| team_id                             | XXXXXXXXXX                |
| ignore_profiles_with_different_name | false                     |
| skip_certificate_verification       | false                     |
+-------------------------------------+---------------------------+

[20:18:43]: Starting login with user 'x@gmail.com'
[20:18:44]: Successfully logged in
[20:18:44]: No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you
[20:18:47]: Creating new provisioning profile for 'com.comp.appname' with name 'com.comp.appname AppStore'

[!] Apple provided the following error info:
    There were errors in the data supplied. Please correct and re-submit.
    Multiple profiles found with the name 'com.comp.appname AppStore'.  Please remove the duplicate profiles and try again.

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

Fastfile:

default_platform :ios

platform :ios do
  before_all do

  end

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    #increment_build_number(build_number: ENV["BUILD_NUMBER"])
    sigh(skip_fetch_profiles: true)
    gym
    pilot(skip_submission: true)
  end

  error do |lane, exception|
    # slack(
    #   message: exception.message,
    #   success: false
    # )
  end
end

Appfile:

app_identifier "com.comp.appname" # The bundle identifier of your app
apple_id "x@gmail.com" # Your Apple email address

team_id "XXXXXXXXXX"  # Developer Portal Team ID

Environment

fastlane version (run fastlane -v): fastlane 1.81.0

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? No

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? No

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 42 (11 by maintainers)

Most upvoted comments

Hey everyone, did you all get a chance to try the new version? 👍

@pikaboo Is it possible that you don’t have the private key or certificate in your local default keychain? The issue is that sigh can’t find the certificate from the developer portal installed locally.

Could you make sure that the certificate under “My Certificates” has “Imported Private Key” under the disclosure triangle in Keychain Access?

If possible, check out match, as it makes a lot of these issues go away! 🚀

Yes, this is still an issue. The problem is this code in sigh/lib/sigh/runner.rb

def fetch_profiles
    UI.message "Fetching profiles..."
    results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier]).find_all(&:valid?)

Specifically the filter for valid entries at the end. It is ignoring invalid profiles, which are specifically the ones we need to regenerate. @KrauseFx says he is working on a refactor that might help. In the meantime, I plan to continue using my fork which removes this valid filter and works for our needs.

Note: I’m running this via match, so I’m not sure if I have all of the options to sigh or if they are coming from match itself

I get this behavior a lot too; match can’t seem to identify the profiles it created as the ones that need updating… So we end up with tons of profiles that we eventually clean up manually.

+-------------------------------------+----------------------------------------------------------+
|                                     Summary for sigh 1.9.0                                     |
+-------------------------------------+----------------------------------------------------------+
| app_identifier                      | com.comp.AppName.WidgetName                              |
| adhoc                               | false                                                    |
| development                         | true                                                     |
| username                            | username@domain.com                                      |
| force                               | true                                                     |
| cert_id                             | XXXXXXXXXX                                               |
| provisioning_name                   | match Development com.comp.AppName.WidgetName            |
| ignore_profiles_with_different_name | true                                                     |
| team_id                             | YYYYYYYYYY                                               |
| skip_install                        | false                                                    |
| skip_fetch_profiles                 | false                                                    |
| skip_certificate_verification       | false                                                    |
+-------------------------------------+----------------------------------------------------------+

[09:24:09]: Starting login with user 'username@domain.com'
[09:24:10]: Successfully logged in
[09:24:10]: Fetching profiles...
[09:24:21]: No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you
[09:24:32]: The name 'match Development com.comp.AppName.WidgetName' is already taken, using another one.
[09:24:32]: Creating new provisioning profile for 'com.comp.AppName.WidgetName' with name 'match Development com.comp.AppName.WidgetName 1471623872'
[09:24:33]: Downloading provisioning profile...
[09:24:33]: Successfully downloaded provisioning profile...