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

[spaceship] Latest version is unable to download ad-hoc provision profiles. #13916

Closed
4 tasks done
fwigorcferreira opened this issue Dec 14, 2018 · 13 comments
Closed
4 tasks done

Comments

@fwigorcferreira
Copy link

fwigorcferreira commented Dec 14, 2018

New Issue Checklist

Issue Description

Fastlane, on version 2.111.0 is unable to download ad-hoc provision profiles. The command fails with No existing profiles found, that match the certificates you have installed locally! even if -z, --skip_certificate_verification is passed. I double & triple checked, and the provision profile exists in the developer portal. Tried it on a machine that had the valid certificate installed, and the same error was reported

Complete output when running fastlane, including the stack trace and command used
Command:

fastlane sigh -z -w -u username -b team_id -a package -n "provision_profile_name" -q profile.mobileprovision --ignore_profiles_with_different_name --skip_install --adhoc

Result:

[✔] 🚀
[17:02:14]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile

+-------------------------------------+-------------------------------------+
| Summary for sigh 2.111.0 |
+-------------------------------------+-------------------------------------+
| skip_certificate_verification | true |
| skip_fetch_profiles | true |
| username | username |
| team_id | team_id |
| app_identifier | package |
| provisioning_name | provision_profile_name |
| filename | profile.mobileprovision |
| ignore_profiles_with_different_name | true |
| skip_install | true |
| adhoc | true |
| developer_id | false |
| development | false |
| force | false |
| platform | ios |
| readonly | false |
+-------------------------------------+-------------------------------------+

[17:02:14]: Starting login with user 'username'
[17:02:16]: Successfully logged in
[17:02:16]: No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you
[17:02:17]: Found more than one code signing identity. Choosing the first one. Check out fastlane sigh --help to see all available options.
[17:02:17]: Available Code Signing Identities for current filters:
[17:02:17]: - Name: COMPANY_CERTIFICATE - Expires 13/03/2019
[17:02:17]: - Name: COMPANY_CERTIFICATE - Expires 08/05/2019
[17:02:17]: Creating new provisioning profile for 'package' with name 'provision_profile_name' for 'ios' platform

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

Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run fastlane env to append the fastlane environment to your issue

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.14.2
Ruby 2.5.1
Bundler? false
Git git version 2.20.0
Installation Source ~/.rvm/gems/ruby-2.5.1/bin/fastlane
Host Mac OS X 10.14.2 (18C54)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.5.1/lib
OpenSSL Version OpenSSL 1.1.0h 27 Mar 2018
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 10.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.2.0
executable-hooks 1.5.0
bundler-unload 1.0.2
rubygems-bundler 1.4.5
bundler 1.16.2
slack-notifier 2.3.2
atomos 0.1.3
claide 1.0.2
colored2 3.1.2
nanaimo 0.2.6
xcodeproj 1.6.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 1.8.0
unicode-display_width 1.4.0
terminal-table 1.8.0
plist 3.4.0
public_suffix 2.0.5
addressable 2.5.2
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.6.5
tty-cursor 0.6.0
tty-spinner 0.8.0
babosa 1.0.2
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.62.0
faraday 0.15.2
unf_ext 0.0.7.5
unf 0.1.4
domain_name 0.5.20180417
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.3
json 2.1.0
mini_magick 4.5.1
multi_json 1.13.1
multi_xml 0.6.0
rubyzip 1.2.2
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.4.0
faraday_middleware 0.12.2
naturally 2.2.0
simctl 1.6.5
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mime-types-data 3.2016.0521
mime-types 3.1
jwt 2.1.0
memoist 0.16.0
os 1.0.0
signet 0.8.1
googleauth 0.6.3
httpclient 2.8.3
google-api-client 0.23.4
google-cloud-env 1.0.5
google-cloud-core 1.2.7
digest-crc 0.4.1
google-cloud-storage 1.15.0
emoji_regex 0.1.1
CFPropertyList 3.0.0
gh_inspector 1.1.3
openssl 2.1.0
date 1.0.0
fileutils 1.0.2
mini_portile2 2.3.0
nokogiri 1.8.3
ipaddr 1.2.0
psych 3.0.2

generated on: 2018-12-14

@fastlane-bot
Copy link

It seems like this issue might be related to code signing 🚫

