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

sync_code_signing breaks in 2.218.0 due to NoMethodError #21763

Open
4 tasks done
ftab opened this issue Jan 2, 2024 · 2 comments
Open
4 tasks done

sync_code_signing breaks in 2.218.0 due to NoMethodError #21763

ftab opened this issue Jan 2, 2024 · 2 comments

Comments

@ftab
Copy link

ftab commented Jan 2, 2024

New Regression Checklist

Regression Information

  • Breaking version: 2.218.0
  • Last working version: 2.217.0

Regression Description

profile_device_ids = profile_devices.map(&:id).sort

This is getting an error:

in `devices_differ?': \e[31m[!] undefined method `map' for nil:NilClass\e[0m (NoMethodError)
Complete output when running fastlane, including the stack trace and command used
➜  ios-app git:(master) bundle exec fastlane adhoc
[✔] 🚀 
[13:07:59]: ------------------------------
[13:07:59]: --- Step: default_platform ---
[13:07:59]: ------------------------------
[13:07:59]: Driving the lane 'ios adhoc' 🚀
[13:07:59]: ---------------------------------------
[13:07:59]: --- Step: app_store_connect_api_key ---
[13:07:59]: ---------------------------------------
[13:07:59]: ------------------------------
[13:07:59]: --- Step: get_certificates ---
[13:07:59]: ------------------------------

+-----------------------------------------------------------------------------+
| Summary for cert 2.218.0 |
+-------------------------+---------------------------------------------------+
| api_key | ******** |
| development | false |
| force | false |
| generate_apple_certs | true |
| username | me@mydomain.com |
| keychain_path | /$HOME/Library/Keychains/login.keychain-db |
| skip_set_partition_list | false |
| platform | ios |
+-------------------------+---------------------------------------------------+

[13:07:59]: Creating authorization token for App Store Connect API
[13:07:59]: Found the certificate *** (Team Name) which is installed on the local machine. Using this one.
[13:07:59]: Verifying the certificate is properly installed locally...
[13:07:59]: Successfully installed certificate ***
[13:07:59]: Use signing certificate '***' from now on!
[13:07:59]: --------------------------------------
[13:07:59]: --- Step: get_provisioning_profile ---
[13:07:59]: --------------------------------------

+-------------------------------------------------------------------------+
| Summary for sigh 2.218.0 |
+-------------------------------------+-----------------------------------+
| adhoc | true |
| force | true |
| api_key | ******** |
| developer_id | false |
| development | false |
| skip_install | false |
| include_mac_in_profiles | false |
| app_identifier | com.mydomain.apps.myproject-ios |
| username | me@mydomain.com |
| ignore_profiles_with_different_name | false |
| cert_id | *** |
| skip_fetch_profiles | false |
| include_all_certificates | false |
| skip_certificate_verification | false |
| platform | ios |
| readonly | false |
| fail_on_name_taken | false |
+-------------------------------------+-----------------------------------+

[13:07:59]: Creating authorization token for App Store Connect API
[13:07:59]: Fetching profiles...
[13:08:00]: Verifying certificates...
[13:08:00]: Found 5 matching profile(s)
[13:08:00]: Recreating the profile
[13:08:01]: The name 'com.mydomain.apps.myproject-ios AdHoc' is already taken, using another one.
[13:08:02]: Creating new provisioning profile for 'com.mydomain.apps.myproject-ios' with name 'com.mydomain.apps.myproject-ios AdHoc 1704218881' for 'ios' platform
[13:08:03]: Downloading provisioning profile...
[13:08:03]: Successfully downloaded provisioning profile...
[13:08:03]: Installing provisioning profile...
/project_dir/AdHoc_com.mydomain.apps.myproject-ios.mobileprovision
[13:08:03]: Setting Provisioning Profile type to 'ad-hoc'
[13:08:03]: -------------------------------
[13:08:03]: --- Step: sync_code_signing ---
[13:08:03]: -------------------------------
[13:08:03]: Successfully loaded '/project_dir/fastlane/Matchfile' 📄

+-------------------------------------------------------------------------------------+
| Detected Values from './fastlane/Matchfile' |
+----------------+--------------------------------------------------------------------+
| git_url | https://gitlab.apps.mydomain.com/engineering/ios-codesigning.git |
| app_identifier | com.mydomain.apps.myproject-ios |
| username | me@mydomain.com |
+----------------+--------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------------------+
| Summary for match 2.218.0 |
+----------------------------------------+--------------------------------------------------------------------+
| force_for_new_devices | true |
| type | adhoc |
| api_key | ******** |
| readonly | false |
| generate_apple_certs | true |
| skip_provisioning_profiles | false |
| app_identifier | ["com.mydomain.apps.myproject-ios"] |
| username | me@mydomain.com |
| storage_mode | git |
| git_url | https://gitlab.apps.mydomain.com/engineering/ios-codesigning.git |
| git_branch | master |
| shallow_clone | false |
| clone_branch_directly | false |
| skip_google_cloud_account_confirmation | false |
| s3_skip_encryption | false |
| gitlab_host | https://gitlab.com |
| keychain_name | login.keychain |
| force | false |
| include_mac_in_profiles | false |
| include_all_certificates | false |
| force_for_new_certificates | false |
| skip_confirmation | false |
| safe_remove_certs | false |
| skip_docs | false |
| platform | ios |
| derive_catalyst_app_identifier | false |
| fail_on_name_taken | false |
| skip_certificate_matching | false |
| skip_set_partition_list | false |
| verbose | false |
+----------------------------------------+--------------------------------------------------------------------+

