fastlane: [Regression in 2.118.0] create_keychain creates a file in a wrong location: error Could not locate the provided keychain
New Issue Checklist
- Updated fastlane to the latest version
- I read the Contribution Guidelines
- I read docs.fastlane.tools
- I searched for existing GitHub issues
Issue Description
Having a code in my Fastfile:
if is_ci? and ACTION != "jazzy"
begin
delete_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"]
)
rescue Exception => e
end
create_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"],
password: ENV["MATCH_KEYCHAIN_PASSWORD"],
timeout: 3600
)
end
Everything were fine until we updated fastlane to 2.118.0. Now match fails with an error
Could not locate the provided keychain. Tried: /Users/user/Library/Keychains/ios-build-db /Users/user/Library/Keychains/ios-build.keychain-db /Users/user/Library/Keychains/ios-build /Users/user/Library/Keychains/ios-build.keychain
And looks like create_keychain starts to create a file in ~/Library/Keychains/~/Library/Keychains/ios-build.keychain which is mind blowing.

Complete output when running fastlane, including the stack trace and command used
[01:43:17]: $ cd /Users/user/.jenkins/workspace/iOS/Project && agvtool new-version -all 1.1.0 && cd -
[01:43:18]: ▸ Setting version of project Modules to:
[01:43:18]: ▸ 1.1.0.
[01:43:18]: ▸ Also setting CFBundleVersion key (assuming it exists)
[01:43:18]: ▸ Updating CFBundleVersion in Info.plist(s)...
[01:43:18]: ▸ Updated CFBundleVersion in "Project.xcodeproj/../Project/Resources/Info.plist" to 1.1.0
[01:43:18]: ▸ Updated CFBundleVersion in "Project.xcodeproj/../Project Tests/Info.plist" to 1.78.6283
[01:43:18]: ▸ /Users/user/.jenkins/workspace/iOS/Project
[01:43:19]: -------------------
[01:43:19]: --- Step: match ---
[01:43:19]: -------------------
+-----------------------+----------------------------------------------+
| Summary for match 2.118.0 |
+-----------------------+----------------------------------------------+
| git_branch | master |
| type | adhoc |
| app_identifier | ["com.app.id"] |
| force_for_new_devices | true |
| force | true |
| clone_branch_directly | true |
| readonly | false |
| username | **** |
| team_id | **** |
| team_name | [REDACTED] |
| storage_mode | git |
| git_url | git@github.com:company/iOS-certificates.git |
| shallow_clone | false |
| keychain_name | ios-build.keychain |
| keychain_password | ******** |
| skip_confirmation | false |
| skip_docs | false |
| platform | ios |
| verbose | false |
+-----------------------+----------------------------------------------+
[01:43:19]: Cloning remote git repo...
[01:44:28]: 🔓 Successfully decrypted certificates repo
[01:44:28]: Verifying that the certificate and profile are still valid on the Dev Portal...
Available session is not valid any more. Continuing with normal login.
[01:44:32]: Installing certificate...
[01:44:32]: There are no local code signing identities found.
You can run `security find-identity -v -p codesigning ios-build.keychain` to get this output.
This Stack Overflow thread has more information: https://stackoverflow.com/q/35390072/774.
(Check in Keychain Access for an expired WWDR certificate: https://stackoverflow.com/a/35409835/774 has more info.)
[01:44:35]: ▸ [01:44:35]: Take notice that this output may contain sensitive information, or simply information that you don't want to make public.
[01:44:35]: ▸ [01:44:35]: Open https://github.com/fastlane/fastlane/issues/new to submit a new issue ✅
+------------------+-----------+
| Lane Context |
+------------------+-----------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios auto |
| PRODUCE_APPLE_ID | |
| VERSION_NUMBER | 1.1.0 |
| BUILD_NUMBER | 1.1.0 |
+------------------+-----------+
[01:44:35]: Could not locate the provided keychain. Tried:
/Users/user/Library/Keychains/ios-build-db
/Users/user/Library/Keychains/ios-build.keychain-db
/Users/user/Library/Keychains/ios-build
/Users/user/Library/Keychains/ios-build.keychain
/Users/user/.jenkins/workspace/iOS/Project/ios-build-db
/Users/user/.jenkins/workspace/iOS/Project/ios-build.keychain-db
/Users/user/.jenkins/workspace/iOS/Project/ios-build
/Users/user/.jenkins/workspace/iOS/Project/ios-build.keychain
+------+---------------------------------------------------------------+-------------+
| fastlane summary |
+------+---------------------------------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+---------------------------------------------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | git_branch | 0 |
| 3 | awk -F '=' '/PRODUCT_BUNDLE_IDENTIFIER = com.app/ {print $2 | 0 |
| 4 | is_ci | 0 |
| 5 | clear_derived_data | 0 |
| 6 | is_ci | 0 |
| 💥 | delete_keychain | 0 |
| 8 | create_keychain | 0 |
| 9 | sed -i '' "s#\(Pods\.framework in Frameworks \*/ = {isa = PBX | 0 |
| 10 | Switch to ios beta lane | 0 |
| 11 | is_ci | 0 |
| 12 | update_app_identifier | 0 |
| 13 | produce | 5 |
| 14 | is_ci | 0 |
| 15 | Switch to ios build lane | 0 |
| 16 | increment_version_number | 2 |
| 17 | increment_build_number | 1 |
| 💥 | match | 73 |
| 19 | is_ci | 0 |
| 20 | fastlane env | 3 |
+------+---------------------------------------------------------------+-------------+
[01:44:35]: fastlane finished with errors
[!] Could not locate the provided keychain. Tried:
/Users/user/Library/Keychains/ios-build-db
/Users/user/Library/Keychains/ios-build.keychain-db
/Users/user/Library/Keychains/ios-build
/Users/user/Library/Keychains/ios-build.keychain
/Users/user/.jenkins/workspace/iOS/Project/ios-build-db
/Users/user/.jenkins/workspace/iOS/Project/ios-build.keychain-db
/Users/user/.jenkins/workspace/iOS/Project/ios-build
/Users/user/.jenkins/workspace/iOS/Project/ios-build.keychain
script returned exit code 1
Environment
✅ fastlane environment ✅
Stack
| Key | Value |
|---|---|
| OS | 10.13.6 |
| Ruby | 2.3.1 |
| Bundler? | true |
| Git | git version 2.17.2 (Apple Git-113) |
| Installation Source | ~/.rvm/gems/ruby-2.3.1/bin/fastlane |
| Host | Mac OS X 10.13.6 (17G65) |
| Ruby Lib Dir | ~/.rvm/rubies/ruby-2.3.1/lib |
| OpenSSL Version | OpenSSL 1.0.2n 7 Dec 2017 |
| Is contained | false |
| Is homebrew | false |
| Is installed via Fabric.app | false |
| Xcode Path | /Applications/Xcode.app/Contents/Developer/ |
| Xcode Version | 10.1 |
System Locale
| Variable | Value | |
|---|---|---|
| LANG | ru_RU.UTF-8 | ✅ |
| LC_ALL | ||
| LANGUAGE |
fastlane files:
`./Appfile`
app_identifier "com.app.id"
apple_id "****"
itc_team_id "[REDACTED]"
team_id "****"
team_name "[REDACTED]"
fastlane gems
| Gem | Version | Update-Status |
|---|---|---|
| fastlane | 2.118.0 | ✅ Up-To-Date |
Loaded fastlane plugins:
No plugins Loaded
Loaded gems
| Gem | Version |
|---|---|
| did_you_mean | 1.0.0 |
| io-console | 0.4.5 |
| CFPropertyList | 3.0.0 |
| concurrent-ruby | 1.1.5 |
| i18n | 0.9.5 |
| minitest | 5.11.3 |
| thread_safe | 0.3.6 |
| tzinfo | 1.2.5 |
| activesupport | 4.2.11.1 |
| public_suffix | 2.0.5 |
| addressable | 2.6.0 |
| atomos | 0.1.3 |
| babosa | 1.0.2 |
| bundler | 1.16.1 |
| claide | 1.0.2 |
| fuzzy_match | 2.0.4 |
| nap | 1.1.0 |
| cocoapods-core | 1.5.3 |
| cocoapods-deintegrate | 1.0.3 |
| cocoapods-downloader | 1.2.2 |
| cocoapods-plugins | 1.0.0 |
| cocoapods-search | 1.0.0 |
| cocoapods-stats | 1.1.0 |
| netrc | 0.11.0 |
| cocoapods-trunk | 1.3.1 |
| cocoapods-try | 1.1.0 |
| colored2 | 3.1.2 |
| escape | 0.0.4 |
| fourflusher | 2.0.1 |
| gh_inspector | 1.1.3 |
| molinillo | 0.6.6 |
| ruby-macho | 1.4.0 |
| nanaimo | 0.2.6 |
| xcodeproj | 1.8.1 |
| cocoapods | 1.5.3 |
| colored | 1.2 |
| highline | 1.7.10 |
| commander-fastlane | 4.4.6 |
| declarative | 0.0.10 |
| declarative-option | 0.1.0 |
| digest-crc | 0.4.1 |
| unf_ext | 0.0.7.5 |
| unf | 0.1.4 |
| domain_name | 0.5.20180417 |
| dotenv | 2.7.1 |
| emoji_regex | 1.0.1 |
| excon | 0.62.0 |
| multipart-post | 2.0.0 |
| faraday | 0.15.4 |
| http-cookie | 1.0.3 |
| faraday-cookie_jar | 0.0.6 |
| faraday_middleware | 0.13.1 |
| fastimage | 2.1.5 |
| jwt | 2.1.0 |
| memoist | 0.16.0 |
| multi_json | 1.13.1 |
| os | 1.0.0 |
| signet | 0.11.0 |
| googleauth | 0.6.7 |
| httpclient | 2.8.3 |
| mime-types-data | 3.2018.0812 |
| mime-types | 3.2.2 |
| uber | 0.1.0 |
| representable | 3.0.4 |
| retriable | 3.1.2 |
| google-api-client | 0.23.9 |
| google-cloud-env | 1.0.5 |
| google-cloud-core | 1.3.0 |
| google-cloud-storage | 1.16.0 |
| json | 2.2.0 |
| mini_magick | 4.5.1 |
| multi_xml | 0.6.0 |
| plist | 3.5.0 |
| rubyzip | 1.2.2 |
| security | 0.1.3 |
| naturally | 2.2.0 |
| simctl | 1.6.5 |
| slack-notifier | 2.3.2 |
| terminal-notifier | 2.0.0 |
| unicode-display_width | 1.5.0 |
| terminal-table | 1.8.0 |
| tty-screen | 0.6.5 |
| tty-cursor | 0.6.1 |
| tty-spinner | 0.9.0 |
| word_wrap | 1.0.0 |
| rouge | 2.0.7 |
| xcpretty | 0.3.0 |
| xcpretty-travis-formatter | 1.0.0 |
| ffi | 1.10.0 |
| mustache | 1.1.0 |
| open4 | 1.3.4 |
| redcarpet | 3.4.0 |
| rb-fsevent | 0.10.3 |
| rb-inotify | 0.10.0 |
| sass-listen | 4.0.0 |
| sass | 3.6.0 |
| sqlite3 | 1.3.13 |
| liferaft | 0.0.6 |
| xcinvoke | 0.3.0 |
| jazzy | 0.9.5 |
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (8 by maintainers)
Commits related to this issue
- Fix for Keychains with spaces #14310 & create_keychain #14418 with UnitTests — committed to bhuvandaruwala/fastlane by bhuvandaruwala 5 years ago
- Fix for Keychains with spaces #14310 & create_keychain #14418 with UnitTests from 2.118.0 — committed to bhuvandaruwala/fastlane by bhuvandaruwala 5 years ago
- modifications on how the Home Directory is called for Fix of Keychains with spaces #14310 & create_keychain #14418 — committed to bhuvandaruwala/fastlane by bhuvandaruwala 5 years ago
Hey all!
2.118.1is out now which reverted the PR that was the cause of this issue. I will make sure that when we go back to re-add this PR that tests get added to account for how Travis and CircleCI handle the keychains. Sorry about the issues, fam ❤️I updated to 2.118.1 and it works for me
@joshdholtz I’ve updated to 2.118.1 and I still have this issue. Are you sure that your revert PR fixed it?
Any others who can confirm that it’s still not working?