Have you seen our new Code Signing Troubleshooting Guide? It will help you resolve the most common code signing issues 👍

@fwigorcferreira
Copy link
Author

Thanks @fastlane-bot! I have read the troubleshooting guide, and it doesn't solve my problem 😄

@fwigorcferreira fwigorcferreira changed the title Version 2.111.0 is unable to download ad-hoc provision profiles. [spaceship] Latest version is unable to download ad-hoc provision profiles. Dec 14, 2018
@TheMetalCode
Copy link
Contributor

This and #13915 seem potentially related, at least with respect to not recognizing an existing profile of the specified type and attempting to generate a new one.

@AndriiTsok
Copy link

@fwigorcferreira I am experiencing the same issue. Our build pipeline is down :)

@andrewtheis
Copy link

andrewtheis commented Dec 14, 2018

+1 Also just began experiencing this issue with fastlane v2.109.1 on Bitrise. Nothing changed in our project / code signing / etc. Might be an issue with Apple Dev Portal, as Bitrise is using an older fastlane version.

@fwigorcferreira
Copy link
Author

@andrewtheis Are you sure it is the same bug? The version 2.111.0 release notes mentions the fix of another issue related to ad-hoc. I also have projects on Bitrise, and had to update to the latest version because of issues in the same action.

@andrewtheis
Copy link

andrewtheis commented Dec 14, 2018

@fwigorcferreira May not be, here's the tail end of the log with the error:

Error:
Can't find class 'adhoc'
Stacktrace (for debugging):
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.109.1/spaceship/lib/spaceship/portal/provisioning_profile.rb:207:in `factory'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.109.1/spaceship/lib/spaceship/portal/provisioning_profile.rb:321:in `block in all'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.109.1/spaceship/lib/spaceship/portal/provisioning_profile.rb:321:in `map!'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.109.1/spaceship/lib/spaceship/portal/provisioning_profile.rb:321:in `all'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/portal/profile_client.rb:155:in `block in fetch_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/portal/common.rb:10:in `run_and_handle_portal_function'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/portal/profile_client.rb:155:in `fetch_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/portal/profile_client.rb:11:in `ensure_xcode_managed_profile'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/profile_helper.rb:65:in `block in ensure_xcode_managed_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/profile_helper.rb:59:in `each'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/profile_helper.rb:59:in `ensure_xcode_managed_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/profile_helper.rb:40:in `block in ensure_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/profile_helper.rb:38:in `each'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/lib/autoprovision/profile_helper.rb:38:in `ensure_profiles'
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise221526454/step_src/step.rb:90:in `<main>'

Nothing has changed in our stack/project/etc. Builds started failing around 12:48pm CT.

@TheMetalCode
Copy link
Contributor

@andrewtheis That exact issue was solved here and is included in the latest release 2.111.0.

It does not appear that the fix solved all potential issues with AdHoc builds though, hence this and several other issues.

@andrewtheis
Copy link

@TheMetalCode Ah, thanks for the info. Weird that it just cropped up all of a sudden though. Working around by installing latest fastlane before auto-provision.

@MagicBulletDave
Copy link

This looks like a issue with the Apple Developer portal including duplicate keys in provisioning profiles, causing them to be malformed and unable to be parsed.

https://stackoverflow.com/questions/53794998/duplicate-key-in-provisioning-profile-causes-build-failure-error-msb4018

Our build pipelines down too.

@shali3
Copy link

shali3 commented Dec 17, 2018

shali3@48c707c
This fixes the issue for me. Before I invest time it fixing the tests for it, can you let me know if it is a reasonable fix?
This looks like a hack that was added 2 years ago to treat AppStore and Adhoc profiles the same. looks like something has changed and now we know to differ between the two in this point in time.
Is this hack still relevant? Is it the reason this issue is happening?

Thanks :)

@TheMetalCode
Copy link
Contributor

@shali3's workaround appears to be working for me too. I ran my AdHoc build job twice just to make sure it worked on successive runs, and it did.

Of course, the fact that the change does break a couple existing tests, plus the appearance of this code having somewhat of a history behind it, means we'll want to make sure we know what we're doing before PR/merge/release.

But for the moment, I can deploy Crashlytics builds again for the first time in the better part of a week, so I'll take the win.

@joshdholtz
Copy link
Member

Fixed with #13945

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

No branches or pull requests

9 participants