fastlane / fastlane

πŸš€ The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.01k stars 5.66k forks source link

undefined method `each_pair` while running fastlane match #20963

Closed Sundea closed 1 year ago

Sundea commented 1 year ago

New Issue Checklist

Issue Description

I was trying to set up the Fastlane match with GitLab secure files. There is no ability to use auto-generation of certificates so, I used an import option.

and received following error

from /usr/local/bin/fastlane:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/ostruct.rb:94:in `initialize': undefined method `each_pair' for ["message", "404 Project Not Found"]:Array (NoMethodError)
Command executed

PRIVATE_TOKEN=some_token fastlane match import --type adhoc --skip_certificate_matching true --verbose

Complete output when running fastlane, including the stack trace and command used
 user@MAC  % PRIVATE_TOKEN=glpat-PXzNT4XgW3e3zNcU8xaC fastlane match import --type adhoc --skip_certificate_matching true --verbose
[βœ”] πŸš€ 
[11:50:37]: fastlane detected a Gemfile in the current directory
[11:50:37]: However, it seems like you didn't use `bundle exec`
[11:50:37]: To launch fastlane faster, please use
[11:50:37]: 
[11:50:37]: $ bundle exec fastlane match import --type adhoc --skip_certificate_matching true --verbose
[11:50:37]: 
[11:50:37]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
INFO [2023-01-04 11:50:38.83]: Successfully loaded '/Users/some_path/fastlane/Matchfile' πŸ“„

+----------------+--------------------------------------+
|      Detected Values from './fastlane/Matchfile'      |
+----------------+--------------------------------------+
| gitlab_project | gitlab/some_path/ |
|                |/ios-native                     |
| storage_mode   | gitlab_secure_files                  |
| type           | development                          |
+----------------+--------------------------------------+

 [2023-01-04 11:50:38.83]: Certificate (.cer) path:
/Users/some_path/certs/distribution/distribution.cer 
 [2023-01-04 11:51:05.46]: Private key (.p12) path:
/Users/some_path/certs/distribution/distribution_key.p12 
 [2023-01-04 11:51:08.04]: Provisioning profile (.mobileprovision or
.provisionprofile) path or leave empty to skip this file:
/Users/some_path/profiles/adhoc/AdHoc.mobileprovision 
WARN [2023-01-04 11:51:15.63]: To not be asked about this value, you can specify it using 'git_url'
 [2023-01-04 11:51:15.63]: URL to the git repo containing all the certificates:

INFO [2023-01-04 11:51:17.17]: Initializing match for GitLab project gitlab/some_path/ios-native

Looking for related GitHub issues on fastlane/fastlane...
Search query: undefined method `each_pair' for ["message", "404 Project Not Found"]:Array

URL: https://api.github.com/search/issues?q=undefined%20method%20%60each_pair%27%20for%20%5B%22message%22%2C%20%22404%20Project%20Not%20Found%22%5D%3AArray+repo: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
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/ostruct.rb:94:in `initialize': [!] undefined method `each_pair' for ["message", "404 Project Not Found"]:Array (NoMethodError)
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/secure_file.rb:12:in `new'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/secure_file.rb:12:in `initialize'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:51:in `new'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:51:in `block in files'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:50:in `each'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:50:in `files'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab_secure_files.rb:103:in `download'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/importer.rb:48:in `import_cert'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/commands_generator.rb:147:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/commands_generator.rb:189:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/commands_generator.rb:26:in `start'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in `take_off'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/bin/fastlane:23:in `'
    from /usr/local/bin/fastlane:23:in `load'
    from /usr/local/bin/fastlane:23:in `
' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/ostruct.rb:94:in `initialize': undefined method `each_pair' for ["message", "404 Project Not Found"]:Array (NoMethodError) from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/secure_file.rb:12:in `new' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/secure_file.rb:12:in `initialize' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:51:in `new' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:51:in `block in files' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:50:in `each' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab/client.rb:50:in `files' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/storage/gitlab_secure_files.rb:103:in `download' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/importer.rb:48:in `import_cert' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/commands_generator.rb:147:in `block (2 levels) in run' from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call' from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run' from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!' from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/commands_generator.rb:189:in `run' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/match/lib/match/commands_generator.rb:26:in `start' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in `take_off' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.211.0/bin/fastlane:23:in `' from /usr/local/bin/fastlane:23:in `load' from /usr/local/bin/fastlane:23:in `
'

Environment

🚫 fastlane environment 🚫 ### Stack | Key | Value | | --------------------------- | -------------------------------------------------------------- | | OS | 13.1 | | Ruby | 2.6.10 | | Bundler? | false | | Git | git version 2.37.1 (Apple Git-137.1) | | Installation Source | /usr/local/bin/fastlane | | Host | macOS 13.1 (22C65) | | Ruby Lib Dir | /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib | | OpenSSL Version | LibreSSL 2.8.3 | | Is contained | false | | Is homebrew | false | | Is installed via Fabric.app | false | | Xcode Path | /Applications/Xcode.app/Contents/Developer/ | | Xcode Version | 14.1 | | Swift Version | 5.7.1 | ### System Locale | Error | | --------------------------- | | No Locale with UTF8 found 🚫 | ### fastlane files:
`./fastlane/Fastfile` ```ruby # 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 import("lanes/utils.rb") import("lanes/firebase.rb") import("lanes/testflight.rb") import("lanes/tests.rb") import("lanes/archive.rb") default_platform(:ios) before_all do |lane| sh("cd .. && swiftgen") xcodegen() end lane :unit_tests do run_unit_tests() end lane :fb do |options| deliver_firebase(options) end lane :tf do |options| deliver_testflight(options) end lane :archive_build do |options| archive(options) end lane :archive_sim do |options| archive_simulator_build(options) end lane :archive_device do |options| archive_device_build(options) end ```
**No Appfile found** ### fastlane gems | Gem | Version | Update-Status | | -------- | ------- | ------------- | | fastlane | 2.211.0 | βœ… Up-To-Date | ### Loaded fastlane plugins: | Plugin | Version | Update-Status | | ----------------------------------------- | ------- | ------------- | | fastlane-plugin-badge | 1.5.0 | βœ… Up-To-Date | | fastlane-plugin-brew | 0.1.1 | βœ… Up-To-Date | | fastlane-plugin-firebase_app_distribution | 0.3.8 | βœ… Up-To-Date | | fastlane-plugin-xcodegen | 1.1.0 | βœ… Up-To-Date |
Loaded gems | Gem | Version | | ----------------------------------------- | ------------ | | atomos | 0.1.3 | | claide | 1.1.0 | | colored2 | 3.1.2 | | nanaimo | 0.3.0 | | rexml | 3.2.5 | | xcodeproj | 1.22.0 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | terminal-notifier | 2.0.0 | | unicode-display_width | 1.8.0 | | terminal-table | 1.8.0 | | plist | 3.6.0 | | addressable | 2.8.1 | | multipart-post | 2.0.0 | | word_wrap | 1.0.0 | | optparse | 0.1.1 | | tty-screen | 0.8.1 | | tty-cursor | 0.7.1 | | tty-spinner | 0.9.3 | | artifactory | 3.0.15 | | babosa | 1.0.4 | | colored | 1.2 | | highline | 2.0.3 | | commander | 4.6.0 | | excon | 0.95.0 | | unf_ext | 0.0.8.2 | | unf | 0.1.4 | | domain_name | 0.5.20190701 | | http-cookie | 1.0.5 | | faraday-cookie_jar | 0.0.7 | | faraday-em_http | 1.0.0 | | faraday-em_synchrony | 1.0.0 | | faraday-excon | 1.1.0 | | faraday-httpclient | 1.0.1 | | 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.2 | | faraday_middleware | 1.2.0 | | fastimage | 2.2.6 | | gh_inspector | 1.1.3 | | mini_magick | 4.12.0 | | naturally | 2.2.1 | | rubyzip | 2.3.2 | | security | 0.1.3 | | xcpretty-travis-formatter | 1.0.1 | | dotenv | 2.8.1 | | bundler | 2.4.2 | | simctl | 1.6.8 | | jwt | 2.6.0 | | uber | 0.1.0 | | declarative | 0.0.20 | | trailblazer-option | 0.1.2 | | representable | 3.2.0 | | retriable | 3.1.2 | | mini_mime | 1.1.2 | | memoist | 0.16.2 | | multi_json | 1.15.0 | | os | 1.1.4 | | signet | 0.17.0 | | googleauth | 1.3.0 | | httpclient | 2.8.3 | | google-apis-core | 0.9.2 | | google-apis-playcustomapp_v1 | 0.12.0 | | google-apis-androidpublisher_v3 | 0.32.0 | | google-cloud-env | 1.6.0 | | google-cloud-errors | 1.3.0 | | google-cloud-core | 1.6.0 | | google-apis-iamcredentials_v1 | 0.16.0 | | google-apis-storage_v1 | 0.19.0 | | rake | 13.0.6 | | digest-crc | 0.6.4 | | google-cloud-storage | 1.44.0 | | jmespath | 1.6.2 | | aws-partitions | 1.687.0 | | aws-eventstream | 1.2.0 | | aws-sigv4 | 1.5.2 | | aws-sdk-core | 3.168.4 | | aws-sdk-kms | 1.61.0 | | aws-sdk-s3 | 1.117.2 | | CFPropertyList | 3.0.5 | | public_suffix | 5.0.1 | | json | 2.6.3 | | webrick | 1.7.0 | | emoji_regex | 3.2.3 | | forwardable | 1.2.0 | | logger | 1.3.0 | | date | 2.0.3 | | stringio | 0.0.2 | | ipaddr | 1.2.2 | | openssl | 2.1.2 | | zlib | 1.0.0 | | mutex_m | 0.1.0 | | ostruct | 0.1.0 | | strscan | 1.0.0 | | io-console | 0.4.7 | | fileutils | 1.1.0 | | etc | 1.0.1 | | libxml-ruby | 3.2.1 | | psych | 3.1.0 | | badge | 0.13.0 | | fastlane-plugin-badge | 1.5.0 | | fastlane-plugin-brew | 0.1.1 | | fastlane-plugin-firebase_app_distribution | 0.3.8 | | fastlane-plugin-xcodegen | 1.1.0 |
*generated on:* **2023-01-04**
bck01215 commented 1 year ago

gitlab/some_path/ios-native is being searched as the project.

Make sure gitlab_project("") is set properly. Note this only works on gitlab.com. Not private instances as far as I can tell. gitlab-org is your gitlab org and then the path to your project. So if your team is xyz and your project abc you would do gitlab_project("xyz/abc")

brax10ward commented 1 year ago

gitlab/some_path/ios-native is being searched as the project.

Make sure gitlab_project("") is set properly. Note this only works on gitlab.com. Not private instances as far as I can tell. gitlab-org is your gitlab org and then the path to your project. So if your team is xyz and your project abc you would do gitlab_project("xyz/abc")

@bck01215 Thank you for the clarification! None of the articles or documentation were clear on this.