0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CircleCIでfastlaneのgymがタイムアウトしてしまう時の対処

0
Posted at

CircleCI で、fastlane の gym を使ってリリース用の ipa を作成するステップで、毎回タイムアウトになってしまう問題にハマったことがあったので、その時の対処法を記事にします。

事象内容

[06:23:34]: ▸ Signing openssl_grpc.framework (in target 'FreTre' from project 'FreTre')

Too long with no output (exceeded 10m0s): context deadline exceeded

Signing のところで、毎回スタックするので fastlane match で行っている証明書関連の設定に問題があると考え、match 実行時のログを確認しました。

match実行時のログ
[06:18:00]: Keychain password for /Users/distiller/Library/Keychains/login.keychain-db was not specified and not found in your keychain. Specify the 'keychain_password' option to prevent the UI permission popup when code signing
[06:18:00]: Setting key partition list... (this can take a minute if there are a lot of keys installed)
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
[06:18:00]:
[06:18:00]: Could not configure imported keychain item (certificate) to prevent UI permission popup when code signing
Check if you supplied the correct `keychain_password` for keychain: `/Users/distiller/Library/Keychains/login.keychain-db`
security: SecKeychainItemSetAccessWithPassword: The user name or passphrase you entered is not correct.

確認する限り、証明書をキーチェーンへ import するのに失敗しているようです。

ログ全文
[06:17:59]: -------------------
[06:17:59]: --- Step: match ---
[06:17:59]: -------------------
[06:17:59]: Successfully loaded '/Users/distiller/project/fastlane/Matchfile' 📄

+----------------------------------------------------------------+
|          Detected Values from './fastlane/Matchfile'           |
+----------------+-----------------------------------------------+
| git_url        | https://github.com/****/****.git              |
| storage_mode   | git                                           |
| app_identifier | *********************                         |
| username       | ********@gmail.com                            |
| type           | development                                   |
+----------------+-----------------------------------------------+


+----------------------------------------------------------------------------------------+
|                               Summary for match 2.226.0                                |
+----------------------------------------+-----------------------------------------------+
| api_key                                | ********                                      |
| type                                   | appstore                                      |
| readonly                               | true                                          |
| generate_apple_certs                   | true                                          |
| skip_provisioning_profiles             | false                                         |
| app_identifier                         | ["*********************"]                     |
| username                               | ********@gmail.com                            |
| storage_mode                           | git                                           |
| git_url                                | https://github.com/****/****.git              |
| git_branch                             | master                                        |
| shallow_clone                          | false                                         |
| clone_branch_directly                  | false                                         |
| git_basic_authorization                | ********                                      |
| skip_google_cloud_account_confirmation | false                                         |
| s3_skip_encryption                     | false                                         |
| gitlab_host                            | https://gitlab.com                            |
| keychain_name                          | login.keychain                                |
| force                                  | false                                         |
| force_for_new_devices                  | 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                                         |
| force_legacy_encryption                | false                                         |
| verbose                                | false                                         |
+----------------------------------------+-----------------------------------------------+

[06:17:59]: Cloning remote git repo...
[06:17:59]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
[06:18:00]: Checking out branch master...
[06:18:00]: 🔓  Successfully decrypted certificates repo
[06:18:00]: Installing certificate...
[06:18:00]: Keychain password for /Users/distiller/Library/Keychains/login.keychain-db was not specified and not found in your keychain. Specify the 'keychain_password' option to prevent the UI permission popup when code signing
[06:18:00]: Setting key partition list... (this can take a minute if there are a lot of keys installed)
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
[06:18:00]:
[06:18:00]: Could not configure imported keychain item (certificate) to prevent UI permission popup when code signing
Check if you supplied the correct `keychain_password` for keychain: `/Users/distiller/Library/Keychains/login.keychain-db`
security: SecKeychainItemSetAccessWithPassword: The user name or passphrase you entered is not correct.
[06:18:00]:
[06:18:00]: Please look at the following docs to see how to set a keychain password:
[06:18:00]:  - https://docs.fastlane.tools/actions/sync_code_signing
[06:18:00]:  - https://docs.fastlane.tools/actions/get_certificates
[06:18:01]: Keychain password for /Users/distiller/Library/Keychains/login.keychain-db was not specified and not found in your keychain. Specify the 'keychain_password' option to prevent the UI permission popup when code signing
[06:18:01]: Setting key partition list... (this can take a minute if there are a lot of keys installed)
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
[06:18:01]:
[06:18:01]: Could not configure imported keychain item (certificate) to prevent UI permission popup when code signing
Check if you supplied the correct `keychain_password` for keychain: `/Users/distiller/Library/Keychains/login.keychain-db`
security: SecKeychainItemSetAccessWithPassword: The user name or passphrase you entered is not correct.
[06:18:01]:
[06:18:01]: Please look at the following docs to see how to set a keychain password:
[06:18:01]:  - https://docs.fastlane.tools/actions/sync_code_signing
[06:18:01]:  - https://docs.fastlane.tools/actions/get_certificates

+------------------------------------------------------------------+
|                      Installed Certificate                       |
+-------------------+----------------------------------------------+
| User ID           | ********                                     |
| Common Name       | Apple Distribution: **** **** (********)     |
| Organisation Unit | ********                                     |
| Organisation      | **** ****                                    |
| Country           | JP                                           |
| Start Datetime    | 2025-05-29 14:17:43 UTC                      |
| End Datetime      | 2026-05-29 14:17:42 UTC                      |
+-------------------+----------------------------------------------+

[06:18:01]: Installing provisioning profile...

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                                Installed Provisioning Profile                                                                                 |
+---------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+
| Parameter           | Environment Variable                                 | Value                                                                                                            |
+---------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+
| App Identifier      |                                                      | *********************                                                                                            |
| Type                |                                                      | appstore                                                                                                         |
| Platform            |                                                      | ios                                                                                                              |
| Profile UUID        | sigh_*********************_appstore                  | ********-****-****-****-************                                                                             |
| Profile Name        | sigh_*********************_appstore_profile-name     | match AppStore *********************                                                                             |
| Profile Path        | sigh_*********************_appstore_profile-path     | /Users/distiller/Library/MobileDevice/Provisioning Profiles/********-****-****-****-************.mobileprovision |
| Development Team ID | sigh_*********************_appstore_team-id          | ********                                                                                                         |
| Certificate Name    | sigh_*********************_appstore_certificate-name | Apple Distribution: **** **** (********)                                                                         |
+---------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+

[06:18:01]: All required keys, certificates and provisioning profiles are installed 🙌
[06:18:01]: Setting Provisioning Profile type to 'app-store'

対処法

調べてみると、CircleCI で fastlane を実行する時は、決められた統合手順を踏む必要がありました。

公式のドキュメントをにある通り、setup_circle_ciで、match で使用するためのキーチェーンを作成するようで、逆にこれをやっていないと match で取得した証明書をキーチェーンに保存する処理が失敗します。

ドキュメントの通り、Fastfile に以下を追加して、再度 CI を実行すると、gym でタイムアウトする問題が解消されました。

before_all do
    setup_circle_ci
end

凡ミスでしたね、、同じ事象が起きている方で、解決の手助けになれば幸いです!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?