fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.59k stars 5.71k forks source link

Match import to s3 Crash on encrypting. #21965

Closed evgeny44 closed 6 months ago

evgeny44 commented 6 months ago

New Issue Checklist

Issue Description

I am trying to import distribution profile to match s3. The problem is that it crashes while trying to encrypt the p12. I exported this p12 from keychain with a blank password. Because originialy this p12 was protected by password and as far as I know match import doesn't work with password protected .p12.

Command executed

fastlane match import \ --storage-mode s3 \ --s3_bucket \ --type appstore \ --s3_region \ --s3_object_prefix \ --s3_secret_access_key \ --skip_certificate_matching true \ --s3_access_key \ --team_id \ --readonly true \ --verbose

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

[17:52:36]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile [2024-04-10 17:52:38.43]: Certificate (.cer) path: /our/path/to.cer [2024-04-10 17:52:40.76]: Private key (.p12) path: /our/path/to.p12 [2024-04-10 17:52:52.55]: Provisioning profile (.mobileprovision or .provisionprofile) path or leave empty to skip this file:

DEBUG [2024-04-10 17:52:54.43]: Successfully downloaded files from S3 to /var/folders/21/wm4p7bb92kv24_zkfg4pwcy40000gn/T/d20240410-36810-1pa9o7j WARN [2024-04-10 17:52:54.43]: To not be asked about this value, you can specify it using 'git_url' [2024-04-10 17:52:54.43]: URL to the git repo containing all the certificates: INFO [2024-04-10 17:52:55.71]: 🔓 Successfully decrypted certificates repo INFO [2024-04-10 17:52:55.72]: Repo is at: '/var/folders/21/wm4p7bb92kv24_zkfg4pwcy40000gn/T/d20240410-36810-1pa9o7j' ERROR [2024-04-10 17:52:55.77]: couldn't set additional authenticated data

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 /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in crash!': [!] Error encrypting '/var/folders/21/wm4p7bb92kv24_zkfg4pwcy40000gn/T/d20240410-36810-1pa9o7j/path/certs/distribution/to.p12' (FastlaneCore::Interface::FastlaneCrash) from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:inmethod_missing' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:120:in rescue in encrypt_specific_file' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:112:inencrypt_specific_file' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:36:in block in encrypt_files' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:78:inblock in iterate' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:76:in each' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:76:initerate' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:34:in encrypt_files' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/importer.rb:122:inimport_cert' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/commands_generator.rb:144:in block (2 levels) in run' from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:incall' 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:inrun_active_command' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.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:inrun!' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/commands_generator.rb:186:in run' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/commands_generator.rb:26:instart' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in take_off' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/bin/fastlane:23:in<top (required)>' from /usr/local/bin/fastlane:23:in load' from /usr/local/bin/fastlane:23:in

' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/encryption.rb:86:in auth_data=': couldn't set additional authenticated data (OpenSSL::Cipher::CipherError) from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/encryption.rb:86:inkeyivgen' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/encryption.rb:55:in encrypt' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/encryption.rb:98:inencrypt' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/encryption.rb:141:in encrypt' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:115:inencrypt_specific_file' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:36:in block in encrypt_files' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:78:inblock in iterate' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:76:in each' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:76:initerate' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/encryption/openssl.rb:34:in encrypt_files' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/importer.rb:122:inimport_cert' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/commands_generator.rb:144:in block (2 levels) in run' from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:incall' 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:inrun_active_command' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.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:inrun!' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/commands_generator.rb:186:in run' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/match/lib/match/commands_generator.rb:26:instart' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in take_off' from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.220.0/bin/fastlane:23:in<top (required)>' from /usr/local/bin/fastlane:23:in load' from /usr/local/bin/fastlane:23:in
'

Environment

Stack

Key Value
OS 13.2.1
Ruby 2.6.10
Bundler? false
Git git version 2.39.2 (Apple Git-143)
Installation Source /usr/local/bin/fastlane
Host macOS 13.2.1 (22D68)
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.3.1
Swift Version 5.8.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE en_US.UTF-8

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems | Gem | Version | | ------------------------------- | ------------ | | did_you_mean | 1.3.0 | | artifactory | 3.0.15 | | babosa | 1.0.4 | | colored | 1.2 | | highline | 2.0.3 | | commander | 4.6.0 | | dotenv | 2.8.1 | | emoji_regex | 3.2.3 | | faraday_middleware | 1.2.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 | | gh_inspector | 1.1.3 | | google-cloud-env | 1.6.0 | | naturally | 2.2.1 | | optparse | 0.1.1 | | rubyzip | 2.3.2 | | security | 0.1.5 | | terminal-notifier | 2.0.0 | | unicode-display_width | 1.8.0 | | terminal-table | 3.0.2 | | tty-screen | 0.8.1 | | tty-cursor | 0.7.1 | | tty-spinner | 0.9.3 | | word_wrap | 1.0.0 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | xcpretty-travis-formatter | 1.0.1 | | public_suffix | 5.0.3 | | addressable | 2.8.5 | | aws-eventstream | 1.2.0 | | aws-sigv4 | 1.6.0 | | aws-partitions | 1.820.0 | | jmespath | 1.6.2 | | aws-sdk-core | 3.181.0 | | aws-sdk-kms | 1.71.0 | | aws-sdk-s3 | 1.134.0 | | bundler | 2.3.20 | | rexml | 3.2.6 | | CFPropertyList | 3.0.6 | | excon | 0.102.0 | | ruby2_keywords | 0.0.5 | | faraday-retry | 1.0.3 | | faraday-rack | 1.0.0 | | faraday-patron | 1.0.0 | | faraday-net_http_persistent | 1.2.0 | | faraday-net_http | 1.0.1 | | multipart-post | 2.3.0 | | faraday-multipart | 1.0.4 | | faraday-httpclient | 1.0.1 | | faraday-excon | 1.1.0 | | faraday-em_synchrony | 1.0.0 | | faraday-em_http | 1.0.0 | | faraday | 1.10.3 | | fastimage | 2.2.7 | | webrick | 1.8.1 | | httpclient | 2.8.3 | | multi_json | 1.15.0 | | jwt | 2.7.1 | | signet | 0.18.0 | | os | 1.1.4 | | googleauth | 1.8.0 | | mini_mime | 1.1.5 | | retriable | 3.1.2 | | trailblazer-option | 0.1.2 | | declarative | 0.0.20 | | uber | 0.1.0 | | representable | 3.2.0 | | google-apis-core | 0.11.1 | | google-apis-androidpublisher_v3 | 0.49.0 | | google-apis-playcustomapp_v1 | 0.13.0 | | rake | 13.0.6 | | digest-crc | 0.6.5 | | google-apis-storage_v1 | 0.19.0 | | google-apis-iamcredentials_v1 | 0.17.0 | | google-cloud-errors | 1.3.1 | | google-cloud-core | 1.6.0 | | google-cloud-storage | 1.44.0 | | json | 2.6.3 | | mini_magick | 4.12.0 | | plist | 3.7.0 | | simctl | 1.6.10 | | nanaimo | 0.3.0 | | colored2 | 3.1.2 | | claide | 1.1.0 | | atomos | 0.1.3 | | xcodeproj | 1.23.0 | | 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 |
MadCoder39 commented 6 months ago

Also facing the same issue with very similar setup. Don't know what to do. Please help!

evgeny44 commented 6 months ago

for anyone struggling with the same problem. rollback to 2.219. make sure your p12 is encrypted with an empty password