'Fastlane issue with fastlane match: Couldn't decrypt the repo, please make sure you enter the right password

I'm trying to learn fastlane and I'm currently blocked at fastlane match: https://docs.fastlane.tools/actions/match/#fastlane

Following the docs, I installed fastlane.

  • I created a private repository for the profiles and certificates.
  • I created an SSH key using a passphrase, example sfsfsdf
  • I added the SSH key to the ssh-agent and uploaded it to GitHub.

I ran then bundle exec fastlane match init and adjusted the Matchfile

Matchfile

git_url("[email protected]:my-repository/certificates.git")
git_branch("main")

type "development" # The default type, can be: appstore, adhoc, enterprise or development

app_identifier("com.mydomain.ios.project.v1")
username("[email protected]") 

Then I ran bundle exec fastlane match development to generate and install the Development certificates and profiles, which generates the following output:

fastlane could not check for updates error: 776: unexpected token at '<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><BucketName>kits-crashlytics-com</BucketName><RequestId>VX3SA</RequestId><HostId>hnZRvv3hulf/q50pxV5S1co0jPLJq0KgI6/1EB0jQEI+dWlLedQA=</HostId></Error>'
[15:53:38]: Successfully loaded '/Users/my-user/my-project/fastlane/Matchfile' 📄

+----------------+--------------------------------------+
|      Detected Values from './fastlane/Matchfile'      |
+----------------+--------------------------------------+
| git_url        | [email protected]:my-repository/
certificates.git                                    |
| git_branch     | main                                 |
| type           | development                          |
| app_identifier | com.mydomain.ios.project.v1.         |
| username       | [email protected]       |
+----------------+--------------------------------------+


+-----------------------+--------------------------------------+
|                   Summary for match 2.28.3                   |
+-----------------------+--------------------------------------+
| git_url               | [email protected]:my-repository/
certificates.git                           |
| git_branch            | main                                 |
| type                  | development                          |
| app_identifier        | com.mydomain.ios.project.v1.         |
| username              | [email protected]       |
| keychain_name         | login.keychain                       |
| readonly              | false                                |
| team_id               | TEAM_ID_NUMBER                       |
| verbose               | false                                |
| force                 | false                                |
| skip_confirmation     | false                                |
| shallow_clone         | false                                |
| force_for_new_devices | false                                |
| skip_docs             | false                                |
| platform              | ios                                  |
+-----------------------+--------------------------------------+

[15:53:38]: Cloning remote git repo...
[15:53:40]: Checking out branch main...
[15:53:40]: Enter the passphrase that should be used to encrypt/decrypt your certificates
[15:53:40]: This passphrase is specific per repository and will be stored in your local keychain
[15:53:40]: Make sure to remember the password, as you'll need it when you run match on a different machine
[15:53:40]: Passphrase for Git Repo: 

I entered the passphrase I used for my SSH key (sfsfsdf) and I saw the following error:

[15:59:09]: Couldn't decrypt the repo, please make sure you enter the right password!
keychain: "/Users/my-user/Library/Keychains/login.keychain-db"
version: 512
class: "inet"
attributes:
    0x00000007 <blob>="[email protected]:my-repository/certificates.git"
    0x00000008 <blob>=<NULL>
    "acct"<blob>=<NULL>
    "atyp"<blob>="dflt"
    "cdat"<timedate>=0x32303232303531303232353930395A00  "20220510225909Z\000"
    "crtr"<uint32>=<NULL>
    "cusi"<sint32>=<NULL>
    "desc"<blob>=<NULL>
    "icmt"<blob>=<NULL>
    "invi"<sint32>=<NULL>
    "mdat"<timedate>=0x32303232303531303232353930395A00  "20220510225909Z\000"
    "nega"<sint32>=<NULL>
    "path"<blob>=<NULL>
    "port"<uint32>=0x00000000 
    "prot"<blob>=<NULL>
    "ptcl"<uint32>=0x00000000 
    "scrp"<sint32>=<NULL>
    "sdmn"<blob>=<NULL>
    "srvr"<blob>="[email protected]:my-repository/certificates.git"
    "type"<uint32>=<NULL>
password has been deleted.
[15:59:09]: Enter the passphrase that should be used to encrypt/decrypt your certificates
[15:59:09]: This passphrase is specific per repository and will be stored in your local keychain
[15:59:09]: Make sure to remember the password, as you'll need it when you run match on a different machine
[15:59:09]: Passphrase for Git Repo: 

What am I doing wrong or not doing?

Thanks!



Solution 1:[1]

I'm facing a similar issue. So far the only solution I've seen is to add the password for the repo to the Matchfile as ENV["MATCH_PASSWORD"] = "[PASSWORD]".

This did not work for me, but it's the best I've found and it at least makes the error more obvious on the command line. My next attempt is going to be running fastlane match nuke and starting the process fresh.

This issue has more specifics about their reproducible steps and solution: https://github.com/fastlane/fastlane/issues/14879.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jimmy Cerone