{"action":"created","issue":{"url":"https://api.github.com/repos/fastlane/fastlane/issues/8046","repository_url":"https://api.github.com/repos/fastlane/fastlane","labels_url":"https://api.github.com/repos/fastlane/fastlane/issues/8046/labels{/name}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/8046/comments","events_url":"https://api.github.com/repos/fastlane/fastlane/issues/8046/events","html_url":"https://github.com/fastlane/fastlane/issues/8046","id":203874268,"number":8046,"title":"[Regression] PEM not using existing valid certificates ultimately causing error when more than 2 certificates are to be created","user":{"login":"haydus","id":16452124,"avatar_url":"https://avatars.githubusercontent.com/u/16452124?v=3","gravatar_id":"","url":"https://api.github.com/users/haydus","html_url":"https://github.com/haydus","followers_url":"https://api.github.com/users/haydus/followers","following_url":"https://api.github.com/users/haydus/following{/other_user}","gists_url":"https://api.github.com/users/haydus/gists{/gist_id}","starred_url":"https://api.github.com/users/haydus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haydus/subscriptions","organizations_url":"https://api.github.com/users/haydus/orgs","repos_url":"https://api.github.com/users/haydus/repos","events_url":"https://api.github.com/users/haydus/events{/privacy}","received_events_url":"https://api.github.com/users/haydus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-01-29T14:52:47Z","updated_at":"2017-01-30T05:11:28Z","closed_at":null,"body":"### New Issue Checklist\r\n\r\n- [x] Updated fastlane to the latest version\r\n- [x] I have read the [Contribution Guidelines](https://github.com/fastlane/fastlane/blob/master/CONTRIBUTING.md)\r\n\r\n### Issue Description\r\nWhen running PEM using an app_identifier that already has push certificates, it will create new certificates even thought there are existing ones, and they are still valid for more than 30 days.\r\nWhile not exceeding 2 certs per app, it will work fine, but beyond that it fails with the following error:\r\nYou already have 2 active push profiles for this application/environment. You'll need to revoke an old certificate to make room for a new one\r\n\r\n##### Complete output when running fastlane\r\nSuccessfully loaded Appfile at path '/Projects/xxxxxx/fastlane/Appfile'\r\n- app_identifier: 'xxxxxx'\r\n- apple_id: 'xxxxxx'\r\n- team_id: 'xxxxxx'\r\n-------\r\n\r\n+------------------+------------------------+\r\n|          Summary for PEM 2.12.0           |\r\n+------------------+------------------------+\r\n| development      | false                  |\r\n| generate_p12     | true                   |\r\n| force            | false                  |\r\n| save_private_key | true                   |\r\n| app_identifier   | xxxxxx |\r\n| username         | xxxxxx       |\r\n| team_id          | xxxxxx             |\r\n| output_path      | .                      |\r\n+------------------+------------------------+\r\n\r\nINFO [2017-01-29 16:39:35.67]: Starting login with user 'xxxxxx\r\nINFO [2017-01-29 16:39:38.70]: Successfully logged in\r\nWARN [2017-01-29 16:39:43.45]: Creating a new push certificate for app 'xxxxxx'.\r\nINFO [2017-01-29 16:39:56.11]: {\"responseId\"=>\"88c4842c-d640-4045-8fb3-26fb0f504575\", \"resultCode\"=>7460, \"resultString\"=>\"You already have a current Apple Push Services certificate or a pending certificate request.\", \"userString\"=>\"You already have a current Apple Push Services certificate or a pending certificate request.\", \"creationTimestamp\"=>\"2017-01-29T14:39:59Z\", \"protocolVersion\"=>\"QH65B2\", \"userLocale\"=>\"en_US\", \"requestUrl\"=>\"https://developer.apple.com/services-account/QH65B2/account/ios/certificate/submitCertificateRequest.action\", \"httpCode\"=>200}\r\n/Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/fastlane_core/lib/fastlane_core/ui/interface.rb:145:in `user_error!': [!] You already have 2 active push profiles for this application/environment. You'll need to revoke an old certificate to make room for a new one (FastlaneCore::Interface::FastlaneError)\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/pem/lib/pem/manager.rb:51:in `rescue in create_certificate'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/pem/lib/pem/manager.rb:45:in `create_certificate'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/pem/lib/pem/manager.rb:30:in `start'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/pem/lib/pem/commands_generator.rb:33:in `block (2 levels) in run'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/pem/lib/pem/commands_generator.rb:39:in `run'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/pem/lib/pem/commands_generator.rb:11:in `start'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/fastlane/lib/fastlane/cli_tools_distributor.rb:45:in `take_off'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/gems/fastlane-2.12.0/bin/fastlane:15:in `<top (required)>'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/bin/fastlane:22:in `load'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/bin/fastlane:22:in `<main>'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval'\r\n\tfrom /Users/shahar/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `<main>'\r\n\r\n### Environment\r\n<details><summary>🚫 fastlane environment 🚫</summary>\r\n\r\n### Stack\r\n\r\n| Key                 | Value                                       |\r\n| ------------------- | ------------------------------------------- |\r\n| OS                  | 10.12.3                                     |\r\n| Ruby                | 2.3.3                                       |\r\n| Bundler?            | false                                       |\r\n| Git                 | git version 2.10.1 (Apple Git-78)           |\r\n| Installation Source | ~/.rvm/gems/ruby-2.3.3/bin/fastlane         |\r\n| Host                | Mac OS X 10.12.3 (16D32)                    |\r\n| Ruby Lib Dir        | ~/.rvm/rubies/ruby-2.3.3/lib                |\r\n| OpenSSL Version     | OpenSSL 1.0.2j  26 Sep 2016                 |\r\n| Is contained        | false                                       |\r\n| Xcode Path          | /Applications/Xcode.app/Contents/Developer/ |\r\n| Xcode Version       | 8.2.1                                       |\r\n\r\n\r\n### System Locale\r\n\r\n| Error                       |\r\n| --------------------------- |\r\n| No Locale with UTF8 found 🚫 |\r\n\r\n\r\n### fastlane files:\r\n\r\n<details><summary>`./fastlane/Fastfile`</summary>\r\n\r\n```ruby\r\n# Customise this file, documentation can be found here:\r\n# https://github.com/KrauseFx/fastlane/tree/master/docs\r\n# All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md\r\n# can also be listed using the `fastlane actions` command\r\n\r\n# Change the syntax highlighting to Ruby\r\n# All lines starting with a # are ignored when running `fastlane`\r\n\r\n# By default, fastlane will send which actions are used\r\n# No personal data is shared, more information on https://github.com/fastlane/enhancer\r\n# Uncomment the following line to opt out\r\n# opt_out_usage\r\n\r\n# If you want to automatically update fastlane if a new version is available:\r\n#update_fastlane\r\n\r\n# This is the minimum version number required.\r\n# Update this, if you use features of a newer version\r\nfastlane_version \"1.37.0\"\r\n\r\n\r\n\r\nbefore_all do\r\n\t#update_fastlane\r\nend\r\n\r\nlane :splash do\r\n\tsnapshot\r\nend\r\n\r\nlane :release  do |options|\r\n\r\n#\tcert\r\n\r\n\tproduce(\r\n  \t\tusername: 'xxxxxx',\r\n  \t\tapp_identifier: 'xxxxxx',\r\n\t\tapp_name: 'xxxxxx',\r\n\t\tlanguage: 'English',\r\n\t\tapp_version: 'xxxxxx',\r\n\t\tsku: 'xxxxxx',\r\n\t\tcompany_name: 'xxxxxx'\r\n\t)\r\n\r\n\t# push notification profile    \r\n\tpem\r\n      \r\n\t# build appstore & deliver\r\n#\tsigh(skip_install: true)\r\n\tmatch(type: \"appstore\")\r\n\tgym(scheme: \"xxxxxx\", output_name: \"xxxxxx\", configuration: \"Release\");\r\n\tdeliver(edit_live: false)\r\n\r\nend\r\n\r\nlane :archive  do |options|\r\n\r\n#\tcert\r\n\r\n\t# push notification profile    \r\n\tpem\r\n      \r\n\t# provisioning profile\r\n#\tsigh(adhoc: true, skip_install: true)\r\n\tmatch(type: \"adhoc\")\r\n    \r\n\tgym(scheme: \"xxxxxx\", output_name: \"xxxxxx\", configuration: \"Release\");\r\n\r\nend\r\n\r\nlane :archive_admin  do |options|\r\n\r\n#\tcert\r\n\r\n\t# push notification profile    \r\n\tpem\r\n      \r\n\t# provisioning profile\r\n#\tsigh(adhoc: true, skip_install: true)\r\n\tmatch(type: \"adhoc\", force_for_new_devices: true)\r\n    \r\n\tgym(scheme: \"xxxxxx\", output_name: \"xxxxxx\", configuration: \"Release\");\r\n\r\nend\r\n\r\n#after_all do |lane|\r\n  #clean_build_artifacts\r\n#  say \"Successfully finished (#{lane})!\"\r\n#end\r\n\r\n#error do |lane, exception|\r\n#  say \"error line #{line} exception #{exception}\"\r\n#end\r\n\r\n\r\n# More information about multiple platforms in fastlane: \r\n# https://github.com/KrauseFx/fastlane/blob/master/docs/Platforms.md\r\n```\r\n</details>\r\n\r\n<details><summary>`./fastlane/Appfile`</summary>\r\n\r\n```ruby\r\napp_identifier \"xxxxxx\"\r\napple_id \"xxxxxx\" # Your Apple email address\r\n\r\nteam_id \"xxxxxx\"\r\n\r\n# You can uncomment any of the lines below and add your own\r\n# team selection in case you're in multiple teams\r\n# team_name \"Felix Krause\"\r\n# team_id \"Q2CBPJ58CA\"\r\n\r\n\r\n# you can even provide different app identifiers, Apple IDs and team names per lane:\r\n# https://github.com/KrauseFx/fastlane/blob/master/docs/Appfile.md\r\n```\r\n</details>\r\n\r\n### fastlane gems\r\n\r\n| Gem      | Version | Update-Status |\r\n| -------- | ------- | ------------- |\r\n| fastlane | 2.12.0  | ✅ Up-To-Date  |\r\n\r\n\r\n### Loaded fastlane plugins:\r\n\r\n**No plugins Loaded**\r\n\r\n\r\n<details><summary><b>Loaded gems</b></summary>\r\n\r\n| Gem                       | Version      |\r\n| ------------------------- | ------------ |\r\n| did_you_mean              | 1.0.0        |\r\n| executable-hooks          | 1.3.2        |\r\n| bundler-unload            | 1.0.2        |\r\n| rubygems-bundler          | 1.4.4        |\r\n| bundler                   | 1.13.7       |\r\n| io-console                | 0.4.5        |\r\n| slack-notifier            | 1.5.1        |\r\n| i18n                      | 0.7.0        |\r\n| json                      | 1.8.3        |\r\n| thread_safe               | 0.3.5        |\r\n| tzinfo                    | 1.2.2        |\r\n| minitest                  | 5.8.5        |\r\n| activesupport             | 4.2.7.1      |\r\n| CFPropertyList            | 2.3.4        |\r\n| claide                    | 1.0.1        |\r\n| colored                   | 1.2          |\r\n| nanaimo                   | 0.2.3        |\r\n| xcodeproj                 | 1.4.2        |\r\n| rouge                     | 1.11.1       |\r\n| xcpretty                  | 0.2.4        |\r\n| terminal-notifier         | 1.7.1        |\r\n| unicode-display_width     | 1.1.2        |\r\n| terminal-table            | 1.7.3        |\r\n| plist                     | 3.2.0        |\r\n| public_suffix             | 2.0.4        |\r\n| addressable               | 2.5.0        |\r\n| multipart-post            | 2.0.0        |\r\n| word_wrap                 | 1.0.0        |\r\n| babosa                    | 1.0.2        |\r\n| highline                  | 1.7.8        |\r\n| commander                 | 4.4.3        |\r\n| excon                     | 0.54.0       |\r\n| faraday                   | 0.10.0       |\r\n| unf_ext                   | 0.0.7.2      |\r\n| unf                       | 0.1.4        |\r\n| domain_name               | 0.5.20161129 |\r\n| http-cookie               | 1.0.3        |\r\n| faraday-cookie_jar        | 0.0.6        |\r\n| fastimage                 | 2.0.1        |\r\n| gh_inspector              | 1.0.2        |\r\n| uber                      | 0.0.15       |\r\n| representable             | 2.3.0        |\r\n| retriable                 | 2.1.0        |\r\n| mime-types-data           | 3.2016.0521  |\r\n| mime-types                | 3.1          |\r\n| hurley                    | 0.2          |\r\n| little-plugger            | 1.1.4        |\r\n| multi_json                | 1.12.1       |\r\n| logging                   | 2.1.0        |\r\n| jwt                       | 1.5.6        |\r\n| memoist                   | 0.15.0       |\r\n| os                        | 0.9.6        |\r\n| signet                    | 0.7.3        |\r\n| googleauth                | 0.5.1        |\r\n| httpclient                | 2.8.3        |\r\n| google-api-client         | 0.9.20       |\r\n| mini_magick               | 4.5.1        |\r\n| multi_xml                 | 0.6.0        |\r\n| rubyzip                   | 1.2.0        |\r\n| security                  | 0.1.3        |\r\n| xcpretty-travis-formatter | 0.0.4        |\r\n| dotenv                    | 2.1.1        |\r\n| faraday_middleware        | 0.10.1       |\r\n</details>\r\n\r\n\r\n*generated on:* **2017-01-29**\r\n</details>"},"comment":{"url":"https://api.github.com/repos/fastlane/fastlane/issues/comments/275981447","html_url":"https://github.com/fastlane/fastlane/issues/8046#issuecomment-275981447","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/8046","id":275981447,"user":{"login":"KrauseFx","id":869950,"avatar_url":"https://avatars.githubusercontent.com/u/869950?v=3","gravatar_id":"","url":"https://api.github.com/users/KrauseFx","html_url":"https://github.com/KrauseFx","followers_url":"https://api.github.com/users/KrauseFx/followers","following_url":"https://api.github.com/users/KrauseFx/following{/other_user}","gists_url":"https://api.github.com/users/KrauseFx/gists{/gist_id}","starred_url":"https://api.github.com/users/KrauseFx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrauseFx/subscriptions","organizations_url":"https://api.github.com/users/KrauseFx/orgs","repos_url":"https://api.github.com/users/KrauseFx/repos","events_url":"https://api.github.com/users/KrauseFx/events{/privacy}","received_events_url":"https://api.github.com/users/KrauseFx/received_events","type":"User","site_admin":false},"created_at":"2017-01-30T05:11:28Z","updated_at":"2017-01-30T05:11:28Z","body":"I was able to reproduce the issue and already working on a fix 👍 Thanks for reporting this"}}
{"actor":{"display_login":"KrauseFx"}}