[13:08:03]: Cloning remote git repo...
[13:08:03]: If cloning the repo takes too long, you can use the clone_branch_directly option in match.
[13:08:03]: Checking out branch master...
[13:08:04]: 🔓 Successfully decrypted certificates repo
[13:08:04]: Verifying that the certificate and profile are still valid on the Dev Portal...
[13:08:04]: Creating authorization token for App Store Connect API
[13:08:04]: Installing certificate...

+------------------------------------------------------------------+
| Installed Certificate |
+-------------------+----------------------------------------------+
| User ID | *** |
| Common Name | Apple Distribution: Team Name (***) |
| Organisation Unit | *** |
| Organisation | Team Name |
| Country | US |
| Start Datetime | 2023-06-02 17:24:50 UTC |
| End Datetime | 2024-06-01 17:24:49 UTC |
+-------------------+----------------------------------------------+

+--------------------------------------------------------------------------------------------------------------------------------------+
| Lane Context |
+---------------------+----------------------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios adhoc |
| CERT_FILE_PATH | /project_dir/***.cer |
| CERT_CERTIFICATE_ID | *** |
| SIGH_PROFILE_PATH | /project_dir/AdHoc_com.mydomain.apps.myproject-ios.mobileprovi |
| | sion |
| SIGH_PROFILE_PATHS | ["/project_dir/AdHoc_com.mydomain.apps.myproject-ios.mobilepro |
| | vision"] |
| SIGH_UDID | *** |
| SIGH_UUID | *** |
| SIGH_NAME | com.mydomain.apps.myproject-ios AdHoc 1704218881 |
| SIGH_PROFILE_TYPE | ad-hoc |
+---------------------+----------------------------------------------------------------------------------------------------------------+

+------------------------------------------------+
| fastlane summary |
+------+---------------------------+-------------+
| Step | Action | Time (in s) |
+------+---------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | app_store_connect_api_key | 0 |
| 3 | get_certificates | 0 |
| 4 | get_provisioning_profile | 3 |
| 💥 | sync_code_signing | 2 |
+------+---------------------------+-------------+

[13:08:05]: fastlane finished with errors

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

➡️ Fastlane supply init: undefined method `name' for nil:NilClass
#21529 [open] 5 💬
4 weeks ago

➡️ Android: track_version_codes': \e[31m[!] undefined method flat_map' for nil:NilClass (NoMethodError)
#21500 [open] 10 💬
12 Oct 2023

➡️ sigh repair fails with "undefined method `id' for nil:NilClass (NoMethodError) certificates.map(&:id)" with Apple Distribution certificate type
#21295 [open] 2 💬
11 Oct 2023

and 130 more at: https://github.com/fastlane/fastlane/search?q=undefined%20method%20%60map%27%20for%20nil&type=Issues&utf8=✓

🔗 You can ⌘ + double-click on links to open them directly in your browser.
Traceback (most recent call last):
36: from /$HOME/.rvm/gems/ruby-2.7.8/bin/ruby_executable_hooks:22:in <main>' 35: from /$HOME/.rvm/gems/ruby-2.7.8/bin/ruby_executable_hooks:22:in eval'
34: from /$HOME/.rvm/gems/ruby-2.7.8/bin/fastlane:23:in <main>' 33: from /$HOME/.rvm/gems/ruby-2.7.8/bin/fastlane:23:in load'
32: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/bin/fastlane:23:in <top (required)>' 31: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in take_off'
30: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/commands_generator.rb:43:in start' 29: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/commands_generator.rb:354:in run'
28: from /$HOME/.rvm/gems/ruby-2.7.8/gems/commander-4.6.0/lib/commander/delegates.rb:18:in run!' 27: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in run!'
26: from /$HOME/.rvm/gems/ruby-2.7.8/gems/commander-4.6.0/lib/commander/runner.rb:444:in run_active_command' 25: from /$HOME/.rvm/gems/ruby-2.7.8/gems/commander-4.6.0/lib/commander/command.rb:157:in run'
24: from /$HOME/.rvm/gems/ruby-2.7.8/gems/commander-4.6.0/lib/commander/command.rb:187:in call' 23: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/commands_generator.rb:110:in block (2 levels) in run'
22: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/command_line_handler.rb:34:in handle' 21: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/lane_manager.rb:46:in cruise_lane'
20: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:45:in execute' 19: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:45:in chdir'
18: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:49:in block in execute' 17: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/lane.rb:41:in call'
16: from Fastfile:34:in block (2 levels) in parsing_binding' 15: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing'
14: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name' 13: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:229:in execute_action'
12: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:229:in chdir' 11: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action'
10: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action' 9: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action'
8: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/fastlane/lib/fastlane/actions/sync_code_signing.rb:19:in run' 7: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/runner.rb:104:in run'
6: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/runner.rb:104:in each' 5: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/runner.rb:105:in block in run'
4: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/runner.rb:105:in loop' 3: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/runner.rb:106:in block (2 levels) in run'
2: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/runner.rb:253:in fetch_provisioning_profile' 1: from /$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/profile_includes.rb:23:in should_force_include_all_devices?'
/$HOME/.rvm/gems/ruby-2.7.8/gems/fastlane-2.218.0/match/lib/match/profile_includes.rb:54:in devices_differ?': \e[31m[!] undefined method map' for nil:NilClass\e[0m (NoMethodError)

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 13.6.1
Ruby 2.7.8
Bundler? true
Git git version 2.39.1
Installation Source ~/.rvm/gems/ruby-2.7.8/bin/fastlane
Host macOS 13.6.1 (22G313)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.7.8/lib
OpenSSL Version OpenSSL 1.1.1w 11 Sep 2023
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 15.0.1
Swift Version 5.9

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)


platform :ios do
  desc "Build the application"

  before_all do |lane|
    app_store_connect_api_key(
      key_id: ENV["APP_STORE_CONNECT_API_KEY_ID"],
      issuer_id: ENV["APP_STORE_CONNECT_ISSUER_ID"],
      key_content: ENV["APP_STORE_CONNECT_API_KEY_CONTENT"]
    )
  end

  lane :adhoc do
    # Before calling match, we make sure all our devices are registered on the Apple Developer Portal
    get_certificates
    get_provisioning_profile(adhoc: true, force: true)
    sync_code_signing(force_for_new_devices: true, type: "adhoc")

    url_base = ENV['URL_BASE'] || 'myproject-ios.apps.mydomain.com'
    gym(
      export_method: "ad-hoc",
      export_options: {
        manifest: {
          appURL: "https://#{url_base}/Great App Here.ipa",
          displayImageURL: "https://#{url_base}/images/57x57.png",
          fullSizeImageURL: "https://#{url_base}/images/512x512.png"
        }
      } 
    )
  end

  lane :test do
    increment_build_number(build_number: ENV['CI_JOB_ID'])
    get_certificates
    get_provisioning_profile
    gym
    upload_to_testflight    
  end
end
`./fastlane/Appfile`
app_identifier("com.mydomain.apps.myproject-ios") # The bundle identifier of your app
apple_id("me@mydomain.com") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.4.0
executable-hooks 1.6.1
bundler-unload 1.0.2
rubygems-bundler 1.4.5
bundler 2.4.13
rake 13.1.0
rexml 3.2.6
CFPropertyList 3.0.6
public_suffix 5.0.4
addressable 2.8.6
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.3.0
aws-partitions 1.876.0
aws-sigv4 1.8.0
jmespath 1.6.2
aws-sdk-core 3.190.1
aws-sdk-kms 1.75.0
aws-sdk-s3 1.142.0
babosa 1.0.4
claide 1.1.0
colored 1.2
colored2 3.1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.5
domain_name 0.6.20231109
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.108.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.3.0
faraday-multipart 1.0.4
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.3
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.3.0
gh_inspector 1.1.3
google-cloud-env 2.1.0
jwt 2.7.1
multi_json 1.15.0
os 1.1.4
signet 0.18.0
googleauth 1.9.1
httpclient 2.8.3
mini_mime 1.1.5
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
webrick 1.8.1
google-apis-core 0.11.2
google-apis-androidpublisher_v3 0.54.0
google-apis-playcustomapp_v1 0.13.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.29.0
google-cloud-errors 1.3.1
google-cloud-core 1.6.1
google-cloud-storage 1.45.0
json 2.7.1
mini_magick 4.12.0
naturally 2.2.1
optparse 0.4.0
plist 3.7.1
rubyzip 2.3.2
security 0.1.3
simctl 1.6.10
terminal-notifier 2.0.0
unicode-display_width 2.5.0
terminal-table 3.0.2
tty-screen 0.8.2
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.23.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1

generated on: 2024-01-02

@ftab ftab changed the title sync_code_signing breaks after 2.217.0 due to nil error sync_code_signing breaks after 2.217.0 due to NilClass error Jan 2, 2024
@ftab ftab changed the title sync_code_signing breaks after 2.217.0 due to NilClass error sync_code_signing breaks after 2.217.0 due to NoMethodError Jan 2, 2024
@ftab ftab changed the title sync_code_signing breaks after 2.217.0 due to NoMethodError sync_code_signing breaks in 2.218.0 due to NoMethodError Jan 2, 2024
@nekrich
Copy link
Contributor

nekrich commented Jan 3, 2024

Same issue here: #21762.

@RetepV
Copy link

RetepV commented Jan 4, 2024

I had this exact same issue. I can confirm that it is fixed with the fix for #21767 (and #21762).

For reference: I saw that the fix was committed to 'master'. Then changed the line in my Gemfile from this:

gem 'fastlane'

To this:

gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => 'master'

Refreshed all my gems (I have them in a 'vendor' folder and just rm -rffed and redownloaded all). And the issue went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants